apache / apache/hugegraph

[Bug] prometheus metric format is invalid

Open
#2,354 8 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

None

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

### Environment (环境信息)

hugegraph in k8s using prometheus and grafana as service monitor.

### Expected & Actual behavior (期望与实际表现)

![image](https://github.com/apache/incubator-hugegraph/assets/34210641/abfdfe32-5fd7-4146-a407-d3847b475424)
prometheus metrics format is invalid. After some investigations and code review, I think that the problem would probably be that this [PR](https://github.com/apache/incubator-hugegraph/pull/2286) do not use the correct data exposition format that prometheus community required. The acceptable histogram format can be viewed as follows:
```
# A histogram, which has a pretty complex representation in the text format:
# HELP http_request_duration_seconds A histogram of the request duration.
# TYPE http_request_duration_seconds histogram
http_request_duration_seconds_bucket{le="0.05"} 24054
http_request_duration_seconds_bucket{le="0.1"} 33444
http_request_duration_seconds_bucket{le="0.2"} 100392
http_request_duration_seconds_bucket{le="0.5"} 129389
http_request_duration_seconds_bucket{le="1"} 133988
http_request_duration_seconds_bucket{le="+Inf"} 144320
http_request_duration_seconds_sum 53423
http_request_duration_seconds_count 144320
```
and I do also think the correct metric type here is supposed to be `summary` rather than `histogram` according to the prometheus [best practice](https://prometheus.io/docs/practices/histograms/) documentation.

By the way, I am willing to provide a PR to fix this issue as well as grafana dashboard configuration after I figure it out .

### Vertex/Edge example (问题点 / 边数据举例)

_No response_

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.