Module pavex_tracing::fields
source · Expand description
Utilities to log common resources with consistent naming and representations.
For well-known resources, this module exposes:
- A constant holding the conventional field name used when logging that resource
- A function to compute the conventional log representation of that resource in the context of an HTTP API
For example, you have HTTP_REQUEST_METHOD
and http_request_method
for the
http.request.method
field.
The naming follows OpenTelemetry’s semantic convention whenever possible.
§Exhaustiveness
The module doesn’t cover the entirety of OpenTelemetry’s semantic convention specification.
Feel free to open a PR if you need a stable field that isn’t currently covered!
Constants§
- The field name to record the
Debug
representation of an error.
This field doesn’t appear in OpenTelemetry’s semantic convention specification. - The field name to record the
Display
representation of an error.
This field doesn’t appear in OpenTelemetry’s semantic convention specification. - The field name to record the chain of sources for an error.
This field doesn’t appear in OpenTelemetry’s semantic convention specification. - The field name for the HTTP method of the incoming request (if canonical), according to OpenTelemetry’s semantic convention.
- The field name to record the server-generated identifier for this request.
This field doesn’t appear in OpenTelemetry’s semantic convention specification. - The field name for the HTTP status code of the outgoing response, according to OpenTelemetry’s semantic convention.
- The field name for path pattern matched by the incoming request, according to OpenTelemetry’s semantic convention.
- The name of the network protocol used by the incoming request, according to OpenTelemetry’s semantic convention.
- The version of the network protocol used by the incoming request, according to OpenTelemetry’s semantic convention.
- The path targeted by the incoming request, according to OpenTelemetry’s semantic convention.
- The query string of the incoming request, according to OpenTelemetry’s semantic convention.
- The user agent header for the incoming request, according to OpenTelemetry’s semantic convention.
Functions§
- The canonical representation for the value in
ERROR_DETAILS
. - The canonical representation for the value in
ERROR_MESSAGE
. - The canonical representation for the value in
ERROR_SOURCE_CHAIN
. - The canonical representation for the value in
HTTP_REQUEST_METHOD
. - The canonical representation for the value in
HTTP_REQUEST_SERVER_ID
. - The canonical representation for the value in
HTTP_RESPONSE_STATUS_CODE
. - The canonical representation for the value in
HTTP_ROUTE
. - The canonical representation for the value in
NETWORK_PROTOCOL_NAME
. - The canonical representation for the value in
NETWORK_PROTOCOL_VERSION
. - The canonical representation for the value in
URL_PATH
. - The canonical representation for the value in
URL_QUERY
. - The canonical representation for the value in
USER_AGENT_ORIGINAL
.