This is an automated email from the ASF dual-hosted git repository.
zhouky pushed a commit to branch branch-0.3
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/branch-0.3 by this push:
new 02c8a7f96 [CELEBORN-1076] Using text/plain content type for prometheus
metrics
02c8a7f96 is described below
commit 02c8a7f9684b533417b114e8af6566c474a180d1
Author: fwang12 <[email protected]>
AuthorDate: Mon Oct 23 17:56:01 2023 +0800
[CELEBORN-1076] Using text/plain content type for prometheus metrics
Refer
https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#basic-info
The http content type is better be `text/plain`.
As describe in
https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#basic-info.
Advantages
```
Human-readable
Easy to assemble, especially for minimalistic cases (no nesting required)
Readable line by line (with the exception of type hints and docstrings)
```
The http content type change.
<img width="910" alt="image"
src="https://github.com/apache/incubator-celeborn/assets/6757692/6cc9b071-3149-48fb-9aab-66506a72be3f">
Closes #2014 from turboFei/metrics_plain.
Authored-by: fwang12 <[email protected]>
Signed-off-by: zky.zhoukeyong <[email protected]>
---
.../org/apache/celeborn/server/common/http/HttpRequestHandler.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/service/src/main/scala/org/apache/celeborn/server/common/http/HttpRequestHandler.scala
b/service/src/main/scala/org/apache/celeborn/server/common/http/HttpRequestHandler.scala
index 779b8e476..dcb2c7acc 100644
---
a/service/src/main/scala/org/apache/celeborn/server/common/http/HttpRequestHandler.scala
+++
b/service/src/main/scala/org/apache/celeborn/server/common/http/HttpRequestHandler.scala
@@ -56,7 +56,7 @@ class HttpRequestHandler(
HttpVersion.HTTP_1_1,
HttpResponseStatus.OK,
Unpooled.copiedBuffer(response, CharsetUtil.UTF_8))
- res.headers().set(HttpHeaderNames.CONTENT_TYPE, "text/html;
charset=UTF-8");
+ res.headers().set(HttpHeaderNames.CONTENT_TYPE, "text/plain;
charset=UTF-8");
ctx.writeAndFlush(res).addListener(ChannelFutureListener.CLOSE);
}