You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by sp...@apache.org on 2024/12/20 08:23:52 UTC

(iotdb) branch feature/update_prometheus_reporter created (now f785ebe29d7)

This is an automated email from the ASF dual-hosted git repository.

spricoder pushed a change to branch feature/update_prometheus_reporter
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at f785ebe29d7 add Content-Type in prometheus reporter

This branch includes the following new commits:

     new f785ebe29d7 add Content-Type in prometheus reporter

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(iotdb) 01/01: add Content-Type in prometheus reporter

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spricoder pushed a commit to branch feature/update_prometheus_reporter
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit f785ebe29d7355a64ee06f3223383c6c18bc0a07
Author: spricoder <sp...@qq.com>
AuthorDate: Fri Dec 20 16:23:30 2024 +0800

    add Content-Type in prometheus reporter
---
 .../apache/iotdb/metrics/reporter/prometheus/PrometheusReporter.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/prometheus/PrometheusReporter.java b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/prometheus/PrometheusReporter.java
index 08f1e7becd7..612c3e074f9 100644
--- a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/prometheus/PrometheusReporter.java
+++ b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/prometheus/PrometheusReporter.java
@@ -80,7 +80,10 @@ public class PrometheusReporter implements Reporter {
                   routes ->
                       routes.get(
                           "/metrics",
-                          (request, response) -> response.sendString(Mono.just(scrape()))))
+                          (request, response) ->
+                              response
+                                  .addHeader("Content-Type", "text/plain")
+                                  .sendString(Mono.just(scrape()))))
               .bindNow();
     } catch (Throwable e) {
       // catch Throwable rather than Exception here because the code above might cause a