RobustPerception / azure_metrics_exporter

Azure metrics exporter for Prometheus
Apache License 2.0
133 stars 70 forks source link

Set metric namespace? #25

Open carlpett opened 6 years ago

carlpett commented 6 years ago

Right now the metric names are a bit all over the place, since we just take what we get from Azure and use that as the name. Could we set the namespace to azure? This would be a breaking change of course. As a motivation, the current approach seems to hurt discoverability of the metrics in my environment at least, since the majority of exporters/applications do some prefixing out their names. People could first query for {job="azure-metrics"} and see what is available, but from what I've seen this doesn't happen.

brian-brazil commented 6 years ago

I see discoverability as a tooling problem downstream, as with most applications they would not share a common prefix (think process_). A breaking change to workaround this in one exporter doesn't feel right to me.

carlpett commented 6 years ago

Yeah, agreed in principle. That downstream tooling isn't available anywhere, though (as far as I know neither Prometheus UI nor Grafana has it), so thus the proposal. I'm fine with just doing some relabeling for prefixing, though, if this is just an issue for the teams I work with, rather than a common thing. Here, however, inexperienced Prometheus users find it confusing.

adam-resdiary commented 5 years ago

@brian-brazil what about adding a flag to the exporter so you could do something like:

./azure_metrics_exporter --metrics.prefix azure

And it would optionally prefix all the metrics with azure_. That way it wouldn't be a breaking change, but would allow people to set a prefix if they wanted.

Given the metric names are generated automatically, and some of them are a bit unintuitive anyway, I'm not convinced you're likely to be able to aggregate them with metrics from another exporter anyway (because the metric names are pretty unlikely to match exactly).

For example cpu_percent_percent_average gives you the Average CPU percentage for an SQL Server database (amongst other resources). It makes sense that the same metric name should be consistent within the Azure exporter, but it doesn't seem likely to me that other exporters would happen to choose cpu_percent_percent_average as a name, making me think that azure_cpu_percent_percent_average would work just as well.

Just a thought 😄

brian-brazil commented 5 years ago

Metric names are not something that should be configurable by an operator.

On Fri 19 Apr 2019, 13:51 Adam Connelly, notifications@github.com wrote:

@brian-brazil https://github.com/brian-brazil what about adding a flag to the exporter so you could do something like:

./azure_metrics_exporter --metrics.prefix azure

And it would optionally prefix all the metrics with azure_. That way it wouldn't be a breaking change, but would allow people to set a prefix if they wanted.

Given the metric names are generated automatically, and some of them are a bit unintuitive anyway, I'm not convinced you're likely to be able to aggregate them with metrics from another exporter anyway (because the metric names are pretty unlikely to match exactly).

For example cpu_percent_percent_average gives you the Average CPU percentage for an SQL Server database (amongst other resources). It makes sense that the same metric name should be consistent within the Azure exporter, but it doesn't seem likely to me that other exporters would happen to choose cpu_percent_percent_average as a name, making me think that azure_cpu_percent_percent_average would work just as well.

Just a thought 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RobustPerception/azure_metrics_exporter/issues/25#issuecomment-484870105, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWJG5U4Q6YD7ECUHY7MQSLPRGW5LANCNFSM4FXEHTUA .

sepich commented 5 years ago

+1 for this, for now have to do:

    metric_relabel_configs:
      - source_labels: [__name__]
        replacement: azure_${1}
        target_label: __name__

But it works because only Azure metrics are returned. If/when exporter would start to return go or own process metrics - mess would arrive!

mcbenjemaa commented 4 years ago
        metric_relabel_configs:
          - source_labels: [kubernetes_name]
            regex: '^azure-metrics-exporter$'
            replacement: azure_${1}
            target_label: __name__

i did this, but does not work,

the metric name are gone image