This is an automated email from the ASF dual-hosted git repository.
zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new 655d5762c [CELEBORN-1076] Using text/plain content type for prometheus
metrics
655d5762c is described below
commit 655d5762ca1b9271af892cfe369fe0c69cd135e2
Author: fwang12 <[email protected]>
AuthorDate: Mon Oct 23 17:56:01 2023 +0800
[CELEBORN-1076] Using text/plain content type for prometheus metrics
### What changes were proposed in this pull request?
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`.
### Why are the changes needed?
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)
```
### Does this PR introduce _any_ user-facing change?
The http content type change.
### How was this patch tested?
<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 86409c6bd..da59f9f5c 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
@@ -61,7 +61,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)
}
}