You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should support users specifying the http.route and error.type attribute on automatically instrumented HTTP metrics.
To do this, I propose we copy the relevant attributes off the associated span on span completion. I suggest we do this as follows:
The span for the HTTP server is created in Rust (as an OtelSpan struct) and is associated with the request.
The span object can be exposed to JS with an op, similar to how op_http_get_request_method_and_url works. It takes the external for the HttpRequest, and returns a OtelSpan. The span is then put into AsyncContext.
The user can now update the span (adding http.route, error.type, etc).
When the response is finalized, we read the attributes relevant to the metric we'd like to record, in Rust, from the span.
The text was updated successfully, but these errors were encountered:
lucacasonato
changed the title
[ote] Add support for specifying http.route on automatic HTTP server metrics
[otel] Add support for specifying http.route on automatic HTTP server metrics
Mar 10, 2025
We should support users specifying the
http.route
anderror.type
attribute on automatically instrumented HTTP metrics.To do this, I propose we copy the relevant attributes off the associated span on span completion. I suggest we do this as follows:
OtelSpan
struct) and is associated with the request.op_http_get_request_method_and_url
works. It takes the external for theHttpRequest
, and returns aOtelSpan
. The span is then put intoAsyncContext
.http.route
,error.type
, etc).The text was updated successfully, but these errors were encountered: