webdevops / azure-metrics-exporter

Azure Monitor metrics exporter for Prometheus with dimension support, template engine and ServiceDiscovery
MIT License
123 stars 25 forks source link

Retrieve all metrics for specific resources/resourcetypes #37

Open erroltuparker opened 1 year ago

erroltuparker commented 1 year ago

I've noticed on the documentation that metrics is listed as not required on the tables for querying, but when it's not set, no data is retrieved.

Is there a way to configure the params so that all metrics for a resource type is collected rather than outlining every available metric listed on the azure website?

I've tried using metricsNamespace and metricFilter but i just keep getting an error stating below

"Failed to find metric configuration for provider: Microsoft.Network, resource Type: expressRouteCircuits, metric: *, Valid metrics: BitsInPerSecond,BitsOutPerSecond,BgpAvailability,ArpAvailability,QosDropBitsInPerSecond,QosDropBitsOutPerSecond,GlobalReachBitsInPerSecond,GlobalReachBitsOutPerSecond,FastPathRoutesCountForCircuit\"\n}

Any ideas as I want to try to keep the Prometheus configuration file small and there are some resources that I want to obtain all the metrics for.

mblaschke commented 1 year ago

hm.. AFAIK the Azure API doesn't have a way to automatically fetch all metrics and it also depends on the resource type and sometimes on the SKU. The azure-metrics-exporter is just a Azure API client which translates the Azure metrics to Prometheus metrics. These metrics can also be different for different clouds (eg. on premise cloud or China cloud) so it's really difficult to define a standard.

erroltuparker commented 1 year ago

Sorry for the delay, end of year is supposed to slow down not speed up.

That's interesting as it is at least aware of what the valid metrics are due to the error message.

Is there a way to write a command or catch for if metric value is blank or * for the resourcetype to perform a call to the PossibleMetricClassValues function (which I assume is what is being called as part of the error to generate the list) then create a list on that output?

I would personally try to investigate/work on it, but my GO skills are basically 0