* Exporter 1.0.0b14 and otel 1.18/0.39

* lint and vendoring fixes
This commit is contained in:
Jeremy Voss 2023-06-21 11:59:24 -07:00 коммит произвёл GitHub
Родитель 4dd3ffc5c4
Коммит 05a8b1dd35
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
73 изменённых файлов: 305 добавлений и 329 удалений

Просмотреть файл

@ -2,6 +2,9 @@
## Unreleased
- Upgrade to exporter 1.0.0b14 and OTel 1.18
([#295](https://github.com/microsoft/ApplicationInsights-Python/pull/295))
## [1.0.0b13](https://github.com/microsoft/ApplicationInsights-Python/releases/tag/v1.0.0b13) - 2023-06-14
- Vendor Instrumentations

Просмотреть файл

@ -15,10 +15,10 @@ from azure.monitor.opentelemetry._constants import (
SAMPLING_RATIO_ARG,
)
from azure.monitor.opentelemetry._types import ConfigurationValue
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.dependencies import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.dependencies import (
get_dependency_conflicts,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry.exporter import (

Просмотреть файл

@ -1,15 +0,0 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"

Просмотреть файл

@ -1,15 +0,0 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"

Просмотреть файл

@ -1,15 +0,0 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"

Просмотреть файл

@ -1,15 +0,0 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"

Просмотреть файл

@ -1,15 +0,0 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"

Просмотреть файл

@ -1,15 +0,0 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"

Просмотреть файл

@ -23,13 +23,13 @@ from typing import Tuple
from asgiref.compatibility import guarantee_single_callable
from opentelemetry import context, trace
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.asgi.version import (
__version__,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.asgi.version import (
__version__
) # noqa
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.propagators import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.propagators import (
get_global_response_propagator,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_start_internal_or_server_span,
http_status_to_status_code,
)
@ -39,7 +39,7 @@ from opentelemetry.semconv.metrics import MetricInstruments
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, set_span_in_context
from opentelemetry.trace.status import Status, StatusCode
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import (
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE,
@ -358,15 +358,16 @@ class OpenTelemetryMiddleware:
span_name, additional_attributes = self.default_span_details(scope)
attributes = collect_request_attributes(scope)
attributes.update(additional_attributes)
span, token = _start_internal_or_server_span(
tracer=self.tracer,
span_name=span_name,
start_time=None,
context_carrier=scope,
context_getter=asgi_getter,
attributes=attributes,
)
attributes = collect_request_attributes(scope)
attributes.update(additional_attributes)
active_requests_count_attrs = _parse_active_request_count_attrs(
attributes
)

Просмотреть файл

@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"
__version__ = "0.39b0"

Просмотреть файл

@ -23,8 +23,8 @@ from shutil import which
from pkg_resources import iter_entry_points
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.version import (
__version__,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.version import (
__version__
)
_logger = getLogger(__name__)

Просмотреть файл

@ -18,22 +18,22 @@ from os.path import abspath, dirname, pathsep
from pkg_resources import iter_entry_points
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.dependencies import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.dependencies import (
get_dist_dependency_conflicts,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.distro import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.distro import (
BaseDistro,
DefaultDistro,
DefaultDistro
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.environment_variables import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.environment_variables import (
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
_python_path_without_directory,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.version import (
__version__,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_python_path_without_directory
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.version import (
__version__
)
logger = getLogger(__name__)

Просмотреть файл

@ -21,12 +21,12 @@ import sys
import pkg_resources
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.bootstrap_gen import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.bootstrap_gen import (
default_instrumentations,
libraries,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.version import (
__version__,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.version import (
__version__
)
logger = logging.getLogger(__name__)

Просмотреть файл

@ -18,158 +18,158 @@
libraries = {
"aio_pika": {
"library": "aio_pika >= 7.2.0, < 10.0.0",
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.38b0",
"instrumentation": "opentelemetry-instrumentation-aio-pika==0.39b0",
},
"aiohttp": {
"library": "aiohttp ~= 3.0",
"instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.38b0",
"instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.39b0",
},
"aiopg": {
"library": "aiopg >= 0.13.0, < 2.0.0",
"instrumentation": "opentelemetry-instrumentation-aiopg==0.38b0",
"instrumentation": "opentelemetry-instrumentation-aiopg==0.39b0",
},
"asgiref": {
"library": "asgiref ~= 3.0",
"instrumentation": "opentelemetry-instrumentation-asgi==0.38b0",
"instrumentation": "opentelemetry-instrumentation-asgi==0.39b0",
},
"asyncpg": {
"library": "asyncpg >= 0.12.0",
"instrumentation": "opentelemetry-instrumentation-asyncpg==0.38b0",
"instrumentation": "opentelemetry-instrumentation-asyncpg==0.39b0",
},
"boto": {
"library": "boto~=2.0",
"instrumentation": "opentelemetry-instrumentation-boto==0.38b0",
"instrumentation": "opentelemetry-instrumentation-boto==0.39b0",
},
"boto3": {
"library": "boto3 ~= 1.0",
"instrumentation": "opentelemetry-instrumentation-boto3sqs==0.38b0",
"instrumentation": "opentelemetry-instrumentation-boto3sqs==0.39b0",
},
"botocore": {
"library": "botocore ~= 1.0",
"instrumentation": "opentelemetry-instrumentation-botocore==0.38b0",
"instrumentation": "opentelemetry-instrumentation-botocore==0.39b0",
},
"celery": {
"library": "celery >= 4.0, < 6.0",
"instrumentation": "opentelemetry-instrumentation-celery==0.38b0",
"instrumentation": "opentelemetry-instrumentation-celery==0.39b0",
},
"confluent-kafka": {
"library": "confluent-kafka >= 1.8.2, < 2.0.0",
"instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.38b0",
"instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.39b0",
},
"django": {
"library": "django >= 1.10",
"instrumentation": "opentelemetry-instrumentation-django==0.38b0",
"instrumentation": "opentelemetry-instrumentation-django==0.39b0",
},
"elasticsearch": {
"library": "elasticsearch >= 2.0",
"instrumentation": "opentelemetry-instrumentation-elasticsearch==0.38b0",
"instrumentation": "opentelemetry-instrumentation-elasticsearch==0.39b0",
},
"falcon": {
"library": "falcon >= 1.4.1, < 4.0.0",
"instrumentation": "opentelemetry-instrumentation-falcon==0.38b0",
"instrumentation": "opentelemetry-instrumentation-falcon==0.39b0",
},
"fastapi": {
"library": "fastapi ~= 0.58",
"instrumentation": "opentelemetry-instrumentation-fastapi==0.38b0",
"instrumentation": "opentelemetry-instrumentation-fastapi==0.39b0",
},
"flask": {
"library": "flask >= 1.0, < 3.0",
"instrumentation": "opentelemetry-instrumentation-flask==0.38b0",
"instrumentation": "opentelemetry-instrumentation-flask==0.39b0",
},
"grpcio": {
"library": "grpcio ~= 1.27",
"instrumentation": "opentelemetry-instrumentation-grpc==0.38b0",
"instrumentation": "opentelemetry-instrumentation-grpc==0.39b0",
},
"httpx": {
"library": "httpx >= 0.18.0, <= 0.23.0",
"instrumentation": "opentelemetry-instrumentation-httpx==0.38b0",
"instrumentation": "opentelemetry-instrumentation-httpx==0.39b0",
},
"jinja2": {
"library": "jinja2 >= 2.7, < 4.0",
"instrumentation": "opentelemetry-instrumentation-jinja2==0.38b0",
"instrumentation": "opentelemetry-instrumentation-jinja2==0.39b0",
},
"kafka-python": {
"library": "kafka-python >= 2.0",
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.38b0",
"instrumentation": "opentelemetry-instrumentation-kafka-python==0.39b0",
},
"mysql-connector-python": {
"library": "mysql-connector-python ~= 8.0",
"instrumentation": "opentelemetry-instrumentation-mysql==0.38b0",
"instrumentation": "opentelemetry-instrumentation-mysql==0.39b0",
},
"pika": {
"library": "pika >= 0.12.0",
"instrumentation": "opentelemetry-instrumentation-pika==0.38b0",
"instrumentation": "opentelemetry-instrumentation-pika==0.39b0",
},
"psycopg2": {
"library": "psycopg2 >= 2.7.3.1",
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.38b0",
"instrumentation": "opentelemetry-instrumentation-psycopg2==0.39b0",
},
"pymemcache": {
"library": "pymemcache >= 1.3.5, < 4",
"instrumentation": "opentelemetry-instrumentation-pymemcache==0.38b0",
"library": "pymemcache >= 1.3.5, < 5",
"instrumentation": "opentelemetry-instrumentation-pymemcache==0.39b0",
},
"pymongo": {
"library": "pymongo >= 3.1, < 5.0",
"instrumentation": "opentelemetry-instrumentation-pymongo==0.38b0",
"instrumentation": "opentelemetry-instrumentation-pymongo==0.39b0",
},
"PyMySQL": {
"library": "PyMySQL < 2",
"instrumentation": "opentelemetry-instrumentation-pymysql==0.38b0",
"instrumentation": "opentelemetry-instrumentation-pymysql==0.39b0",
},
"pyramid": {
"library": "pyramid >= 1.7",
"instrumentation": "opentelemetry-instrumentation-pyramid==0.38b0",
"instrumentation": "opentelemetry-instrumentation-pyramid==0.39b0",
},
"redis": {
"library": "redis >= 2.6",
"instrumentation": "opentelemetry-instrumentation-redis==0.38b0",
"instrumentation": "opentelemetry-instrumentation-redis==0.39b0",
},
"remoulade": {
"library": "remoulade >= 0.50",
"instrumentation": "opentelemetry-instrumentation-remoulade==0.38b0",
"instrumentation": "opentelemetry-instrumentation-remoulade==0.39b0",
},
"requests": {
"library": "requests ~= 2.0",
"instrumentation": "opentelemetry-instrumentation-requests==0.38b0",
"instrumentation": "opentelemetry-instrumentation-requests==0.39b0",
},
"scikit-learn": {
"library": "scikit-learn ~= 0.24.0",
"instrumentation": "opentelemetry-instrumentation-sklearn==0.38b0",
"instrumentation": "opentelemetry-instrumentation-sklearn==0.39b0",
},
"sqlalchemy": {
"library": "sqlalchemy",
"instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.38b0",
"instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.39b0",
},
"starlette": {
"library": "starlette ~= 0.13.0",
"instrumentation": "opentelemetry-instrumentation-starlette==0.38b0",
"instrumentation": "opentelemetry-instrumentation-starlette==0.39b0",
},
"psutil": {
"library": "psutil >= 5",
"instrumentation": "opentelemetry-instrumentation-system-metrics==0.38b0",
"instrumentation": "opentelemetry-instrumentation-system-metrics==0.39b0",
},
"tornado": {
"library": "tornado >= 5.1.1",
"instrumentation": "opentelemetry-instrumentation-tornado==0.38b0",
"instrumentation": "opentelemetry-instrumentation-tornado==0.39b0",
},
"tortoise-orm": {
"library": "tortoise-orm >= 0.17.0",
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.38b0",
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.39b0",
},
"pydantic": {
"library": "pydantic >= 1.10.2",
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.38b0",
"instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.39b0",
},
"urllib3": {
"library": "urllib3 >= 1.0.0, < 2.0.0",
"instrumentation": "opentelemetry-instrumentation-urllib3==0.38b0",
"instrumentation": "opentelemetry-instrumentation-urllib3==0.39b0",
},
}
default_instrumentations = [
"opentelemetry-instrumentation-aws-lambda==0.38b0",
"opentelemetry-instrumentation-dbapi==0.38b0",
"opentelemetry-instrumentation-logging==0.38b0",
"opentelemetry-instrumentation-sqlite3==0.38b0",
"opentelemetry-instrumentation-urllib==0.38b0",
"opentelemetry-instrumentation-wsgi==0.38b0",
"opentelemetry-instrumentation-aws-lambda==0.39b0",
"opentelemetry-instrumentation-dbapi==0.39b0",
"opentelemetry-instrumentation-logging==0.39b0",
"opentelemetry-instrumentation-sqlite3==0.39b0",
"opentelemetry-instrumentation-urllib==0.39b0",
"opentelemetry-instrumentation-wsgi==0.39b0",
]

Просмотреть файл

@ -21,13 +21,13 @@ import typing
import wrapt
from opentelemetry import trace as trace_api
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.dbapi.version import (
__version__,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.dbapi.version import (
__version__
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.sqlcommenter_utils import (
_add_sql_comment,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.sqlcommenter_utils import (
_add_sql_comment
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_get_opentelemetry_values,
unwrap,
)

Просмотреть файл

@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"
__version__ = "0.39b0"
_instruments = tuple()

Просмотреть файл

@ -22,8 +22,8 @@ from logging import getLogger
from pkg_resources import EntryPoint
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor
)
_LOG = getLogger(__name__)
@ -35,6 +35,7 @@ class BaseDistro(ABC):
_instance = None
def __new__(cls, *args, **kwargs):
if cls._instance is None:
cls._instance = object.__new__(cls, *args, **kwargs)

Просмотреть файл

@ -21,28 +21,25 @@ from django import VERSION as django_version
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.django.environment_variables import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.django.environment_variables import (
OTEL_PYTHON_DJANGO_INSTRUMENT,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.django.middleware.otel_middleware import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.django.middleware.otel_middleware import (
_DjangoMiddleware,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.django.package import (
_instruments,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.django.package import (
_instruments
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.django.version import (
__version__,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.django.version import (
__version__
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor
)
from opentelemetry.metrics import get_meter
from opentelemetry.semconv.metrics import MetricInstruments
from opentelemetry.trace import get_tracer
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
get_excluded_urls,
parse_excluded_urls,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import get_excluded_urls, parse_excluded_urls
DJANGO_2_0 = django_version >= (2, 0)
@ -69,7 +66,7 @@ class DjangoInstrumentor(BaseInstrumentor):
[_DjangoMiddleware.__module__, _DjangoMiddleware.__qualname__]
)
_sql_commenter_middleware = "azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.django.middleware.sqlcommenter_middleware.SqlCommenter"
_sql_commenter_middleware = "azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.django.middleware.sqlcommenter_middleware.SqlCommenter"
def instrumentation_dependencies(self) -> Collection[str]:
return _instruments

Просмотреть файл

@ -22,31 +22,31 @@ from django import VERSION as django_version
from django.http import HttpRequest, HttpResponse
from opentelemetry.context import detach
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.propagators import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.propagators import (
get_global_response_propagator,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_start_internal_or_server_span,
extract_attributes_from_object,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.wsgi import (
add_response_attributes,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.wsgi import (
add_response_attributes
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.wsgi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.wsgi import (
collect_custom_request_headers_attributes as wsgi_collect_custom_request_headers_attributes,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.wsgi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.wsgi import (
collect_custom_response_headers_attributes as wsgi_collect_custom_response_headers_attributes,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.wsgi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.wsgi import (
collect_request_attributes as wsgi_collect_request_attributes,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.wsgi import (
wsgi_getter,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.wsgi import (
wsgi_getter
)
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, SpanKind, use_span
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import (
_parse_active_request_count_attrs,
_parse_duration_attrs,
get_excluded_urls,
@ -93,21 +93,21 @@ else:
# try/except block exclusive for optional ASGI imports.
try:
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.asgi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.asgi import (
asgi_getter,
asgi_setter,
asgi_setter
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.asgi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.asgi import (
collect_custom_request_headers_attributes as asgi_collect_custom_request_attributes,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.asgi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.asgi import (
collect_custom_response_headers_attributes as asgi_collect_custom_response_attributes,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.asgi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.asgi import (
collect_request_attributes as asgi_collect_request_attributes,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.asgi import (
set_status_code,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.asgi import (
set_status_code
)
_is_asgi_supported = True
@ -221,6 +221,7 @@ class _DjangoMiddleware(MiddlewareMixin):
carrier_getter = wsgi_getter
collect_request_attributes = wsgi_collect_request_attributes
attributes = collect_request_attributes(carrier)
span, token = _start_internal_or_server_span(
tracer=self._tracer,
span_name=self._get_span_name(request),
@ -229,9 +230,9 @@ class _DjangoMiddleware(MiddlewareMixin):
),
context_carrier=carrier,
context_getter=carrier_getter,
attributes=attributes,
)
attributes = collect_request_attributes(carrier)
active_requests_count_attrs = _parse_active_request_count_attrs(
attributes
)

Просмотреть файл

@ -22,11 +22,11 @@ from django import conf, get_version
from django.db import connections
from django.db.backends.utils import CursorDebugWrapper
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.sqlcommenter_utils import (
_add_sql_comment,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.sqlcommenter_utils import (
_add_sql_comment
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
_get_opentelemetry_values,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_get_opentelemetry_values
)
from opentelemetry.trace.propagation.tracecontext import (
TraceContextTextMapPropagator,

Просмотреть файл

@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"
__version__ = "0.39b0"

Просмотреть файл

@ -20,25 +20,14 @@ from typing import Collection
import fastapi
from starlette.routing import Match
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.asgi import (
OpenTelemetryMiddleware,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.fastapi.package import (
_instruments,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.fastapi.version import (
__version__,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.fastapi.package import _instruments
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.fastapi.version import __version__
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from opentelemetry.metrics import get_meter
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
get_excluded_urls,
parse_excluded_urls,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import get_excluded_urls, parse_excluded_urls
_excluded_urls_from_env = get_excluded_urls("FASTAPI")
_logger = logging.getLogger(__name__)

Просмотреть файл

@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"
__version__ = "0.39b0"

Просмотреть файл

@ -24,30 +24,19 @@ from typing import Collection
import flask
import azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.wsgi as otel_wsgi
import azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.wsgi as otel_wsgi
from opentelemetry import context, trace
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.flask.package import (
_instruments,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.flask.version import (
__version__,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.propagators import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.flask.package import _instruments
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.flask.version import __version__
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.propagators import (
get_global_response_propagator,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
_start_internal_or_server_span,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import _start_internal_or_server_span
from opentelemetry.metrics import get_meter
from opentelemetry.semconv.metrics import MetricInstruments
from opentelemetry.semconv.trace import SpanAttributes
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
get_excluded_urls,
parse_excluded_urls,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import get_excluded_urls, parse_excluded_urls
_logger = getLogger(__name__)

Просмотреть файл

@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"
__version__ = "0.39b0"

Просмотреть файл

@ -21,7 +21,7 @@ from abc import ABC, abstractmethod
from logging import getLogger
from typing import Collection, Optional
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.dependencies import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.dependencies import (
DependencyConflict,
get_dependency_conflicts,
)

Просмотреть файл

@ -23,18 +23,10 @@ from psycopg2.extensions import (
)
from psycopg2.sql import Composed # pylint: disable=no-name-in-module
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation import (
dbapi,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.psycopg2.package import (
_instruments,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.psycopg2.version import (
__version__,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation import dbapi
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.psycopg2.package import _instruments
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.psycopg2.version import __version__
_logger = logging.getLogger(__name__)
_OTEL_CURSOR_FACTORY_KEY = "_otel_orig_cursor_factory"

Просмотреть файл

@ -0,0 +1,15 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.39b0"

Просмотреть файл

@ -16,7 +16,7 @@
import functools
import types
from timeit import default_timer
from typing import Callable, Collection, Iterable, Optional
from typing import Callable, Collection, Optional
from urllib.parse import urlparse
from requests.models import PreparedRequest, Response
@ -27,16 +27,10 @@ from opentelemetry import context
# FIXME: fix the importing of this private attribute when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY is defined.
from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.requests.package import (
_instruments,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.requests.version import (
__version__,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.requests.package import _instruments
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.requests.version import __version__
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
)
@ -47,14 +41,13 @@ from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import SpanKind, Tracer, get_tracer
from opentelemetry.trace.span import Span
from opentelemetry.trace.status import Status
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import (
ExcludeList,
get_excluded_urls,
parse_excluded_urls,
remove_url_credentials,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http.httplib import (
set_ip_on_next_http_connection,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http.httplib import set_ip_on_next_http_connection
_excluded_urls_from_env = get_excluded_urls("REQUESTS")
@ -69,7 +62,7 @@ def _instrument(
duration_histogram: Histogram,
request_hook: _RequestHookT = None,
response_hook: _ResponseHookT = None,
excluded_urls: Iterable[str] = None,
excluded_urls: ExcludeList = None,
):
"""Enables tracing of all requests calls that go through
:code:`requests.session.Session.request` (this includes

Просмотреть файл

@ -0,0 +1,15 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.39b0"

Просмотреть файл

@ -13,9 +13,7 @@
# limitations under the License.
from opentelemetry import context
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
_url_quote,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import _url_quote
def _add_sql_comment(sql, **meta) -> str:

Просмотреть файл

@ -28,16 +28,10 @@ from opentelemetry import context
# FIXME: fix the importing of this private attribute when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY is defined.
from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib.package import (
_instruments,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib.version import (
__version__,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib.package import _instruments
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib.version import __version__
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
)
@ -47,10 +41,15 @@ from opentelemetry.semconv.metrics import MetricInstruments
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, SpanKind, get_tracer
from opentelemetry.trace.status import Status
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import (
ExcludeList,
get_excluded_urls,
parse_excluded_urls,
remove_url_credentials,
)
_excluded_urls_from_env = get_excluded_urls("URLLIB")
_RequestHookT = typing.Optional[typing.Callable[[Span, Request], None]]
_ResponseHookT = typing.Optional[
typing.Callable[[Span, Request, client.HTTPResponse], None]
@ -73,10 +72,12 @@ class URLLibInstrumentor(BaseInstrumentor):
``tracer_provider``: a TracerProvider, defaults to global
``request_hook``: An optional callback invoked that is invoked right after a span is created.
``response_hook``: An optional callback which is invoked right before the span is finished processing a response
``excluded_urls``: A string containing a comma-delimited
list of regexes used to exclude URLs from tracking
"""
tracer_provider = kwargs.get("tracer_provider")
tracer = get_tracer(__name__, __version__, tracer_provider)
excluded_urls = kwargs.get("excluded_urls")
meter_provider = kwargs.get("meter_provider")
meter = get_meter(__name__, __version__, meter_provider)
@ -87,6 +88,9 @@ class URLLibInstrumentor(BaseInstrumentor):
histograms,
request_hook=kwargs.get("request_hook"),
response_hook=kwargs.get("response_hook"),
excluded_urls=_excluded_urls_from_env
if excluded_urls is None
else parse_excluded_urls(excluded_urls),
)
def _uninstrument(self, **kwargs):
@ -104,6 +108,7 @@ def _instrument(
histograms: Dict[str, Histogram],
request_hook: _RequestHookT = None,
response_hook: _ResponseHookT = None,
excluded_urls: ExcludeList = None,
):
"""Enables tracing of all requests calls that go through
:code:`urllib.Client._make_request`"""
@ -135,8 +140,11 @@ def _instrument(
) or context.get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY):
return call_wrapped()
method = request.get_method().upper()
url = request.full_url
if excluded_urls and excluded_urls.url_disabled(url):
return call_wrapped()
method = request.get_method().upper()
span_name = f"HTTP {method}".strip()

Просмотреть файл

@ -12,6 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.38b0"
__version__ = "0.39b0"
_instruments = tuple()

Просмотреть файл

@ -27,16 +27,10 @@ from opentelemetry import context
# FIXME: fix the importing of this private attribute when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY is defined.
from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib3.package import (
_instruments,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib3.version import (
__version__,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib3.package import _instruments
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib3.version import __version__
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_SUPPRESS_INSTRUMENTATION_KEY,
http_status_to_status_code,
unwrap,
@ -47,9 +41,14 @@ from opentelemetry.semconv.metrics import MetricInstruments
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import Span, SpanKind, Tracer, get_tracer
from opentelemetry.trace.status import Status
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http.httplib import (
set_ip_on_next_http_connection,
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import (
ExcludeList,
get_excluded_urls,
parse_excluded_urls,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http.httplib import set_ip_on_next_http_connection
_excluded_urls_from_env = get_excluded_urls("URLLIB3")
_UrlFilterT = typing.Optional[typing.Callable[[str], str]]
_RequestHookT = typing.Optional[
@ -95,10 +94,14 @@ class URLLib3Instrumentor(BaseInstrumentor):
``response_hook``: An optional callback which is invoked right before the span is finished processing a response.
``url_filter``: A callback to process the requested URL prior
to adding it as a span attribute.
``excluded_urls``: A string containing a comma-delimited
list of regexes used to exclude URLs from tracking
"""
tracer_provider = kwargs.get("tracer_provider")
tracer = get_tracer(__name__, __version__, tracer_provider)
excluded_urls = kwargs.get("excluded_urls")
meter_provider = kwargs.get("meter_provider")
meter = get_meter(__name__, __version__, meter_provider)
@ -126,6 +129,9 @@ class URLLib3Instrumentor(BaseInstrumentor):
request_hook=kwargs.get("request_hook"),
response_hook=kwargs.get("response_hook"),
url_filter=kwargs.get("url_filter"),
excluded_urls=_excluded_urls_from_env
if excluded_urls is None
else parse_excluded_urls(excluded_urls),
)
def _uninstrument(self, **kwargs):
@ -140,13 +146,17 @@ def _instrument(
request_hook: _RequestHookT = None,
response_hook: _ResponseHookT = None,
url_filter: _UrlFilterT = None,
excluded_urls: ExcludeList = None,
):
def instrumented_urlopen(wrapped, instance, args, kwargs):
if _is_instrumentation_suppressed():
return wrapped(*args, **kwargs)
method = _get_url_open_arg("method", args, kwargs).upper()
url = _get_url(instance, args, kwargs, url_filter)
if excluded_urls and excluded_urls.url_disabled(url):
return wrapped(*args, **kwargs)
method = _get_url_open_arg("method", args, kwargs).upper()
headers = _prepare_headers(kwargs)
body = _get_url_open_arg("body", args, kwargs)

Просмотреть файл

@ -0,0 +1,15 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.39b0"

Просмотреть файл

@ -0,0 +1,15 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.39b0"

Просмотреть файл

@ -19,19 +19,17 @@ import wsgiref.util as wsgiref_util
from timeit import default_timer
from opentelemetry import context, trace
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import (
_start_internal_or_server_span,
http_status_to_status_code,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.wsgi.version import (
__version__,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.wsgi.version import __version__
from opentelemetry.metrics import get_meter
from opentelemetry.propagators.textmap import Getter
from opentelemetry.semconv.metrics import MetricInstruments
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace.status import Status, StatusCode
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.util.http import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.util.http import (
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST,
OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE,
@ -395,7 +393,7 @@ def _end_span_after_iterating(iterable, span, token):
context.detach(token)
# TODO: inherit from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.propagators.Setter
# TODO: inherit from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.propagators.Setter
class ResponsePropagationSetter:

Просмотреть файл

@ -0,0 +1,15 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.39b0"

Просмотреть файл

@ -27,12 +27,8 @@ from typing import Collection
import wrapt
from opentelemetry import context
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.instrumentor import (
BaseInstrumentor,
)
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.utils import (
unwrap,
)
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.instrumentor import BaseInstrumentor
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.utils import unwrap
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace.span import Span

Просмотреть файл

@ -0,0 +1,15 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "0.39b0"

Просмотреть файл

@ -6,7 +6,7 @@
import logging
from os import environ
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.distro import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.distro import (
BaseDistro,
)
from azure.monitor.opentelemetry.diagnostics._diagnostic_logging import (

Просмотреть файл

@ -17,7 +17,7 @@ from azure.monitor.opentelemetry._constants import (
SAMPLING_RATIO_ARG,
)
from azure.monitor.opentelemetry._types import ConfigurationValue
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.environment_variables import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.environment_variables import (
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS,
)
from opentelemetry.environment_variables import (

Просмотреть файл

@ -84,9 +84,9 @@ setup(
},
python_requires=">=3.7",
install_requires=[
"azure-monitor-opentelemetry-exporter>=1.0.0b13",
"opentelemetry-api==1.17.0",
"opentelemetry-sdk==1.17.0",
"azure-monitor-opentelemetry-exporter>=1.0.0b14",
"opentelemetry-api==1.18.0",
"opentelemetry-sdk==1.18.0",
"wrapt >= 1.0.0, < 2.0.0",
],
entry_points={
@ -97,13 +97,13 @@ setup(
"azure_monitor_opentelemetry_configurator = azure.monitor.opentelemetry.autoinstrumentation._configurator:AzureMonitorConfigurator"
],
"azure_monitor_opentelemetry_instrumentor": [
"django = azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.django:DjangoInstrumentor",
"fastapi = azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.fastapi:FastAPIInstrumentor",
"flask = azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.flask:FlaskInstrumentor",
"psycopg2 = azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.psycopg2:Psycopg2Instrumentor",
"requests = azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.requests:RequestsInstrumentor",
"urllib = azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib:URLLibInstrumentor",
"urllib3 = azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib3:URLLib3Instrumentor",
"django = azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.django:DjangoInstrumentor",
"fastapi = azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.fastapi:FastAPIInstrumentor",
"flask = azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.flask:FlaskInstrumentor",
"psycopg2 = azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.psycopg2:Psycopg2Instrumentor",
"requests = azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.requests:RequestsInstrumentor",
"urllib = azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib:URLLibInstrumentor",
"urllib3 = azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib3:URLLib3Instrumentor",
],
},
)

Просмотреть файл

@ -15,7 +15,7 @@
from unittest import TestCase
from unittest.mock import patch
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.environment_variables import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.environment_variables import (
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS,
)
from azure.monitor.opentelemetry.util.configurations import (

Просмотреть файл

@ -6,7 +6,7 @@
import unittest
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.django import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.django import (
DjangoInstrumentor,
)

Просмотреть файл

@ -6,7 +6,7 @@
import unittest
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.fastapi import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.fastapi import (
FastAPIInstrumentor,
)

Просмотреть файл

@ -6,7 +6,7 @@
import unittest
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.flask import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.flask import (
FlaskInstrumentor,
)

Просмотреть файл

@ -6,7 +6,7 @@
import unittest
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.psycopg2 import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.psycopg2 import (
Psycopg2Instrumentor,
)

Просмотреть файл

@ -6,7 +6,7 @@
import unittest
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.requests import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.requests import (
RequestsInstrumentor,
)

Просмотреть файл

@ -6,7 +6,7 @@
import unittest
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib import (
URLLibInstrumentor,
)

Просмотреть файл

@ -6,7 +6,7 @@
import unittest
from azure.monitor.opentelemetry._vendor.v0_38b0.opentelemetry.instrumentation.urllib3 import (
from azure.monitor.opentelemetry._vendor.v0_39b0.opentelemetry.instrumentation.urllib3 import (
URLLib3Instrumentor,
)