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

Hook support for adding custom dynamic metric attributes/ dimensions #4943

Open
alexa-gt opened this issue Aug 22, 2024 · 0 comments
Open

Hook support for adding custom dynamic metric attributes/ dimensions #4943

alexa-gt opened this issue Aug 22, 2024 · 0 comments

Comments

@alexa-gt
Copy link

Is your feature request related to a problem? Please describe

I am currently looking at implementing the following but running into an issue of not being able to add custom attributes/dimension, namely peer.service to the http.server.duration/ http.server.request.duration metric.

Describe the solution you'd like to see

The ability to add custom attributes and dimensions as a hook to the http.server.duration/ http.server.request.duration metric emitted by @opentelemetry/instrumentation-http, with something of the following signature:

export interface HttpRequestCustomMetricAttributeFunction {
    (request: ClientRequest, response: ServerResponse, incomingMessage: IncomingMessage): Attributes;
}

Describe alternatives you've considered

  • Stick strictly to the semconv metric
    • allows no deviation or possibility of deviation without completely ditching the autoinstrumentation library, or writing a custom middleware.
  • spanmetrics connector in the OTEL connector with the selected dimension
    • this is not possible for my use case as I am unable to deploy otel-col in my architecture in the near term. It has to be an app-solution.
  • this hack that embeds additional info in http.route.
    • seems very strange to build an app's routing system around a workaround

Additional context

None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant