azure-metrics-exporter icon indicating copy to clipboard operation
azure-metrics-exporter copied to clipboard

metricsFilter only export the first filter as "dimension"

Open chris8205 opened this issue 2 years ago • 2 comments

possible to "change" the metricsFilter to put the filtered dimension value also as dedicated "key-value pair" ex. metricFilter: ["HttpStatusGroup eq '*'","BackendPool eq '*'"]

actual result is like

- azure_metrics_name{aggregation="average", container="azure-metrics-exporter", **dimension="2xx"**, endpoint="http-metrics", instance="xxx.xxx.xxx.xxx:8080", interval="PT1M", job="amex", metric="BackendResponseStatus", namespace="k8s-system", pod="xxxxxxxxx-tnskx", resourceGroup="xxxxxx-rg", resourceID="/subscriptions/xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/xxxxxxx-rg/providers/microsoft.network/applicationgateways/xxxxxxxxx-agw-01", resourceName="xxxxxxxxxxxx-agw-01", service="amex", subscriptionID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", subscriptionName="[xxxxx] XXXXX", timespan="PT1M", unit="Count"}

--> dimension:"2xx"

is it possible to enhance it with

  • httpstatusgroup="2xx"
  • backendpool=""

ex:

- azure_metrics_name{aggregation="average", container="azure-metrics-exporter", **httpstatusgroup="2xx", backendpool="<backendpoolname>"**, endpoint="http-metrics", instance="xxx.xxx.xxx.xxx:8080", interval="PT1M", job="amex", metric="BackendResponseStatus", namespace="k8s-system", pod="xxxxxxxxx-tnskx", resourceGroup="xxxxxx-rg", resourceID="/subscriptions/xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/xxxxxxx-rg/providers/microsoft.network/applicationgateways/xxxxxxxxx-agw-01", resourceName="xxxxxxxxxxxx-agw-01", service="amex", subscriptionID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", subscriptionName="[xxxxx] XXXXX", timespan="PT1M", unit="Count"}

so its possible to create metrics more "flexible" but can be filtered

or create a "dimension" selector to select one or more dimension(s) to export

chris8205 avatar Jul 28 '23 09:07 chris8205

info: possible microsoft doesn't return all dimensions per default no dimensions can be retourned. and if metricsFilter is set only one of these filters are returned as "dimension" so "decode" steps only in "single-dimension" and returns the value as ' dimension="" '

i suggest to remove the "dimension" prefix and return always the key-name without any pre- or suffix

chris8205 avatar Jul 28 '23 10:07 chris8205

you can query mutiple dimensions using ["HttpStatusGroup eq '*' and BackendPool eq '*'"]. that's the format of the Azure Metrics API.

Keep in mind that you set metricTop to a higher value as you might get many results.

mblaschke avatar Oct 23 '23 22:10 mblaschke