Skip to content

Commit

Permalink
Move suppress key to instrumentation package
Browse files Browse the repository at this point in the history
  • Loading branch information
euniceek committed May 31, 2021
1 parent 075bdd0 commit f05b9f5
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
detach,
set_value,
)
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.sdk.trace import Span, SpanProcessor
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY, SpanExporter
from opentelemetry.sdk.trace.export import SpanExporter
from opentelemetry.trace import INVALID_TRACE_ID
from opentelemetry.util._time import _time_ns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def strip_query_params(url: yarl.URL) -> str:
from opentelemetry.instrumentation.aiohttp_client.version import __version__
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
unwrap,
)
from opentelemetry.propagate import inject
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import SpanKind, TracerProvider, get_tracer
from opentelemetry.trace.status import Status, StatusCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from opentelemetry import context
from opentelemetry.instrumentation import aiohttp_client
from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.test_base import TestBase
from opentelemetry.trace import StatusCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
from opentelemetry.instrumentation.botocore.package import _instruments
from opentelemetry.instrumentation.botocore.version import __version__
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.instrumentation.utils import unwrap
from opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
unwrap,
)
from opentelemetry.propagate import inject
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import SpanKind, get_tracer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
from opentelemetry import trace as trace_api
from opentelemetry.context import attach, detach, set_value
from opentelemetry.instrumentation.botocore import BotocoreInstrumentor
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.propagate import get_global_textmap, set_global_textmap
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.mock_textmap import MockTextMapPropagator
from opentelemetry.test.test_base import TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.instrumentation.requests.package import _instruments
from opentelemetry.instrumentation.requests.version import __version__
from opentelemetry.instrumentation.utils import http_status_to_status_code
from opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
)
from opentelemetry.propagate import inject
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import SpanKind, get_tracer
from opentelemetry.trace.status import Status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import opentelemetry.instrumentation.requests
from opentelemetry import context, trace
from opentelemetry.instrumentation.requests import RequestsInstrumentor
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.propagate import get_global_textmap, set_global_textmap
from opentelemetry.sdk import resources
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.mock_textmap import MockTextMapPropagator
from opentelemetry.test.test_base import TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@

from opentelemetry import context
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
<<<<<<< HEAD
from opentelemetry.instrumentation.urllib.package import _instruments
from opentelemetry.instrumentation.urllib.version import __version__
from opentelemetry.instrumentation.utils import http_status_to_status_code
=======
from opentelemetry.instrumentation.urllib.version import ( # pylint: disable=no-name-in-module,import-error
__version__,
)
from opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
)
>>>>>>> b864f5eb (Move suppress key to instrumentation package)
from opentelemetry.propagate import inject
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import SpanKind, get_tracer
from opentelemetry.trace.status import Status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
from opentelemetry.instrumentation.urllib import ( # pylint: disable=no-name-in-module,import-error
URLLibInstrumentor,
)
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.propagate import get_global_textmap, set_global_textmap
from opentelemetry.sdk import resources
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.mock_textmap import MockTextMapPropagator
from opentelemetry.test.test_base import TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ def span_name_callback(method: str, url: str, headers):
from opentelemetry.instrumentation.urllib3.package import _instruments
from opentelemetry.instrumentation.urllib3.version import __version__
from opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
unwrap,
)
from opentelemetry.propagate import inject
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, SpanKind, get_tracer
from opentelemetry.trace.status import Status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
_SUPPRESS_HTTP_INSTRUMENTATION_KEY,
URLLib3Instrumentor,
)
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.propagate import get_global_textmap, set_global_textmap
from opentelemetry.sdk.trace.export import _SUPPRESS_INSTRUMENTATION_KEY
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.test.mock_textmap import MockTextMapPropagator
from opentelemetry.test.test_base import TestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@

from wrapt import ObjectProxy

from opentelemetry.context import create_key
from opentelemetry.trace import StatusCode

_SUPPRESS_INSTRUMENTATION_KEY = create_key("suppress_instrumentation")


def extract_attributes_from_object(
obj: any, attributes: Sequence[str], existing: Dict[str, str] = None
Expand Down

0 comments on commit f05b9f5

Please sign in to comment.