Skip to main content

HTTP_ROUTE

Constant HTTP_ROUTE 

pub const HTTP_ROUTE: &'static str;
Available on crate feature opentelemetry only.
Expand description

The matched route template for the request. This MUST be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders.

§Notes

MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include the application root if there is one.

A static path segment is a part of the route template with a fixed, low-cardinality value. This includes literal strings like /users/ and placeholders that are constrained to a finite, predefined set of values, e.g. {controller} or {action}.

A dynamic path segment is a placeholder for a value that can have high cardinality and is not constrained to a predefined list like static path segments.

Instrumentations SHOULD use routing information provided by the corresponding web framework. They SHOULD pick the most precise source of routing information and MAY support custom route formatting. Instrumentations SHOULD document the format and the API used to obtain the route string.

§Examples

  • "/users/:userID?"
  • "my-controller/my-action/{id?}"