You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Gyorgy Ruck (Jira)" <ji...@apache.org> on 2021/03/23 09:13:00 UTC

[jira] [Commented] (HDDS-5010) PrometheusMetricsSink TYPE is duplicated for multi-dimension metrics

    [ https://issues.apache.org/jira/browse/HDDS-5010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17306913#comment-17306913 ] 

Gyorgy Ruck commented on HDDS-5010:
-----------------------------------

I've proposed a fix here, please review:
https://github.com/apache/ozone/pull/2074

> 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
>              Labels: pull-request-available
>
> 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-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org