This PR makes changes to priority to support distributed tracing and sampling.
In distributed tracing, an upstream process may set an HTTP header indicating that the current request should be sampled. We need to determine if that header was present, and optionally make a decision about whether to sample the request if it is not already set. The application code may also need to increase priority for the trace later, e.g. if there is an error in the request.
This PR sets the default priority as nil instead of 1, allowing code to identify if it has been set already.
The application can make a sampling decision if it is the first application in the trace, otherwise the current value will be maintained. This PR adds functions to get and set the current trace priority.
This PR makes changes to priority to support distributed tracing and sampling.
In distributed tracing, an upstream process may set an HTTP header indicating that the current request should be sampled. We need to determine if that header was present, and optionally make a decision about whether to sample the request if it is not already set. The application code may also need to increase priority for the trace later, e.g. if there is an error in the request.
This PR sets the default priority as
nil
instead of 1, allowing code to identify if it has been set already. The application can make a sampling decision if it is the first application in the trace, otherwise the current value will be maintained. This PR adds functions to get and set the current trace priority.Most of the details are specific to the back end library, and are handled by
spandex_datadog
in this PR: https://github.com/spandex-project/spandex_datadog/pull/52Features:
Breaking Changes:
Potentially Breaking Changes:
Config
instead ofMix.Config
inconfig
filesBug Fixes: