ClientSignals.Request (client_signals v0.4.3)

Copy Markdown

Bounded server-side classification and route helpers for incoming client-signal headers.

The returned operator and agent values are safe to use as metric labels.

Summary

Functions

Classifies incoming header values into bounded operator and agent labels.

Returns a bounded route metric label and whether the request is tracked.

Functions

classify(interactive, agent, ci)

Classifies incoming header values into bounded operator and agent labels.

interactive is the instrumentation sentinel. Parent is deliberately not considered because parent-process lookup is not reliable enough for request classification. CI takes precedence over agent, which takes precedence over interactive. The agent label is preserved for CI requests.

tracked_route(method, route_template, request_path, prefixes)

Returns a bounded route metric label and whether the request is tracked.

A matched route template is preferred. For an unmatched request, the raw request path is used only for prefix selection and is never returned.