mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-28 04:34:01 +08:00
Add fields method (#226)
Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
- 'release/*'
|
||||
pull_request:
|
||||
env:
|
||||
CORE_REPO_SHA: bce2aa649c9f3541a57b115ceb6694c5a00ca856
|
||||
CORE_REPO_SHA: 5de7ffd7cbb555fb04d0138361a188496557080d
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -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."""
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Add method to return fields injected by propagator
|
||||
([#226](https://github.com/open-telemetry/opentelemetry-python/pull/226))
|
||||
|
||||
## Version 0.16b0
|
||||
|
||||
Released 2020-11-25
|
||||
|
@ -274,3 +274,12 @@ class AwsXRayFormat(TextMapPropagator):
|
||||
set_in_carrier(
|
||||
carrier, TRACE_HEADER_KEY, trace_header,
|
||||
)
|
||||
|
||||
def fields(self):
|
||||
"""Returns a set with the fields set in `inject`.
|
||||
|
||||
See
|
||||
`opentelemetry.trace.propagation.textmap.TextMapPropagator.fields`
|
||||
"""
|
||||
|
||||
return {TRACE_HEADER_KEY}
|
||||
|
Reference in New Issue
Block a user