RobustPerception / azure_metrics_exporter

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

Prefix for tag based labels #70

Closed rolandvarga closed 4 years ago

rolandvarga commented 4 years ago

This change is a follow up to #66 and introduces two fixes.

  1. @brian-brazil as you pointed out during the review of that change, it is important to differentiate between meta-data coming from Azure Monitor and tags defined by our users, as they can clash. My recommendation was to prefix tags in order to do so, however this change never made it to the final PR. I am proposing this PR to introduce these prefixes. Also, I went ahead and removed the invalid label prefix check as that has become obsolete with current change.

  2. We are generating the resource_name label from AzureResource.Name. This can cause inconsistency when we try to map metrics against azure_resource_info, as certain resource types contain a sub resource name that is used in resource_name. To overcome this limitation this change proposes to overwrite the resource_name label the same way we do for all the other metrics.

brian-brazil commented 4 years ago

This looks good, would you mind adding a unittest?

rolandvarga commented 4 years ago

This looks good, would you mind adding a unittest?

@brian-brazil tests added!

brian-brazil commented 4 years ago

Thanks!