krakend / krakend-otel

KrakenD component for OpenTelemetry
Apache License 2.0
8 stars 10 forks source link

Custom Metric Attributes #22

Open rassmate opened 4 months ago

rassmate commented 4 months ago

If applied, plugins can use the LabelExtractor to get the Labeler from the context and use the returned Labeler to add custom metric labels to the server and client metrics generated.

With this in place, a server plugin could easily add custom metrics to the standard ones to customize the metrics. We could for example write a simple plugin that decodes a JWT Bearer Token and adds a claim value to the server and client metrics.

The auth validator could then with some small adjustments allow for this to be configured since it already reads the JWT and the claims.