RobustPerception / azure_metrics_exporter

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

Fix: Make ResourceTypes optional for ResourceTag #89

Closed forestsword closed 4 years ago

forestsword commented 4 years ago

resource_types: optional list of types kept in the list of resources gathered by tag. If none are specified, then all the resources are kept. All defined metrics must exist for each processed resource.

I made it required in #88

brian-brazil commented 4 years ago

So where was the mistake?

forestsword commented 4 years ago

I made validation of ResourceTag require that the ResourceTypes array not be of size 0.

https://github.com/RobustPerception/azure_metrics_exporter/blob/14c489247c28f7bac67fe10661416105e3166056/config/config.go#L111-L113

It's allowed to be empty to return everything.

forestsword commented 4 years ago

I guess the mistake was assuming the logic would be the same as ResourceGroup which does require that it's non-empty.

brian-brazil commented 4 years ago

Thanks for explaining and correcting!