Skip to content

Allow setting span attributes in opentelemetry tracing #7261

@felix-hilden

Description

@felix-hilden

Issue Details

In the tracing module, it would be very handy to be able to set span attributes, not just the span name. For example for the span name to be a low cardinality matcher path (#6469) and an attribute containing the ID, or in my case adding a user ID.

I think in the caddyfile it might look like this:

server_domain {
    tracing {
        span website
        span_attr user_id {http.request.id}
    }
}

but anything will really do! I'm quite new to Caddy.

Nginx does something similar with its OTEL module in the otel_span_attr.

Assistance Disclosure

No response

If AI was used, describe the extent to which it was used.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions