[ https://issues.apache.org/jira/browse/HDDS-5010?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marton Elek reassigned HDDS-5010: --------------------------------- Assignee: Gyorgy Ruck > PrometheusMetricsSink TYPE is duplicated for multi-dimension metrics > -------------------------------------------------------------------- > > Key: HDDS-5010 > URL: https://issues.apache.org/jira/browse/HDDS-5010 > Project: Apache Ozone > Issue Type: Bug > Affects Versions: 1.0.0 > Reporter: Gyorgy Ruck > Assignee: Gyorgy Ruck > Priority: Major > > Currently, all the internal metrics exposed via the *PrometheusMetricsSink* > has their own *# TYPE* definition even the metrics are repeatedly appearing > in the endpoint due to different labels, e.g. > > {code:java} > # TYPE hdds_dispatcher_counter counter > hdds_dispatcher_counter{type="PutBlock",hostname="gruck-ozone-1.gruck-ozone.root.hwx.site"} > 0 > ... > # TYPE hdds_dispatcher_counter counter > hdds_dispatcher_counter{type="ReadContainer",hostname="gruck-ozone-1.gruck-ozone.root.hwx.site"} > 0 > {code} > > Source of this: > [https://github.com/apache/ozone/blob/9fca2a788ca0ad39bbf8abb3af2a4f733cf8de16/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/PrometheusMetricsSink.java#L68] > > The expected output should be categorized like this, # TYPE: > [https://prometheus.io/docs/guides/multi-target-exporter/#basic-querying-of-multi-target-exporters] > > {code:java} > # TYPE hdds_dispatcher_counter counter > hdds_dispatcher_counter{type="PutBlock",hostname="gruck-ozone-1.gruck-ozone.root.hwx.site"} > 0 > hdds_dispatcher_counter{type="ReadContainer",hostname="gruck-ozone-1.gruck-ozone.root.hwx.site"} > 0 > ...{code} > > In case we are not categorizing the same metrics with different labels under > the same # TYPE definition it could make decoders fail, like: > [https://github.com/prometheus/common/blob/90d71d7138448baa26007aa224ee917eea49f897/expfmt/text_parse.go#L511] > {code:java} > second TYPE line for metric name "hdds_dispatcher_counter", or TYPE reported > after samples > {code} > Additionally, it's not advisable to use type as a label but this is not an > issue from the decoder POV: > [https://prometheus.io/docs/instrumenting/writing_exporters/#labels] > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org