Skip to content

Commit

Permalink
move textmap propagators to opentelemetry.propagators (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
alrex authored Mar 3, 2021
1 parent 7980997 commit 10a448e
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: 91ae6fc6226ddfbbe9f92da286470cf65aa834a4
CORE_REPO_SHA: 834462941942229e308117220e1fa1fad7cb06e3

jobs:
build:
Expand Down
8 changes: 4 additions & 4 deletions docs/nitpick-exceptions.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[default]
class_references=
; TODO: Understand why sphinx is not able to find this local class
opentelemetry.trace.propagation.textmap.TextMapPropagator
opentelemetry.propagators.textmap.TextMapPropagator
; - AwsXRayFormat
opentelemetry.trace.propagation.textmap.DictGetter
opentelemetry.propagators.textmap.DictGetter
; API
opentelemetry.trace.propagation.textmap.Getter
opentelemetry.propagators.textmap.Getter
; - DatadogFormat
; - AWSXRayFormat
opentelemetry.sdk.trace.id_generator.IdGenerator
Expand All @@ -15,7 +15,7 @@ class_references=

anys=
; API
opentelemetry.trace.propagation.textmap.TextMapPropagator.fields
opentelemetry.propagators.textmap.TextMapPropagator.fields
; - AWSXRayFormat
TraceId
; - AwsXRayIdGenerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from opentelemetry import trace
from opentelemetry.context import Context
from opentelemetry.exporter.datadog import constants
from opentelemetry.trace import get_current_span, set_span_in_context
from opentelemetry.trace.propagation.textmap import (
from opentelemetry.propagators.textmap import (
Getter,
Setter,
TextMapPropagator,
TextMapPropagatorT,
)
from opentelemetry.trace import get_current_span, set_span_in_context


class DatadogFormat(TextMapPropagator):
Expand Down Expand Up @@ -111,7 +111,7 @@ def fields(self):
"""Returns a set with the fields set in `inject`.
See
`opentelemetry.trace.propagation.textmap.TextMapPropagator.fields`
`opentelemetry.propagators.textmap.TextMapPropagator.fields`
"""
return {
self.TRACE_ID_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

from opentelemetry import trace as trace_api
from opentelemetry.exporter.datadog import constants, propagator
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.sdk import trace
from opentelemetry.sdk.trace.id_generator import RandomIdGenerator
from opentelemetry.trace import get_current_span, set_span_in_context
from opentelemetry.trace.propagation.textmap import DictGetter

FORMAT = propagator.DatadogFormat()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from opentelemetry.instrumentation.asgi.version import __version__ # noqa
from opentelemetry.instrumentation.utils import http_status_to_status_code
from opentelemetry.propagate import extract
from opentelemetry.trace.propagation.textmap import DictGetter
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.trace.status import Status, StatusCode


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def add(x, y):
from opentelemetry.instrumentation.celery.version import __version__
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.propagate import extract, inject
from opentelemetry.trace.propagation.textmap import DictGetter
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.trace.status import Status, StatusCode

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from opentelemetry import trace
from opentelemetry.context import attach, detach
from opentelemetry.propagate import extract
from opentelemetry.trace.propagation.textmap import DictGetter
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.trace.status import Status, StatusCode

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get(self):
unwrap,
)
from opentelemetry.propagate import extract
from opentelemetry.trace.propagation.textmap import DictGetter
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.trace.status import Status
from opentelemetry.util.http import get_excluded_urls, get_traced_request_attrs
from opentelemetry.util.time import time_ns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def hello():
from opentelemetry.instrumentation.utils import http_status_to_status_code
from opentelemetry.instrumentation.wsgi.version import __version__
from opentelemetry.propagate import extract
from opentelemetry.trace.propagation.textmap import DictGetter
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.trace.status import Status, StatusCode

_HTTP_VERSION_PREFIX = "HTTP/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

from opentelemetry.baggage import get_all, set_baggage
from opentelemetry.context import Context
from opentelemetry.propagators.textmap import (
Getter,
Setter,
TextMapPropagator,
TextMapPropagatorT,
)
from opentelemetry.trace import (
INVALID_SPAN_ID,
INVALID_TRACE_ID,
Expand All @@ -26,12 +32,6 @@
get_current_span,
set_span_in_context,
)
from opentelemetry.trace.propagation.textmap import (
Getter,
Setter,
TextMapPropagator,
TextMapPropagatorT,
)

OT_TRACE_ID_HEADER = "ot-tracer-traceid"
OT_SPAN_ID_HEADER = "ot-tracer-spanid"
Expand Down Expand Up @@ -153,7 +153,7 @@ def fields(self):
"""Returns a set with the fields set in `inject`.
See
`opentelemetry.trace.propagation.textmap.TextMapPropagator.fields`
`opentelemetry.propagators.textmap.TextMapPropagator.fields`
"""
return {
OT_TRACE_ID_HEADER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
OT_TRACE_ID_HEADER,
OTTracePropagator,
)
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.sdk.trace import _Span
from opentelemetry.trace import (
INVALID_SPAN_CONTEXT,
Expand All @@ -32,7 +33,6 @@
set_span_in_context,
)
from opentelemetry.trace.propagation import get_current_span
from opentelemetry.trace.propagation.textmap import DictGetter

carrier_getter = DictGetter()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

import opentelemetry.trace as trace
from opentelemetry.context import Context
from opentelemetry.trace.propagation.textmap import (
from opentelemetry.propagators.textmap import (
Getter,
Setter,
TextMapPropagator,
Expand Down Expand Up @@ -316,7 +316,7 @@ def fields(self):
"""Returns a set with the fields set in `inject`.
See
`opentelemetry.trace.propagation.textmap.TextMapPropagator.fields`
`opentelemetry.propagators.textmap.TextMapPropagator.fields`
"""

return {TRACE_HEADER_KEY}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

from requests.structures import CaseInsensitiveDict

from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import (
TRACE_HEADER_KEY,
AwsXRayFormat,
)
from opentelemetry.trace.propagation.textmap import DictGetter

XRAY_PROPAGATOR = AwsXRayFormat()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from requests.structures import CaseInsensitiveDict

import opentelemetry.trace as trace_api
from opentelemetry.propagators.textmap import DictGetter
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import (
TRACE_HEADER_KEY,
AwsXRayFormat,
Expand All @@ -31,7 +32,6 @@
TraceState,
set_span_in_context,
)
from opentelemetry.trace.propagation.textmap import DictGetter

TRACE_ID_BASE16 = "8a3c60f7d188f8fa79d48a391a778fa6"

Expand Down

0 comments on commit 10a448e

Please sign in to comment.