mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-31 14:11:50 +08:00
Add fields method (#226)
Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
This commit is contained in:
@ -2,6 +2,9 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Add fields method
|
||||
([#226](https://github.com/open-telemetry/opentelemetry-python/pull/226))
|
||||
|
||||
## Version 0.15b0
|
||||
|
||||
Released 2020-11-02
|
||||
|
@ -106,6 +106,19 @@ class DatadogFormat(TextMapPropagator):
|
||||
span.context.trace_state[constants.DD_ORIGIN],
|
||||
)
|
||||
|
||||
def fields(self):
|
||||
"""Returns a set with the fields set in `inject`.
|
||||
|
||||
See
|
||||
`opentelemetry.trace.propagation.textmap.TextMapPropagator.fields`
|
||||
"""
|
||||
return {
|
||||
self.TRACE_ID_KEY,
|
||||
self.PARENT_ID_KEY,
|
||||
self.SAMPLING_PRIORITY_KEY,
|
||||
self.ORIGIN_KEY,
|
||||
}
|
||||
|
||||
|
||||
def format_trace_id(trace_id: int) -> str:
|
||||
"""Format the trace id for Datadog."""
|
||||
|
Reference in New Issue
Block a user