Skip to content

Add per quest customized attribute to http metrics instrumentation #5382

Open
@NickiHua

Description

@NickiHua

Problem Statement

We are trying to add instrumentation to our http server and client with go opentelemetry http instrumentation. Our caller will have some special header sets indicating the caller identity and we would like to emit that in the http metrics, e.g. http.server.duration then we can have statistics of the latency for the specific user.

It looks like labeler can only set some static customized attributes but not per request attributes.

Is there a way to do that? Let the meter to read the http request header and set that in the metrics for every request? Or we have to implement our own otel http instrumentation?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions