Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter by metric name and aggregation #37420

Open
an-mmx opened this issue Jan 22, 2025 · 1 comment · May be fixed by #37421
Open

Filter by metric name and aggregation #37420

an-mmx opened this issue Jan 22, 2025 · 1 comment · May be fixed by #37421
Labels
enhancement New feature or request needs triage New item requiring triage receiver/azuremonitor

Comments

@an-mmx
Copy link
Contributor

an-mmx commented Jan 22, 2025

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

@an-mmx an-mmx added enhancement New feature or request needs triage New item requiring triage labels Jan 22, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage receiver/azuremonitor
Projects
None yet
1 participant