Description
Component(s)
receiver/azuremonitor
Is your feature request related to a problem? Please describe.
It worth to implement filtering by metrics name and aggregation for Azure Monitor Receiver.
Motivation
Some resources and services in Azure expose many metrics available through the Azure Monitor API. It is not always nexessary to fetch all of them (and further filter out only metrics we actually need). Moreover, each Azure metric transformed into multiple OTEL metric since for each aggregation receiver creates a new metric: if we have 36 metrics and 5 aggregations (Minimum, Maximum, Total, Average, Count) it results in 180 OTEL metrics.
Reducing number of metrics additionally decrease expenses on Azure Monitor API calls.
Describe the solution you'd like
Introduce additional configuration options for the receiver to limit the metrics and/or aggregations fetched from the Azure API.
Option name: metrics
Option type: array
Value type: string
, value must be an Azure Monitor-compatible metric name, see supported metrics per resource type: https://learn.microsoft.com/en-us/azure/azure-monitor/reference/metrics-index
Value format: <metric_name>[/<aggregation>]
, where the value can include the name of the aggregation being fetched, followed by a /
(slash)
Default behavior: Maintain the default behavior where all available metrics per namespace/services are fetched.
Proposed notation is:
receivers:
azuremonitor/eventhub:
subscription_id: "${env:AM_SUBSCRIPTION_ID}"
tenant_id: "${env:AM_TENANT_ID}"
client_id: "${env:AM_SP_CLIENT_ID}"
client_secret: "${env:AM_SP_CLIENT_SECRET}"
collection_interval: 1m
initial_delay: 1s
resource_groups:
- ${env:AM_RESOURCE_GROUP}
services:
- microsoft.eventhub/namespaces
metrics:
# fetch "CPU Usage" metric with every supported aggregations
- NamespaceCpuUsage
# fetch "Incoming Messages" metric with aggregation "Total"
- IncomingMessages/Total
# fetch "Active Connections" metric with aggregation "Maximum"
- ActiveConnections/Maximum
Describe alternatives you've considered
No response
Additional context
No response