Open chinwobble opened 2 weeks ago
An official way of filtering metrics is being defined in the OpenTelemetry specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#metricfilter
The AddView
API in the OpenTelemetry .NET SDK allows for dropping metrics:
https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/metrics/customizing-the-sdk#drop-an-instrument
There is an overload that accepts a delegate that may allow for conditionally dropping metric points. I'm traveling currently but will take a look next week.
Question
Is there any way to filter metrics before sending to HostedGrafana?
My apps is sending tonnes of bucketed metrics for things like connecting to keyvault.
The problem is that the adaptive metrics don't provide fine grained enough control over which label values I want to keep or drop.
metric
http_client_request_duration_seconds_bucket
has a label calledserver_address
. Ifserver_address = keyvault
I want to drop those series, if not I want to keep them.