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

Chesnay Schepler commented on FLINK-17495:
------------------------------------------

I have some different thoughts on the matter, that I have put into the issue 
description. In short, I want to evaluate this option in the root metric 
groups, adding configured labels to the variables map, which should be picked 
up automatically by all reporters that care about labeling.

I don't quite see the use-case for per-reporter labels yet; DataDog is an 
unfortunate mistake of the past, and one of the motivating factors why I'm 
apprehensive about reporter-specific solutions to such problems. Nevertheless, 
if we were to go down that route, then yes the ReporterScopedSettings would be 
the right place, but the reporters shouldn't have to do anything special. All 
reporters that care about labels retrieve them via MetricGroup#getAllVariables, 
and the FrontMetricGroup should inject the configured labels. (Reporters don't 
even have access to the ReporterScopedSettings).

 

> Add support for custom variables
> --------------------------------
>
>                 Key: FLINK-17495
>                 URL: https://issues.apache.org/jira/browse/FLINK-17495
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Metrics
>            Reporter: jinhai
>            Priority: Minor
>              Labels: auto-deprioritized-major, pull-request-available
>
> Allow users to configure additional labels, presumably via a new config 
> option {{metrics.scope.variables.add.}}
> E.g.,
> {code:java}
> metrics.scope.variables.add: key1:value1;key2:value2 {code}
> Configured variables should be added to the variables map of the root metric 
> group; this may allow us in the future (once we have generalized scope 
> formats a bit) to include them there as well.
>  
> Original description:
> {quote}We need to add some custom labels on Prometheus, so we can query by 
> them.?? ??
> Now we can add jobName\groupingKey to PrometheusPushGatewayReporter in 
> version 1.10, but not in PrometheusReporter.
> Can we add AbstractPrometheusReporter#addDimension method to support this, so 
> they will be no differences except for the metrics exposing mechanism 
> pulling/pushing.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to