Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HTTP span attributes

tracing-otel::http::span::make_request_span records shared HTTP server attributes. axum-otel adds framework-specific values before the remote parent context is applied.

AttributeSource
http.request.methodRequest method
server.addressHost header
network.protocol.nameHTTP protocol family
network.protocol.versionHTTP version
url.pathURI path
url.queryURI query
url.schemeURI scheme or forwarding field used by the shared extractor
user_agent.originalUser-Agent header
request_idX-Request-Id, then Request-Id
trace_idActive OpenTelemetry trace context
http.routeAxum matched route
client.addressAxum ConnectInfo<SocketAddr> peer IP
otel.nameMethod plus matched route when available
otel.kindOpenTelemetry server span kind
http.response.status_codeInteger response status recorded on response
otel.status_code / otel.status_descriptionResponse/failure callbacks

The names follow the OpenTelemetry HTTP span semantic conventions where applicable. The library does not promise to emit every attribute in that specification; values are recorded only when the request or framework adapter provides them.

Attribute migration

Recent releases replaced older field names:

Previous attributeCurrent attribute
http.hostserver.address
http.user_agentuser_agent.original
http.client_ipclient.address

Update dashboards, alerts, queries, and sampling rules together with the library upgrade. http.response.status_code is recorded as an integer.

Adapter authors can call make_request_span(level, request, callback). The callback runs exactly once before remote-parent application. Record adapter-owned otel.name and otel.kind inside that callback because the OpenTelemetry span is materialized when the parent is applied.