From 890e5dd9b8a4ec263f183fe9d0362ffb907847a4 Mon Sep 17 00:00:00 2001 From: Nahian-Al Hasan Date: Thu, 4 May 2023 02:36:25 +1000 Subject: [PATCH 001/200] Add otelTraceSampled to instrumetation-logging (#1773) * Add otelTraceSampled to instrumetation-logging * Updated code with black * Added to CHANGELOG.md --------- Co-authored-by: Srikanth Chekuri --- CHANGELOG.md | 4 +++- .../instrumentation/logging/__init__.py | 2 ++ .../instrumentation/logging/constants.py | 5 +++-- .../tests/test_logging.py | 20 +++++++++++++++---- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73fc2b9aa1..ead8d5c134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Make ASGI request span attributes available for `start_span`. ([#1762](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1762)) - `opentelemetry-instrumentation-celery` Add support for anonymous tasks. - ([#1407](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1407) + ([#1407](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1407)) +- `opentelemetry-instrumentation-logging` Add `otelTraceSampled` to instrumetation-logging + ([#1773](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1773)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py index d419aaa2f9..ce332d0113 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/__init__.py @@ -94,6 +94,7 @@ def record_factory(*args, **kwargs): record.otelSpanID = "0" record.otelTraceID = "0" + record.otelTraceSampled = False nonlocal service_name if service_name is None: @@ -113,6 +114,7 @@ def record_factory(*args, **kwargs): if ctx != INVALID_SPAN_CONTEXT: record.otelSpanID = format(ctx.span_id, "016x") record.otelTraceID = format(ctx.trace_id, "032x") + record.otelTraceSampled = ctx.trace_flags.sampled if callable(LoggingInstrumentor._log_hook): try: LoggingInstrumentor._log_hook( # pylint: disable=E1102 diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/constants.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/constants.py index ff50d46086..b18f93364f 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/constants.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/constants.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -DEFAULT_LOGGING_FORMAT = "%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s] - %(message)s" +DEFAULT_LOGGING_FORMAT = "%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s trace_sampled=%(otelTraceSampled)s] - %(message)s" _MODULE_DOC = """ @@ -27,6 +27,7 @@ - ``otelSpanID`` - ``otelTraceID`` - ``otelServiceName`` +- ``otelTraceSampled`` The integration uses the following logging format by default: @@ -113,7 +114,7 @@ .. code-block:: - %(otelSpanID)s %(otelTraceID)s %(otelServiceName)s + %(otelSpanID)s %(otelTraceID)s %(otelServiceName)s %(otelTraceSampled)s diff --git a/instrumentation/opentelemetry-instrumentation-logging/tests/test_logging.py b/instrumentation/opentelemetry-instrumentation-logging/tests/test_logging.py index bddee9bf84..a5a0d5adff 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/tests/test_logging.py +++ b/instrumentation/opentelemetry-instrumentation-logging/tests/test_logging.py @@ -62,6 +62,7 @@ def test_trace_context_injection(self): self.assertEqual(record.otelSpanID, "0") self.assertEqual(record.otelTraceID, "0") self.assertEqual(record.otelServiceName, "") + self.assertEqual(record.otelTraceSampled, False) def log_hook(span, record): @@ -82,7 +83,7 @@ def tearDown(self): super().tearDown() LoggingInstrumentor().uninstrument() - def assert_trace_context_injected(self, span_id, trace_id): + def assert_trace_context_injected(self, span_id, trace_id, trace_sampled): with self.caplog.at_level(level=logging.INFO): logger = logging.getLogger("test logger") logger.info("hello") @@ -90,16 +91,20 @@ def assert_trace_context_injected(self, span_id, trace_id): record = self.caplog.records[0] self.assertEqual(record.otelSpanID, span_id) self.assertEqual(record.otelTraceID, trace_id) + self.assertEqual(record.otelTraceSampled, trace_sampled) self.assertEqual(record.otelServiceName, "unknown_service") def test_trace_context_injection(self): with self.tracer.start_as_current_span("s1") as span: span_id = format(span.get_span_context().span_id, "016x") trace_id = format(span.get_span_context().trace_id, "032x") - self.assert_trace_context_injected(span_id, trace_id) + trace_sampled = span.get_span_context().trace_flags.sampled + self.assert_trace_context_injected( + span_id, trace_id, trace_sampled + ) def test_trace_context_injection_without_span(self): - self.assert_trace_context_injected("0", "0") + self.assert_trace_context_injected("0", "0", False) @mock.patch("logging.basicConfig") def test_basic_config_called(self, basic_config_mock): @@ -163,6 +168,7 @@ def test_log_hook(self): with self.tracer.start_as_current_span("s1") as span: span_id = format(span.get_span_context().span_id, "016x") trace_id = format(span.get_span_context().trace_id, "032x") + trace_sampled = span.get_span_context().trace_flags.sampled with self.caplog.at_level(level=logging.INFO): logger = logging.getLogger("test logger") logger.info("hello") @@ -171,6 +177,7 @@ def test_log_hook(self): self.assertEqual(record.otelSpanID, span_id) self.assertEqual(record.otelTraceID, trace_id) self.assertEqual(record.otelServiceName, "unknown_service") + self.assertEqual(record.otelTraceSampled, trace_sampled) self.assertEqual( record.custom_user_attribute_from_log_hook, "some-value" ) @@ -179,7 +186,10 @@ def test_uninstrumented(self): with self.tracer.start_as_current_span("s1") as span: span_id = format(span.get_span_context().span_id, "016x") trace_id = format(span.get_span_context().trace_id, "032x") - self.assert_trace_context_injected(span_id, trace_id) + trace_sampled = span.get_span_context().trace_flags.sampled + self.assert_trace_context_injected( + span_id, trace_id, trace_sampled + ) LoggingInstrumentor().uninstrument() @@ -187,6 +197,7 @@ def test_uninstrumented(self): with self.tracer.start_as_current_span("s1") as span: span_id = format(span.get_span_context().span_id, "016x") trace_id = format(span.get_span_context().trace_id, "032x") + trace_sampled = span.get_span_context().trace_flags.sampled with self.caplog.at_level(level=logging.INFO): logger = logging.getLogger("test logger") logger.info("hello") @@ -195,3 +206,4 @@ def test_uninstrumented(self): self.assertFalse(hasattr(record, "otelSpanID")) self.assertFalse(hasattr(record, "otelTraceID")) self.assertFalse(hasattr(record, "otelServiceName")) + self.assertFalse(hasattr(record, "otelTraceSampled")) From 1a1163e919f1e573009b1ba5bb43a7365a80f58f Mon Sep 17 00:00:00 2001 From: Shalev Roda <65566801+shalevr@users.noreply.github.com> Date: Sat, 6 May 2023 20:39:52 +0300 Subject: [PATCH 002/200] Expand sqlalchemy pool.name to follow the semantic conventions (#1778) --- CHANGELOG.md | 2 + .../instrumentation/sqlalchemy/engine.py | 11 +++++- .../tests/test_sqlalchemy_metrics.py | 3 +- .../tests/sqlalchemy_tests/test_postgres.py | 37 +++++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ead8d5c134..15e7f953c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Expand sqlalchemy pool.name to follow the semantic conventions + ([#1778](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1778)) - Add `excluded_urls` functionality to `urllib` and `urllib3` instrumentations ([#1733](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1733)) - Make Django request span attributes available for `start_span`. diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py index ca691fc052..9ff6057728 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py @@ -118,8 +118,17 @@ def __init__( self._register_event_listener(engine, "checkin", self._pool_checkin) self._register_event_listener(engine, "checkout", self._pool_checkout) + def _get_connection_string(self): + drivername = self.engine.url.drivername or "" + host = self.engine.url.host or "" + port = self.engine.url.port or "" + database = self.engine.url.database or "" + return f"{drivername}://{host}:{port}/{database}" + def _get_pool_name(self): - return self.engine.pool.logging_name or "" + if self.engine.pool.logging_name is not None: + return self.engine.pool.logging_name + return self._get_connection_string() def _add_idle_to_connection_usage(self, value): self.connections_usage.add( diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py index 39e45945f7..2d753c3c42 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py @@ -70,11 +70,12 @@ def test_metrics_one_connection(self): ) def test_metrics_without_pool_name(self): - pool_name = "" + pool_name = "pool_test_name" engine = sqlalchemy.create_engine( "sqlite:///:memory:", pool_size=5, poolclass=QueuePool, + pool_logging_name=pool_name, ) metrics = self.get_sorted_metrics() diff --git a/tests/opentelemetry-docker-tests/tests/sqlalchemy_tests/test_postgres.py b/tests/opentelemetry-docker-tests/tests/sqlalchemy_tests/test_postgres.py index bbc62bfbbf..ff664091c8 100644 --- a/tests/opentelemetry-docker-tests/tests/sqlalchemy_tests/test_postgres.py +++ b/tests/opentelemetry-docker-tests/tests/sqlalchemy_tests/test_postgres.py @@ -95,3 +95,40 @@ class PostgresCreatorTestCase(PostgresTestCase): "url": "postgresql://", "creator": lambda: psycopg2.connect(**POSTGRES_CONFIG), } + + +class PostgresMetricsTestCase(PostgresTestCase): + __test__ = True + + VENDOR = "postgresql" + SQL_DB = "opentelemetry-tests" + ENGINE_ARGS = { + "url": "postgresql://%(user)s:%(password)s@%(host)s:%(port)s/%(dbname)s" + % POSTGRES_CONFIG + } + + def test_metrics_pool_name(self): + with self.connection() as conn: + conn.execute("SELECT 1 + 1").fetchall() + + pool_name = "{}://{}:{}/{}".format( + self.VENDOR, + POSTGRES_CONFIG["host"], + POSTGRES_CONFIG["port"], + self.SQL_DB, + ) + metrics = self.get_sorted_metrics() + self.assertEqual(len(metrics), 1) + self.assert_metric_expected( + metrics[0], + [ + self.create_number_data_point( + value=0, + attributes={"pool.name": pool_name, "state": "idle"}, + ), + self.create_number_data_point( + value=0, + attributes={"pool.name": pool_name, "state": "used"}, + ), + ], + ) From db46e8eaabb76fc45b0b72c6490cbba3b21d3fba Mon Sep 17 00:00:00 2001 From: Shalev Roda <65566801+shalevr@users.noreply.github.com> Date: Tue, 16 May 2023 21:08:15 +0300 Subject: [PATCH 003/200] Skip requests tests for pypy3 (#1806) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1603dfb745..94e385e5ea 100644 --- a/tox.ini +++ b/tox.ini @@ -93,7 +93,7 @@ envlist = ; opentelemetry-instrumentation-requests py3{7,8,9,10,11}-test-instrumentation-requests - pypy3-test-instrumentation-requests + ;pypy3-test-instrumentation-requests ; opentelemetry-instrumentation-starlette. py3{7,8,9,10,11}-test-instrumentation-starlette From afd842899700af49fe2825e4afd8fa615f5cf8d5 Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Wed, 17 May 2023 09:47:58 -0700 Subject: [PATCH 004/200] Update version to 1.19.0.dev/0.40b0.dev (#1797) Co-authored-by: Diego Hurtado Co-authored-by: Srikanth Chekuri --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + _template/version.py | 2 +- eachdist.ini | 4 +- .../prometheus_remote_write/version.py | 2 +- .../pyproject.toml | 2 +- .../exporter/richconsole/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/aio_pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_client/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/aiopg/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/asgi/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncpg/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aws_lambda/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto3sqs/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/botocore/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/celery/version.py | 2 +- .../confluent_kafka/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/dbapi/version.py | 2 +- .../pyproject.toml | 12 +-- .../instrumentation/django/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/elasticsearch/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/falcon/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/fastapi/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/flask/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/grpc/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/httpx/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/jinja2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/kafka/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/logging/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysql/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/psycopg2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymemcache/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymongo/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymysql/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/pyramid/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/redis/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/remoulade/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/requests/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sklearn/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlalchemy/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/sqlite3/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/starlette/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/system_metrics/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/tornado/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/tortoiseorm/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib3/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/wsgi/version.py | 2 +- .../pyproject.toml | 84 +++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 86 +++++++++---------- .../opentelemetry/instrumentation/version.py | 2 +- .../propagators/ot_trace/version.py | 2 +- .../src/opentelemetry/util/http/version.py | 2 +- 98 files changed, 276 insertions(+), 274 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8ecec6532..62b04f57e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 2387b4465d930b020df79692a8097e1d54b66ec1 + CORE_REPO_SHA: e9530c5c548d08a6aaa56268d103f9beb00cd002 jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e7f953c2..885bf2bec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## Version 1.18.0/0.39b0 (2023-05-10) + - `opentelemetry-instrumentation-system-metrics` Add `process.` prefix to `runtime.memory`, `runtime.cpu.time`, and `runtime.gc_count`. Change `runtime.memory` from count to UpDownCounter. ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735)) - Add request and response hooks for GRPC instrumentation (client only) ([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706)) diff --git a/_template/version.py b/_template/version.py index eb62a67e28..87b20fddc3 100644 --- a/_template/version.py +++ b/_template/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/eachdist.ini b/eachdist.ini index eb34aed0f0..2868d10c8d 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.18.0.dev +version=1.19.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.39b0.dev +version=0.40b0.dev packages= all diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py index eb62a67e28..87b20fddc3 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index d6bbc580d8..2800ebe61b 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "rich>=10.0.0", ] diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py index eb62a67e28..87b20fddc3 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index 53e1f1606e..4a4f2cb74f 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aio-pika[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index 0a8b8a937d..acdc1a2a4d 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py index 88ab55ca31..36eda362dd 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 2867ed8338..447b5a1124 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-dbapi == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-dbapi == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,8 +37,8 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index f18ee611d8..ae73178bf9 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -27,9 +27,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asgi[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 672623ccaf..4125c4e6dc 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asyncpg[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index bb90c52934..b6b49a1db2 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -22,15 +22,15 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 83c23f01cf..c1ac4fcf02 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ test = [ "opentelemetry-instrumentation-boto[instruments]", "markupsafe==2.0.1", "moto~=2.0", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 386602644f..b08515b259 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-boto3sqs[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 6368bef442..6125bcfa60 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ test = [ "opentelemetry-instrumentation-botocore[instruments]", "markupsafe==2.0.1", "moto[all] ~= 2.2.6", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index 816e6002c8..c356932264 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-celery[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "pytest", ] diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index e87b80a728..9dae88f113 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py index 16c754f1d3..1b790cecca 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 5f900599ca..0254f38997 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -26,22 +26,22 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-wsgi == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-wsgi == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.39b0.dev", + "opentelemetry-instrumentation-asgi == 0.40b0.dev", ] instruments = [ "django >= 1.10", ] test = [ "opentelemetry-instrumentation-django[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index 739524f7be..2364d652d4 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-elasticsearch[instruments]", "elasticsearch-dsl >= 2.0", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 60c495bd15..bb0b67fd08 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-wsgi == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-wsgi == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", "packaging >= 20.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-falcon[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "parameterized == 0.7.4", ] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index b837f82891..05585f16f9 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-asgi == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-asgi == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-fastapi[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 9dd61a7ef7..2e6b9d9646 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-wsgi == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-wsgi == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-flask[instruments]", "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 7351d49340..0f1651a969 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-grpc[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "protobuf ~= 3.13", ] diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index fbbc9ba718..229fca1611 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-httpx[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index b6f6f2cdee..bddacca237 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-jinja2[instruments]", "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index 1d83e30c57..2f8ad554e7 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-kafka-python[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 26d8867652..aa058ac427 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,13 +25,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py index 16c754f1d3..1b790cecca 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index 7d2b050d78..f7a3aa8ab3 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-dbapi == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-dbapi == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysql[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index f53b18a083..b9fe8f3979 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pika[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index 702f7b3c84..f7a82e4979 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-dbapi == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-dbapi == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-psycopg2[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index 55a2ef077d..675a7abe4b 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymemcache[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index dbb7f64a46..f2cda30eaa 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymongo[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 83bf9052cf..5afdd43998 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-dbapi == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-dbapi == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymysql[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 4148e45a7e..06da79f410 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-wsgi == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-wsgi == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pyramid[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "werkzeug == 0.16.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index ed0ebaf149..d3b6b6cc61 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "wrapt >= 1.12.1", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-redis[instruments]", "opentelemetry-sdk ~= 1.3", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index 72c127733a..e4c1abcc16 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-remoulade[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "opentelemetry-sdk ~= 1.10" ] diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index 7990017918..6e82cb96a3 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-requests[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index c5d16f1239..81ae3a5a5b 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-sklearn[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index 88ab55ca31..36eda362dd 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index beeba209e9..5c4b142637 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", "packaging >= 21.0", "wrapt >= 1.11.2", ] diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index dd3a33c72d..9b6f627a17 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -26,14 +26,14 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-dbapi == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-dbapi == 0.40b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py index 16c754f1d3..1b790cecca 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index fb24345dbb..47398bfbff 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-instrumentation-asgi == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-asgi == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-starlette[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 0a01e8bd27..606d626526 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-system-metrics[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index b01e594cd1..a16554af74 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tornado[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 8f8ffb5995..f6670ce0c7 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tortoiseorm[instruments]", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index 1c85bf13d1..bdeb974b60 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -26,16 +26,16 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] instruments = [] test = [ "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py index 16c754f1d3..1b790cecca 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index 4757ed7fde..be52c117f1 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-urllib3[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index aa0c25c140..2cf81bb4d8 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", - "opentelemetry-semantic-conventions == 0.39b0.dev", - "opentelemetry-util-http == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-util-http == 0.40b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.39b0.dev", + "opentelemetry-test-utils == 0.40b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py index eb62a67e28..87b20fddc3 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index d05a7712ad..5a1aeb84a9 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -29,48 +29,48 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.39b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.39b0.dev", - "opentelemetry-instrumentation-aiopg==0.39b0.dev", - "opentelemetry-instrumentation-asgi==0.39b0.dev", - "opentelemetry-instrumentation-asyncpg==0.39b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.39b0.dev", - "opentelemetry-instrumentation-boto==0.39b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.39b0.dev", - "opentelemetry-instrumentation-botocore==0.39b0.dev", - "opentelemetry-instrumentation-celery==0.39b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.39b0.dev", - "opentelemetry-instrumentation-dbapi==0.39b0.dev", - "opentelemetry-instrumentation-django==0.39b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.39b0.dev", - "opentelemetry-instrumentation-falcon==0.39b0.dev", - "opentelemetry-instrumentation-fastapi==0.39b0.dev", - "opentelemetry-instrumentation-flask==0.39b0.dev", - "opentelemetry-instrumentation-grpc==0.39b0.dev", - "opentelemetry-instrumentation-httpx==0.39b0.dev", - "opentelemetry-instrumentation-jinja2==0.39b0.dev", - "opentelemetry-instrumentation-kafka-python==0.39b0.dev", - "opentelemetry-instrumentation-logging==0.39b0.dev", - "opentelemetry-instrumentation-mysql==0.39b0.dev", - "opentelemetry-instrumentation-pika==0.39b0.dev", - "opentelemetry-instrumentation-psycopg2==0.39b0.dev", - "opentelemetry-instrumentation-pymemcache==0.39b0.dev", - "opentelemetry-instrumentation-pymongo==0.39b0.dev", - "opentelemetry-instrumentation-pymysql==0.39b0.dev", - "opentelemetry-instrumentation-pyramid==0.39b0.dev", - "opentelemetry-instrumentation-redis==0.39b0.dev", - "opentelemetry-instrumentation-remoulade==0.39b0.dev", - "opentelemetry-instrumentation-requests==0.39b0.dev", - "opentelemetry-instrumentation-sklearn==0.39b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.39b0.dev", - "opentelemetry-instrumentation-sqlite3==0.39b0.dev", - "opentelemetry-instrumentation-starlette==0.39b0.dev", - "opentelemetry-instrumentation-system-metrics==0.39b0.dev", - "opentelemetry-instrumentation-tornado==0.39b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.39b0.dev", - "opentelemetry-instrumentation-urllib==0.39b0.dev", - "opentelemetry-instrumentation-urllib3==0.39b0.dev", - "opentelemetry-instrumentation-wsgi==0.39b0.dev", + "opentelemetry-instrumentation-aio-pika==0.40b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.40b0.dev", + "opentelemetry-instrumentation-aiopg==0.40b0.dev", + "opentelemetry-instrumentation-asgi==0.40b0.dev", + "opentelemetry-instrumentation-asyncpg==0.40b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.40b0.dev", + "opentelemetry-instrumentation-boto==0.40b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.40b0.dev", + "opentelemetry-instrumentation-botocore==0.40b0.dev", + "opentelemetry-instrumentation-celery==0.40b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.40b0.dev", + "opentelemetry-instrumentation-dbapi==0.40b0.dev", + "opentelemetry-instrumentation-django==0.40b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.40b0.dev", + "opentelemetry-instrumentation-falcon==0.40b0.dev", + "opentelemetry-instrumentation-fastapi==0.40b0.dev", + "opentelemetry-instrumentation-flask==0.40b0.dev", + "opentelemetry-instrumentation-grpc==0.40b0.dev", + "opentelemetry-instrumentation-httpx==0.40b0.dev", + "opentelemetry-instrumentation-jinja2==0.40b0.dev", + "opentelemetry-instrumentation-kafka-python==0.40b0.dev", + "opentelemetry-instrumentation-logging==0.40b0.dev", + "opentelemetry-instrumentation-mysql==0.40b0.dev", + "opentelemetry-instrumentation-pika==0.40b0.dev", + "opentelemetry-instrumentation-psycopg2==0.40b0.dev", + "opentelemetry-instrumentation-pymemcache==0.40b0.dev", + "opentelemetry-instrumentation-pymongo==0.40b0.dev", + "opentelemetry-instrumentation-pymysql==0.40b0.dev", + "opentelemetry-instrumentation-pyramid==0.40b0.dev", + "opentelemetry-instrumentation-redis==0.40b0.dev", + "opentelemetry-instrumentation-remoulade==0.40b0.dev", + "opentelemetry-instrumentation-requests==0.40b0.dev", + "opentelemetry-instrumentation-sklearn==0.40b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.40b0.dev", + "opentelemetry-instrumentation-sqlite3==0.40b0.dev", + "opentelemetry-instrumentation-starlette==0.40b0.dev", + "opentelemetry-instrumentation-system-metrics==0.40b0.dev", + "opentelemetry-instrumentation-tornado==0.40b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.40b0.dev", + "opentelemetry-instrumentation-urllib==0.40b0.dev", + "opentelemetry-instrumentation-urllib3==0.40b0.dev", + "opentelemetry-instrumentation-wsgi==0.40b0.dev", ] [project.optional-dependencies] diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py index eb62a67e28..87b20fddc3 100644 --- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py +++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index eafbba7130..f169b0a09a 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -24,13 +24,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.39b0.dev", + "opentelemetry-instrumentation == 0.40b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.18.0.dev", + "opentelemetry-exporter-otlp == 1.19.0.dev", ] test = [] diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py index eb62a67e28..87b20fddc3 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/version.py +++ b/opentelemetry-distro/src/opentelemetry/distro/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 05c77b9fea..8200196ca8 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,158 +18,158 @@ libraries = { "aio_pika": { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.40b0.dev", }, "aiohttp": { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.40b0.dev", }, "aiopg": { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.40b0.dev", }, "asgiref": { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.40b0.dev", }, "asyncpg": { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.40b0.dev", }, "boto": { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.40b0.dev", }, "boto3": { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.40b0.dev", }, "botocore": { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.40b0.dev", }, "celery": { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.40b0.dev", }, "confluent-kafka": { "library": "confluent-kafka >= 1.8.2, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.40b0.dev", }, "django": { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.40b0.dev", }, "elasticsearch": { "library": "elasticsearch >= 2.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.40b0.dev", }, "falcon": { "library": "falcon >= 1.4.1, < 4.0.0", - "instrumentation": "opentelemetry-instrumentation-falcon==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.40b0.dev", }, "fastapi": { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.40b0.dev", }, "flask": { "library": "flask >= 1.0, < 3.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.40b0.dev", }, "grpcio": { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.40b0.dev", }, "httpx": { "library": "httpx >= 0.18.0, <= 0.23.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.40b0.dev", }, "jinja2": { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.40b0.dev", }, "kafka-python": { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.40b0.dev", }, "mysql-connector-python": { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.40b0.dev", }, "pika": { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.40b0.dev", }, "psycopg2": { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.40b0.dev", }, "pymemcache": { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.40b0.dev", }, "pymongo": { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.40b0.dev", }, "PyMySQL": { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.40b0.dev", }, "pyramid": { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.40b0.dev", }, "redis": { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.40b0.dev", }, "remoulade": { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.40b0.dev", }, "requests": { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.40b0.dev", }, "scikit-learn": { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.40b0.dev", }, "sqlalchemy": { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.40b0.dev", }, "starlette": { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.40b0.dev", }, "psutil": { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.40b0.dev", }, "tornado": { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.40b0.dev", }, "tortoise-orm": { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.40b0.dev", }, "pydantic": { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.40b0.dev", }, "urllib3": { "library": "urllib3 >= 1.0.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.39b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.40b0.dev", }, } default_instrumentations = [ - "opentelemetry-instrumentation-aws-lambda==0.39b0.dev", - "opentelemetry-instrumentation-dbapi==0.39b0.dev", - "opentelemetry-instrumentation-logging==0.39b0.dev", - "opentelemetry-instrumentation-sqlite3==0.39b0.dev", - "opentelemetry-instrumentation-urllib==0.39b0.dev", - "opentelemetry-instrumentation-wsgi==0.39b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.40b0.dev", + "opentelemetry-instrumentation-dbapi==0.40b0.dev", + "opentelemetry-instrumentation-logging==0.40b0.dev", + "opentelemetry-instrumentation-sqlite3==0.40b0.dev", + "opentelemetry-instrumentation-urllib==0.40b0.dev", + "opentelemetry-instrumentation-wsgi==0.40b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index eb62a67e28..87b20fddc3 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py index eb62a67e28..87b20fddc3 100644 --- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py +++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py index eb62a67e28..87b20fddc3 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.39b0.dev" +__version__ = "0.40b0.dev" From 530650df41a5b74f76b40c4dc017b2b0e6f2a1a6 Mon Sep 17 00:00:00 2001 From: Sanket Mehta Date: Mon, 22 May 2023 22:54:31 +0530 Subject: [PATCH 005/200] Resource detector for container properties (#1584) Co-authored-by: Diego Hurtado Co-authored-by: Srikanth Chekuri Co-authored-by: Leighton Chen --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + docs/conf.py | 8 +- docs/index.rst | 11 +- docs/resource/container/container.rst | 7 + .../LICENSE | 201 ++++++++++++++++++ .../MANITEST.rst | 9 + .../README.rst | 46 ++++ .../pyproject.toml | 50 +++++ .../resource/detector/container/__init__.py | 95 +++++++++ .../resource/detector/container/version.py | 15 ++ .../tests/__init__.py | 0 .../tests/test_container.py | 146 +++++++++++++ tox.ini | 8 + 14 files changed, 597 insertions(+), 3 deletions(-) create mode 100644 docs/resource/container/container.rst create mode 100644 resource/opentelemetry-resource-detector-container/LICENSE create mode 100644 resource/opentelemetry-resource-detector-container/MANITEST.rst create mode 100644 resource/opentelemetry-resource-detector-container/README.rst create mode 100644 resource/opentelemetry-resource-detector-container/pyproject.toml create mode 100644 resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/__init__.py create mode 100644 resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py create mode 100644 resource/opentelemetry-resource-detector-container/tests/__init__.py create mode 100644 resource/opentelemetry-resource-detector-container/tests/test_container.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62b04f57e8..09897b615f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: python-version: [ py37, py38, py39, py310, py311, pypy3 ] - package: ["instrumentation", "distro", "exporter", "sdkextension", "propagator"] + package: ["instrumentation", "distro", "exporter", "sdkextension", "propagator", "resource"] os: [ ubuntu-20.04 ] steps: - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 885bf2bec9..e7b8439555 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -127,6 +127,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- `opentelemetry-resource-detector-container` Add support resource detection of container properties. + ([#1584](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1584)) - `opentelemetry-instrumentation-pymysql` Add tests for commit() and rollback(). ([#1424](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1424)) - `opentelemetry-instrumentation-fastapi` Add support for regular expression matching and sanitization of HTTP headers. diff --git a/docs/conf.py b/docs/conf.py index 23918eb331..4b2bda04a8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,7 +54,13 @@ if isdir(join(sdk_ext, f)) ] -sys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs + prop_dirs +resource = "../resource" +resource_dirs = [ + os.path.abspath("/".join(["../resource", f, "src"])) + for f in listdir(resource) + if isdir(join(resource, f)) +] +sys.path[:0] = exp_dirs + instr_dirs + sdk_ext_dirs + prop_dirs + resource_dirs # -- Project information ----------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 44fbfc1188..5203c377e4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -33,7 +33,7 @@ Extensions Visit `OpenTelemetry Registry `_ to find a lot of related projects like exporters, instrumentation libraries, tracer -implementations, etc. +implementations, resource, etc. Installing Cutting Edge Packages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -51,6 +51,7 @@ install pip install -e ./instrumentation/opentelemetry-instrumentation-flask pip install -e ./instrumentation/opentelemetry-instrumentation-botocore pip install -e ./sdk-extension/opentelemetry-sdk-extension-aws + pip install -e ./resource/opentelemetry-resource-detector-container .. toctree:: @@ -85,6 +86,14 @@ install sdk-extension/** +.. toctree:: + :maxdepth: 2 + :caption: OpenTelemetry Resource Detectors + :name: Resource Detectors + :glob: + + resource/** + Indices and tables ------------------ diff --git a/docs/resource/container/container.rst b/docs/resource/container/container.rst new file mode 100644 index 0000000000..e69a2f6a0f --- /dev/null +++ b/docs/resource/container/container.rst @@ -0,0 +1,7 @@ +OpenTelemetry Python - Resource Detector for Containers +======================================================= + +.. automodule:: opentelemetry.resource.detector.container + :members: + :undoc-members: + :show-inheritance: diff --git a/resource/opentelemetry-resource-detector-container/LICENSE b/resource/opentelemetry-resource-detector-container/LICENSE new file mode 100644 index 0000000000..1ef7dad2c5 --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + 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. diff --git a/resource/opentelemetry-resource-detector-container/MANITEST.rst b/resource/opentelemetry-resource-detector-container/MANITEST.rst new file mode 100644 index 0000000000..2906eeef0f --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/MANITEST.rst @@ -0,0 +1,9 @@ +graft src +graft tests +global-exclude *.pyc +global-exclude *.pyo +global-exclude __pycache__/* +include CHANGELOG.md +include MANIFEST.in +include README.rst +include LICENSE \ No newline at end of file diff --git a/resource/opentelemetry-resource-detector-container/README.rst b/resource/opentelemetry-resource-detector-container/README.rst new file mode 100644 index 0000000000..8fadd67951 --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/README.rst @@ -0,0 +1,46 @@ +OpenTelemetry Resource detectors for containers +========================================================== + +|pypi| + +.. |pypi| image:: TODO + :target: TODO + + +This library provides custom resource detector for container platforms + +Installation +------------ + +:: + + pip install opentelemetry-resource-detector-container + +--------------------------- + +Usage example for `opentelemetry-resource-detector-container` + +.. code-block:: python + + from opentelemetry import trace + from opentelemetry.sdk.trace import TracerProvider + from opentelemetry.resource.detector.container import ( + ContainerResourceDetector, + ) + from opentelemetry.sdk.resources import get_aggregated_resources + + + trace.set_tracer_provider( + TracerProvider( + resource=get_aggregated_resources( + [ + ContainerResourceDetector(), + ] + ), + ) + ) + +References +---------- + +* `OpenTelemetry Project `_ diff --git a/resource/opentelemetry-resource-detector-container/pyproject.toml b/resource/opentelemetry-resource-detector-container/pyproject.toml new file mode 100644 index 0000000000..87fa4c83a8 --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/pyproject.toml @@ -0,0 +1,50 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-resource-detector-container" +dynamic = ["version"] +description = "Container Resource Detector for OpenTelemetry" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "opentelemetry-sdk ~= 1.12", +] + +[project.optional-dependencies] +test = [] + +[project.entry-points.opentelemetry_resource_detector] +container = "opentelemetry.resource.detector.container:ContainerResourceDetector" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/resource/opentelemetry-resource-detector-container" + +[tool.hatch.version] +path = "src/opentelemetry/resource/detector/container/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/__init__.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/__init__.py new file mode 100644 index 0000000000..8e7db6a7a8 --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/__init__.py @@ -0,0 +1,95 @@ +# 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. + +from logging import getLogger + +from opentelemetry.sdk.resources import Resource, ResourceDetector +from opentelemetry.semconv.resource import ResourceAttributes + +logger = getLogger(__name__) +_DEFAULT_CGROUP_V1_PATH = "/proc/self/cgroup" +_DEFAULT_CGROUP_V2_PATH = "/proc/self/mountinfo" +_CONTAINER_ID_LENGTH = 64 + + +def _get_container_id_v1(): + container_id = None + try: + with open( + _DEFAULT_CGROUP_V1_PATH, encoding="utf8" + ) as container_info_file: + for raw_line in container_info_file.readlines(): + line = raw_line.strip() + if len(line) > _CONTAINER_ID_LENGTH: + container_id = line[-_CONTAINER_ID_LENGTH:] + break + except FileNotFoundError as exception: + logger.warning("Failed to get container id. Exception: %s", exception) + return container_id + + +def _get_container_id_v2(): + container_id = None + try: + with open( + _DEFAULT_CGROUP_V2_PATH, encoding="utf8" + ) as container_info_file: + for raw_line in container_info_file.readlines(): + line = raw_line.strip() + if any( + key_word in line for key_word in ["containers", "hostname"] + ): + container_id_list = [ + id_ + for id_ in line.split("/") + if len(id_) == _CONTAINER_ID_LENGTH + ] + if len(container_id_list) > 0: + container_id = container_id_list[0] + break + + except FileNotFoundError as exception: + logger.warning("Failed to get container id. Exception: %s", exception) + return container_id + + +def _get_container_id(): + return _get_container_id_v1() or _get_container_id_v2() + + +class ContainerResourceDetector(ResourceDetector): + """Detects container.id only available when app is running inside the + docker container and return it in a Resource + """ + + def detect(self) -> "Resource": + try: + container_id = _get_container_id() + resource = Resource.get_empty() + if container_id: + resource = resource.merge( + Resource({ResourceAttributes.CONTAINER_ID: container_id}) + ) + return resource + + # pylint: disable=broad-except + except Exception as exception: + logger.warning( + "%s Resource Detection failed silently: %s", + self.__class__.__name__, + exception, + ) + if self.raise_on_error: + raise exception + return Resource.get_empty() diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py new file mode 100644 index 0000000000..8778b43b17 --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py @@ -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.38b0.dev" diff --git a/resource/opentelemetry-resource-detector-container/tests/__init__.py b/resource/opentelemetry-resource-detector-container/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/resource/opentelemetry-resource-detector-container/tests/test_container.py b/resource/opentelemetry-resource-detector-container/tests/test_container.py new file mode 100644 index 0000000000..ac55afa291 --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/tests/test_container.py @@ -0,0 +1,146 @@ +# 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. + +from unittest.mock import mock_open, patch + +from opentelemetry import trace as trace_api +from opentelemetry.resource.detector.container import ContainerResourceDetector +from opentelemetry.sdk.resources import get_aggregated_resources +from opentelemetry.semconv.resource import ResourceAttributes +from opentelemetry.test.test_base import TestBase + +MockContainerResourceAttributes = { + ResourceAttributes.CONTAINER_ID: "7be92808767a667f35c8505cbf40d14e931ef6db5b0210329cf193b15ba9d605", +} + + +class ContainerResourceDetectorTest(TestBase): + @patch( + "builtins.open", + new_callable=mock_open, + read_data=f"""14:name=systemd:/docker/{MockContainerResourceAttributes[ResourceAttributes.CONTAINER_ID]} + 13:rdma:/ + 12:pids:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 11:hugetlb:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 10:net_prio:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 9:perf_event:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 8:net_cls:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 7:freezer:/docker/ + 6:devices:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 5:memory:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 4:blkio:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 3:cpuacct:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 2:cpu:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + 1:cpuset:/docker/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked + """, + ) + def test_container_id_detect_from_cgroup_file(self, mock_cgroup_file): + actual = ContainerResourceDetector().detect() + self.assertDictEqual( + actual.attributes.copy(), MockContainerResourceAttributes + ) + + @patch( + "opentelemetry.resource.detector.container._get_container_id_v1", + return_value=None, + ) + @patch( + "builtins.open", + new_callable=mock_open, + read_data=f""" + 608 607 0:183 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw + 609 607 0:184 / /dev rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755 + 610 609 0:185 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=666 + 611 607 0:186 / /sys ro,nosuid,nodev,noexec,relatime - sysfs sysfs ro + 612 611 0:29 / /sys/fs/cgroup ro,nosuid,nodev,noexec,relatime - cgroup2 cgroup rw + 613 609 0:182 / /dev/mqueue rw,nosuid,nodev,noexec,relatime - mqueue mqueue rw + 614 609 0:187 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw,size=65536k + 615 607 254:1 /docker/containers/{MockContainerResourceAttributes[ResourceAttributes.CONTAINER_ID]}/resolv.conf /etc/resolv.conf rw,relatime - ext4 /dev/vda1 rw + 616 607 254:1 /docker/containers/{MockContainerResourceAttributes[ResourceAttributes.CONTAINER_ID]}/hostname /etc/hostname rw,relatime - ext4 /dev/vda1 rw + 617 607 254:1 /docker/containers/bogusContainerIdThatShouldNotBeOneSetBecauseTheFirstOneWasPicked/hosts /etc/hosts rw,relatime - ext4 /dev/vda1 rw + 618 607 0:131 /Users/sankmeht/development/otel/opentelemetry-python /development/otel/opentelemetry-python rw,nosuid,nodev,relatime - fuse.grpcfuse grpcfuse rw,user_id=0,group_id=0,allow_other,max_read=1048576 + 619 607 0:131 /Users/sankmeht/development/otel/opentelemetry-python-contrib /development/otel/opentelemetry-python-contrib rw,nosuid,nodev,relatime - fuse.grpcfuse grpcfuse rw,user_id=0,group_id=0,allow_other,max_read=1048576 + 519 609 0:185 /0 /dev/console rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=666 + 520 608 0:183 /bus /proc/bus ro,nosuid,nodev,noexec,relatime - proc proc rw + 521 608 0:183 /fs /proc/fs ro,nosuid,nodev,noexec,relatime - proc proc rw + 522 608 0:183 /irq /proc/irq ro,nosuid,nodev,noexec,relatime - proc proc rw + 523 608 0:183 /sys /proc/sys ro,nosuid,nodev,noexec,relatime - proc proc rw + 524 608 0:183 /sysrq-trigger /proc/sysrq-trigger ro,nosuid,nodev,noexec,relatime - proc proc rw + 525 608 0:212 / /proc/acpi ro,relatime - tmpfs tmpfs ro + 526 608 0:184 /null /proc/kcore rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755 + 527 608 0:184 /null /proc/keys rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755 + 528 608 0:184 /null /proc/timer_list rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755 + 529 611 0:213 / /sys/firmware ro,relatime - tmpfs tmpfs ro + """, + ) + def test_container_id_detect_from_mountinfo_file( + self, mock_get_container_id_v1, mock_cgroup_file + ): + actual = ContainerResourceDetector().detect() + self.assertDictEqual( + actual.attributes.copy(), MockContainerResourceAttributes + ) + + @patch( + "opentelemetry.resource.detector.container._get_container_id", + return_value=MockContainerResourceAttributes[ + ResourceAttributes.CONTAINER_ID + ], + ) + def test_container_id_as_span_attribute(self, mock_cgroup_file): + tracer_provider, exporter = self.create_tracer_provider( + resource=get_aggregated_resources([ContainerResourceDetector()]) + ) + tracer = tracer_provider.get_tracer(__name__) + + with tracer.start_as_current_span( + "test", kind=trace_api.SpanKind.SERVER + ) as _: + pass + + span_list = exporter.get_finished_spans() + self.assertEqual( + span_list[0].resource.attributes["container.id"], + MockContainerResourceAttributes[ResourceAttributes.CONTAINER_ID], + ) + + @patch( + "opentelemetry.resource.detector.container._get_container_id", + return_value=MockContainerResourceAttributes[ + ResourceAttributes.CONTAINER_ID + ], + ) + def test_container_id_detect_from_cgroup(self, mock_get_container_id): + actual = ContainerResourceDetector().detect() + self.assertDictEqual( + actual.attributes.copy(), MockContainerResourceAttributes + ) + + @patch( + "opentelemetry.resource.detector.container._get_container_id_v1", + return_value=None, + ) + @patch( + "opentelemetry.resource.detector.container._get_container_id_v2", + return_value=MockContainerResourceAttributes[ + ResourceAttributes.CONTAINER_ID + ], + ) + def test_container_id_detect_from_mount_info( + self, mock_get_container_id_v1, mock_get_container_id_v2 + ): + actual = ContainerResourceDetector().detect() + self.assertDictEqual( + actual.attributes.copy(), MockContainerResourceAttributes + ) diff --git a/tox.ini b/tox.ini index 94e385e5ea..d8461a1b81 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,10 @@ envlist = ; Environments are organized by individual package, allowing ; for specifying supported Python versions per package. + ; opentelemetry-resource-detector-container + py3{7,8,9,10,11}-test-resource-detector-container + pypy3-test-resource-detector-container + ; opentelemetry-sdk-extension-aws py3{7,8,9,10,11}-test-sdkextension-aws pypy3-test-sdkextension-aws @@ -330,6 +334,7 @@ changedir = test-instrumentation-httpx{18,21}: instrumentation/opentelemetry-instrumentation-httpx/tests test-util-http: util/opentelemetry-util-http/tests test-sdkextension-aws: sdk-extension/opentelemetry-sdk-extension-aws/tests + test-resource-detector-container: resource/opentelemetry-resource-detector-container/tests test-propagator-aws: propagator/opentelemetry-propagator-aws-xray/tests test-propagator-ot-trace: propagator/opentelemetry-propagator-ot-trace/tests test-exporter-richconsole: exporter/opentelemetry-exporter-richconsole/tests @@ -441,6 +446,8 @@ commands_pre = sdkextension-aws: pip install {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] + resource-detector-container: pip install {toxinidir}/resource/opentelemetry-resource-detector-container[test] + http: pip install {toxinidir}/util/opentelemetry-util-http[test] ; In order to get a health coverage report, propagator-ot-trace: pip install {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] @@ -546,6 +553,7 @@ commands_pre = python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write[test] python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] + python -m pip install -e {toxinidir}/resource/opentelemetry-resource-detector-container[test] python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-aws-xray[test] python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] python -m pip install -e {toxinidir}/opentelemetry-distro[test] From 42e8f8f6e27b9cf4be553854fac32982547484ad Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Mon, 22 May 2023 12:02:05 -0600 Subject: [PATCH 006/200] botocore: always use x-ray for http header injection (#1741) Co-authored-by: Diego Hurtado --- CHANGELOG.md | 5 ++ .../pyproject.toml | 1 + .../instrumentation/botocore/__init__.py | 30 ++++++--- .../tests/test_botocore_instrumentation.py | 66 ++++++++++++------- 4 files changed, 68 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b8439555..ee92bdab7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-logging` Add `otelTraceSampled` to instrumetation-logging ([#1773](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1773)) +### Changed + +- `opentelemetry-instrumentation-botocore` now uses the AWS X-Ray propagator by + default + ([#1741](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1741)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 6125bcfa60..3f2454a742 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -28,6 +28,7 @@ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-instrumentation == 0.40b0.dev", "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-propagator-aws-xray == 1.0.1", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py index 40a760d525..baf8a56e71 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py @@ -101,7 +101,7 @@ def response_hook(span, service_name, operation_name, result): _SUPPRESS_INSTRUMENTATION_KEY, unwrap, ) -from opentelemetry.propagate import inject +from opentelemetry.propagators.aws.aws_xray_propagator import AwsXRayPropagator from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace import get_tracer from opentelemetry.trace.span import Span @@ -109,14 +109,6 @@ def response_hook(span, service_name, operation_name, result): logger = logging.getLogger(__name__) -# pylint: disable=unused-argument -def _patched_endpoint_prepare_request(wrapped, instance, args, kwargs): - request = args[0] - headers = request.headers - inject(headers) - return wrapped(*args, **kwargs) - - class BotocoreInstrumentor(BaseInstrumentor): """An instrumentor for Botocore. @@ -127,6 +119,7 @@ def __init__(self): super().__init__() self.request_hook = None self.response_hook = None + self.propagator = AwsXRayPropagator() def instrumentation_dependencies(self) -> Collection[str]: return _instruments @@ -140,6 +133,10 @@ def _instrument(self, **kwargs): self.request_hook = kwargs.get("request_hook") self.response_hook = kwargs.get("response_hook") + propagator = kwargs.get("propagator") + if propagator is not None: + self.propagator = propagator + wrap_function_wrapper( "botocore.client", "BaseClient._make_api_call", @@ -149,13 +146,26 @@ def _instrument(self, **kwargs): wrap_function_wrapper( "botocore.endpoint", "Endpoint.prepare_request", - _patched_endpoint_prepare_request, + self._patched_endpoint_prepare_request, ) def _uninstrument(self, **kwargs): unwrap(BaseClient, "_make_api_call") unwrap(Endpoint, "prepare_request") + # pylint: disable=unused-argument + def _patched_endpoint_prepare_request( + self, wrapped, instance, args, kwargs + ): + request = args[0] + headers = request.headers + + # Only the x-ray header is propagated by AWS services. Using any + # other propagator will lose the trace context. + self.propagator.inject(headers) + + return wrapped(*args, **kwargs) + # pylint: disable=too-many-branches def _patched_api_call(self, original_func, instance, args, kwargs): if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY): diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py index 9a5d8429b5..3d25dcbf2d 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py @@ -36,9 +36,11 @@ 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.propagators.aws.aws_xray_propagator import TRACE_HEADER_KEY from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.mock_textmap import MockTextMapPropagator from opentelemetry.test.test_base import TestBase +from opentelemetry.trace.span import format_span_id, format_trace_id _REQUEST_ID_REGEX_MATCH = r"[A-Z0-9]{52}" @@ -225,27 +227,21 @@ def test_unpatch(self): @mock_ec2 def test_uninstrument_does_not_inject_headers(self): headers = {} - previous_propagator = get_global_textmap() - try: - set_global_textmap(MockTextMapPropagator()) - def intercept_headers(**kwargs): - headers.update(kwargs["request"].headers) + def intercept_headers(**kwargs): + headers.update(kwargs["request"].headers) - ec2 = self._make_client("ec2") + ec2 = self._make_client("ec2") - BotocoreInstrumentor().uninstrument() + BotocoreInstrumentor().uninstrument() - ec2.meta.events.register_first( - "before-send.ec2.DescribeInstances", intercept_headers - ) - with self.tracer_provider.get_tracer("test").start_span("parent"): - ec2.describe_instances() + ec2.meta.events.register_first( + "before-send.ec2.DescribeInstances", intercept_headers + ) + with self.tracer_provider.get_tracer("test").start_span("parent"): + ec2.describe_instances() - self.assertNotIn(MockTextMapPropagator.TRACE_ID_KEY, headers) - self.assertNotIn(MockTextMapPropagator.SPAN_ID_KEY, headers) - finally: - set_global_textmap(previous_propagator) + self.assertNotIn(TRACE_HEADER_KEY, headers) @mock_sqs def test_double_patch(self): @@ -306,20 +302,42 @@ def check_headers(**kwargs): "EC2", "DescribeInstances", request_id=request_id ) - self.assertIn(MockTextMapPropagator.TRACE_ID_KEY, headers) - self.assertEqual( - str(span.get_span_context().trace_id), - headers[MockTextMapPropagator.TRACE_ID_KEY], + # only x-ray propagation is used in HTTP requests + self.assertIn(TRACE_HEADER_KEY, headers) + xray_context = headers[TRACE_HEADER_KEY] + formated_trace_id = format_trace_id( + span.get_span_context().trace_id ) - self.assertIn(MockTextMapPropagator.SPAN_ID_KEY, headers) - self.assertEqual( - str(span.get_span_context().span_id), - headers[MockTextMapPropagator.SPAN_ID_KEY], + formated_trace_id = ( + formated_trace_id[:8] + "-" + formated_trace_id[8:] ) + self.assertEqual( + xray_context.lower(), + f"root=1-{formated_trace_id};parent={format_span_id(span.get_span_context().span_id)};sampled=1".lower(), + ) finally: set_global_textmap(previous_propagator) + @mock_ec2 + def test_override_xray_propagator_injects_into_request(self): + headers = {} + + def check_headers(**kwargs): + nonlocal headers + headers = kwargs["request"].headers + + BotocoreInstrumentor().instrument() + + ec2 = self._make_client("ec2") + ec2.meta.events.register_first( + "before-send.ec2.DescribeInstances", check_headers + ) + ec2.describe_instances() + + self.assertNotIn(MockTextMapPropagator.TRACE_ID_KEY, headers) + self.assertNotIn(MockTextMapPropagator.SPAN_ID_KEY, headers) + @mock_xray def test_suppress_instrumentation_xray_client(self): xray_client = self._make_client("xray") From cae6ce46ecf834d959929f20e095f10a55f3b9d0 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 22 May 2023 17:19:50 -0600 Subject: [PATCH 007/200] Refactor CODEOWNERS file (#1804) * Refactor CODEOWNERS file Fixes #1803 * Remove CODEOWNERS * Refactor component owners configuration * Refactor CODEOWNERS to select any file but the ones in instrumentation --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- .github/CODEOWNERS | 28 +++++++--------------------- .github/component_owners.yml | 14 ++++++++++++++ CONTRIBUTING.md | 11 +++++++++++ 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 868fbf8f9c..0cb85929af 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,26 +1,12 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. -# -# What is a "CODEOWNER"? -# -# A CODEOWNER lends their expertise to a specific package hosted by an OpenTelemetry repository. -# -# A CODEOWNER MUST: -# - introduce themselves on the CNCF OTel Python channel: https://cloud-native.slack.com/archives/C01PD4HUVBL -# - have enough knowledge of the corresponding instrumented library -# - respond to issues -# - fix failing unit tests or any other blockers to the CI/CD workflow -# - update usage of `opentelemetry-python-core` APIs upon the introduction of breaking changes -# - be a member of the OpenTelemetry community so that the `component-owners.yml` action to automatically assign CODEOWNERS to PRs works correctly. -# +# This file is only used as a way to assign any change to the approvers team +# except for a change in any of the instrumentations. The actual codeowners +# of the instrumentations are in .github/component_owners.yml. - -# For anything not explicitly taken by someone else: +# Assigns any change to the approvers team... * @open-telemetry/opentelemetry-python-contrib-approvers +# ...except for changes in any instrumentation. +/instrumentation + # Learn about CODEOWNERS file format: # https://help.github.com/en/articles/about-code-owners -# -# Learn about membership in OpenTelemetry community: -# https://github.com/open-telemetry/community/blob/main/community-membership.md -# diff --git a/.github/component_owners.yml b/.github/component_owners.yml index 933dc7da13..7f5b6b1c44 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -43,9 +43,23 @@ components: instrumentation/opentelemetry-instrumentation-urllib: - shalevr + - ocelotl instrumentation/opentelemetry-instrumentation-urllib3: - shalevr + - ocelotl instrumentation/opentelemetry-instrumentation-sqlalchemy: - shalevr + + instrumentation/opentelemetry-instrumentation-flask: + - ocelotl + + instrumentation/opentelemetry-instrumentation-jinja2: + - ocelotl + + instrumentation/opentelemetry-instrumentation-logging: + - ocelotl + + instrumentation/opentelemetry-instrumentation-requests: + - ocelotl diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a159bd1f03..41f2aa08cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -124,6 +124,17 @@ Open a pull request against the main `opentelemetry-python-contrib` repo. as `work-in-progress`, or mark it as [`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/). * Make sure CLA is signed and CI is clear. +### How to Get PRs Reviewed + +The maintainers and approvers of this repo are not experts in every instrumentation there is here. +In fact each one of us knows enough about them to only review a few. Unfortunately it can be hard +to find enough experts in every instrumentation to quickly review every instrumentation PR. The +instrumentation experts are listed in `.github/component_owners.yml` with their corresponding files +or directories that they own. The owners listed there will be notified when PRs that modify their +files are opened. + +If you are not getting reviews, please contact the respective owners directly. + ### How to Get PRs Merged A PR is considered to be **ready to merge** when: From a6797541721af72e6feab400e24ceaabc08cb31e Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 23 May 2023 17:14:38 -0600 Subject: [PATCH 008/200] Update maintainers list (#1817) --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b7cc036e5..09015cdd5f 100644 --- a/README.md +++ b/README.md @@ -95,12 +95,13 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)): - [Aaron Abbott](https://github.com/aabmass), Google +- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft - [Sanket Mehta](https://github.com/sanketmehta28), Cisco - [Shalev Roda](https://github.com/shalevr), Cisco Emeritus Approvers: -- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft +- [Héctor Hernández](https://github.com/hectorhdzg), Microsoft - [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google - [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), AWS - [Ashutosh Goel](https://github.com/ashu658), Cisco @@ -111,12 +112,12 @@ Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-t - [Diego Hurtado](https://github.com/ocelotl), Lightstep - [Leighton Chen](https://github.com/lzchen), Microsoft -- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io Emeritus Maintainers: - [Alex Boten](https://github.com/codeboten), Lightstep - [Owais Lone](https://github.com/owais), Splunk +- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io *Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).* From 2edcc21ea205f213b2b5aedae72fff8404c3071d Mon Sep 17 00:00:00 2001 From: Shalev Roda <65566801+shalevr@users.noreply.github.com> Date: Fri, 9 Jun 2023 16:18:16 +0300 Subject: [PATCH 009/200] skip urllib3 test on pypy3 (#1826) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index d8461a1b81..be821e9adf 100644 --- a/tox.ini +++ b/tox.ini @@ -93,7 +93,7 @@ envlist = ; opentelemetry-instrumentation-urllib3 py3{7,8,9,10,11}-test-instrumentation-urllib3 - pypy3-test-instrumentation-urllib3 + ;pypy3-test-instrumentation-urllib3 ; opentelemetry-instrumentation-requests py3{7,8,9,10,11}-test-instrumentation-requests From 776f9d464361ae06ccf663e9b91ae7269882c800 Mon Sep 17 00:00:00 2001 From: Shalev Roda <65566801+shalevr@users.noreply.github.com> Date: Tue, 13 Jun 2023 11:07:45 +0300 Subject: [PATCH 010/200] Fix celery docker tests (#1841) --- .../tests/celery/test_celery_functional.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py b/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py index 1a86154ffc..f284272c5d 100644 --- a/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py +++ b/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py @@ -303,8 +303,8 @@ def fn_exception(): span = spans[0] - assert span.status.is_ok is True - assert span.status.status_code == StatusCode.UNSET + assert span.status.is_ok is False + assert span.status.status_code == StatusCode.ERROR assert span.name == "run/test_celery_functional.fn_exception" assert span.attributes.get("celery.action") == "run" assert span.attributes.get("celery.state") == "FAILURE" @@ -443,8 +443,8 @@ def run(self): span = spans[0] - assert span.status.is_ok is True - assert span.status.status_code == StatusCode.UNSET + assert span.status.is_ok is False + assert span.status.status_code == StatusCode.ERROR assert span.name == "run/test_celery_functional.BaseTask" assert span.attributes.get("celery.action") == "run" assert span.attributes.get("celery.state") == "FAILURE" From 26c673e7c9364a00b94f2868360162f8849e4640 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Jun 2023 10:40:41 +0200 Subject: [PATCH 011/200] Use HTTP mock server for aiohttp tests (#1849) Fixes #1842 --- .../pyproject.toml | 1 + .../tests/test_aiohttp_client_integration.py | 33 ++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index acdc1a2a4d..ea23325caa 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -38,6 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aiohttp-client[instruments]", + "http-server-mock" ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py index d9f76f0239..7c3d7b634d 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py @@ -23,6 +23,7 @@ import aiohttp import aiohttp.test_utils import yarl +from http_server_mock import HttpServerMock from pkg_resources import iter_entry_points from opentelemetry import context @@ -313,18 +314,26 @@ async def request_handler(request): def test_credential_removal(self): trace_configs = [aiohttp_client.create_trace_config()] - url = "http://username:password@httpbin.org/status/200" - with self.subTest(url=url): + app = HttpServerMock("test_credential_removal") - async def do_request(url): - async with aiohttp.ClientSession( - trace_configs=trace_configs, - ) as session: - async with session.get(url): - pass + @app.route("/status/200") + def index(): + return "hello" - loop = asyncio.get_event_loop() - loop.run_until_complete(do_request(url)) + url = "http://username:password@localhost:5000/status/200" + + with app.run("localhost", 5000): + with self.subTest(url=url): + + async def do_request(url): + async with aiohttp.ClientSession( + trace_configs=trace_configs, + ) as session: + async with session.get(url): + pass + + loop = asyncio.get_event_loop() + loop.run_until_complete(do_request(url)) self.assert_spans( [ @@ -333,7 +342,9 @@ async def do_request(url): (StatusCode.UNSET, None), { SpanAttributes.HTTP_METHOD: "GET", - SpanAttributes.HTTP_URL: "http://httpbin.org/status/200", + SpanAttributes.HTTP_URL: ( + "http://localhost:5000/status/200" + ), SpanAttributes.HTTP_STATUS_CODE: int(HTTPStatus.OK), }, ) From bcf770d079dc7b76aa5260ebf30f1620ffe51408 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Jun 2023 12:01:02 +0200 Subject: [PATCH 012/200] Use HTTP mock server for tornado tests (#1855) * Use HTTP mock server for tornado tests Fixes #1681 * Fix lint --- .../tests/pyramid_base_test.py | 6 +- .../pyproject.toml | 1 + .../tests/test_instrumentation.py | 56 ++++++++++--------- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/tests/pyramid_base_test.py b/instrumentation/opentelemetry-instrumentation-pyramid/tests/pyramid_base_test.py index f5dd9fd7d7..c6b9faa196 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/tests/pyramid_base_test.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/tests/pyramid_base_test.py @@ -15,7 +15,11 @@ import pyramid.httpexceptions as exc from pyramid.response import Response from werkzeug.test import Client -from werkzeug.wrappers import BaseResponse + +# opentelemetry-instrumentation-pyramid uses werkzeug==0.16.1 which has +# werkzeug.wrappers.BaseResponse. This is not the case for newer versions of +# werkzeug like the one lint uses. +from werkzeug.wrappers import BaseResponse # pylint: disable=no-name-in-module class InstrumentationTest: diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index a16554af74..c0553eb6c0 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -37,6 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-tornado[instruments]", "opentelemetry-test-utils == 0.40b0.dev", + "http-server-mock" ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py index 9fb3608572..c875a331ef 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py @@ -15,6 +15,7 @@ from unittest.mock import Mock, patch +from http_server_mock import HttpServerMock from tornado.testing import AsyncHTTPTestCase from opentelemetry import trace @@ -494,32 +495,35 @@ def test_response_headers(self): self.memory_exporter.clear() set_global_response_propagator(orig) - # todo(srikanthccv): fix this test - # this test is making request to real httpbin.org/status/200 which - # is not a good idea as it can fail due to availability of the - # service. - # def test_credential_removal(self): - # response = self.fetch( - # "http://username:password@httpbin.org/status/200" - # ) - # self.assertEqual(response.code, 200) - - # spans = self.sorted_spans(self.memory_exporter.get_finished_spans()) - # self.assertEqual(len(spans), 1) - # client = spans[0] - - # self.assertEqual(client.name, "GET") - # self.assertEqual(client.kind, SpanKind.CLIENT) - # self.assertSpanHasAttributes( - # client, - # { - # SpanAttributes.HTTP_URL: "http://httpbin.org/status/200", - # SpanAttributes.HTTP_METHOD: "GET", - # SpanAttributes.HTTP_STATUS_CODE: 200, - # }, - # ) - - # self.memory_exporter.clear() + def test_credential_removal(self): + app = HttpServerMock("test_credential_removal") + + @app.route("/status/200") + def index(): + return "hello" + + with app.run("localhost", 5000): + response = self.fetch( + "http://username:password@localhost:5000/status/200" + ) + self.assertEqual(response.code, 200) + + spans = self.sorted_spans(self.memory_exporter.get_finished_spans()) + self.assertEqual(len(spans), 1) + client = spans[0] + + self.assertEqual(client.name, "GET") + self.assertEqual(client.kind, SpanKind.CLIENT) + self.assertSpanHasAttributes( + client, + { + SpanAttributes.HTTP_URL: "http://localhost:5000/status/200", + SpanAttributes.HTTP_METHOD: "GET", + SpanAttributes.HTTP_STATUS_CODE: 200, + }, + ) + + self.memory_exporter.clear() class TestTornadoInstrumentationWithXHeaders(TornadoTest): From fc547877d3db5f9039a842eeb05ad6246e396b67 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Jun 2023 12:30:52 +0200 Subject: [PATCH 013/200] Remove use of httpbin (#1854) --- .../tests/test_asgi_middleware.py | 4 +-- .../README.rst | 6 ++-- .../instrumentation/httpx/__init__.py | 6 ++-- .../tests/test_httpx_integration.py | 4 +-- .../tests/test_requests_integration.py | 8 ++--- .../tests/test_metrics_instrumentation.py | 4 +-- .../tests/test_urllib_integration.py | 18 +++++------ .../tests/test_urllib3_integration.py | 28 ++++++++--------- .../tests/test_urllib3_metrics.py | 30 +++++++++---------- .../tests/test_wsgi_middleware.py | 4 +-- 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index bfa5720f99..7cbae79c6d 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -705,11 +705,11 @@ def test_response_attributes_invalid_status_code(self): self.assertEqual(self.span.set_status.call_count, 1) def test_credential_removal(self): - self.scope["server"] = ("username:password@httpbin.org", 80) + self.scope["server"] = ("username:password@mock", 80) self.scope["path"] = "/status/200" attrs = otel_asgi.collect_request_attributes(self.scope) self.assertEqual( - attrs[SpanAttributes.HTTP_URL], "http://httpbin.org/status/200" + attrs[SpanAttributes.HTTP_URL], "http://mock/status/200" ) def test_collect_target_attribute_missing(self): diff --git a/instrumentation/opentelemetry-instrumentation-httpx/README.rst b/instrumentation/opentelemetry-instrumentation-httpx/README.rst index ffa86cb4bc..1e03eb128e 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/README.rst +++ b/instrumentation/opentelemetry-instrumentation-httpx/README.rst @@ -30,7 +30,7 @@ When using the instrumentor, all clients will automatically trace requests. import httpx from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor - url = "https://httpbin.org/get" + url = "https://some.url/get" HTTPXClientInstrumentor().instrument() with httpx.Client() as client: @@ -51,7 +51,7 @@ use the `instrument_client` method. import httpx from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor - url = "https://httpbin.org/get" + url = "https://some.url/get" with httpx.Client(transport=telemetry_transport) as client: HTTPXClientInstrumentor.instrument_client(client) @@ -96,7 +96,7 @@ If you don't want to use the instrumentor class, you can use the transport class SyncOpenTelemetryTransport, ) - url = "https://httpbin.org/get" + url = "https://some.url/get" transport = httpx.HTTPTransport() telemetry_transport = SyncOpenTelemetryTransport(transport) diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py index b603cbcdd6..736e6c3d32 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -25,7 +25,7 @@ import httpx from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor - url = "https://httpbin.org/get" + url = "https://some.url/get" HTTPXClientInstrumentor().instrument() with httpx.Client() as client: @@ -46,7 +46,7 @@ import httpx from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor - url = "https://httpbin.org/get" + url = "https://some.url/get" with httpx.Client(transport=telemetry_transport) as client: HTTPXClientInstrumentor.instrument_client(client) @@ -91,7 +91,7 @@ SyncOpenTelemetryTransport, ) - url = "https://httpbin.org/get" + url = "https://some.url/get" transport = httpx.HTTPTransport() telemetry_transport = SyncOpenTelemetryTransport(transport) diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index 3cac4c45a7..c0d3705dca 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -97,7 +97,7 @@ class BaseTestCases: class BaseTest(TestBase, metaclass=abc.ABCMeta): # pylint: disable=no-member - URL = "http://httpbin.org/status/200" + URL = "http://mock/status/200" response_hook = staticmethod(_response_hook) request_hook = staticmethod(_request_hook) no_update_request_hook = staticmethod(_no_update_request_hook) @@ -165,7 +165,7 @@ def test_basic_multiple(self): self.assert_span(num_spans=2) def test_not_foundbasic(self): - url_404 = "http://httpbin.org/status/404" + url_404 = "http://mock/status/404" with respx.mock: respx.get(url_404).mock(httpx.Response(404)) diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py index 8d6ee7c04d..6e6a68cb8f 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py @@ -63,7 +63,7 @@ class RequestsIntegrationTestBase(abc.ABC): # pylint: disable=no-member # pylint: disable=too-many-public-methods - URL = "http://httpbin.org/status/200" + URL = "http://mock/status/200" # pylint: disable=invalid-name def setUp(self): @@ -152,7 +152,7 @@ def response_hook(span, request_obj, response): self.assertEqual(span.attributes["response_hook_attr"], "value") def test_excluded_urls_explicit(self): - url_404 = "http://httpbin.org/status/404" + url_404 = "http://mock/status/404" httpretty.register_uri( httpretty.GET, url_404, @@ -194,7 +194,7 @@ def name_callback(method, url): self.assertEqual(span.name, "HTTP GET") def test_not_foundbasic(self): - url_404 = "http://httpbin.org/status/404" + url_404 = "http://mock/status/404" httpretty.register_uri( httpretty.GET, url_404, @@ -460,7 +460,7 @@ def perform_request(url: str, session: requests.Session = None): return session.get(url) def test_credential_removal(self): - new_url = "http://username:password@httpbin.org/status/200" + new_url = "http://username:password@mock/status/200" self.perform_request(new_url) span = self.assert_span() diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py index c9417fc67b..f56aa4f97d 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py @@ -27,8 +27,8 @@ class TestUrllibMetricsInstrumentation(TestBase): - URL = "http://httpbin.org/status/200" - URL_POST = "http://httpbin.org/post" + URL = "http://mock/status/200" + URL_POST = "http://mock/post" def setUp(self): super().setUp() diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py index 9937d42176..35e9e1f1c7 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py @@ -46,9 +46,9 @@ class RequestsIntegrationTestBase(abc.ABC): # pylint: disable=no-member - URL = "http://httpbin.org/status/200" - URL_TIMEOUT = "http://httpbin.org/timeout/0" - URL_EXCEPTION = "http://httpbin.org/exception/0" + URL = "http://mock/status/200" + URL_TIMEOUT = "http://mock/timeout/0" + URL_EXCEPTION = "http://mock/exception/0" # pylint: disable=invalid-name def setUp(self): @@ -83,7 +83,7 @@ def setUp(self): ) httpretty.register_uri( httpretty.GET, - "http://httpbin.org/status/500", + "http://mock/status/500", status=500, ) @@ -142,7 +142,7 @@ def test_basic(self): ) def test_excluded_urls_explicit(self): - url_201 = "http://httpbin.org/status/201" + url_201 = "http://mock/status/201" httpretty.register_uri( httpretty.GET, url_201, @@ -172,7 +172,7 @@ def test_excluded_urls_from_env(self): self.assert_span(num_spans=1) def test_not_foundbasic(self): - url_404 = "http://httpbin.org/status/404/" + url_404 = "http://mock/status/404/" httpretty.register_uri( httpretty.GET, url_404, @@ -336,14 +336,14 @@ def test_custom_tracer_provider(self): def test_requests_exception_with_response(self, *_, **__): with self.assertRaises(HTTPError): - self.perform_request("http://httpbin.org/status/500") + self.perform_request("http://mock/status/500") span = self.assert_span() self.assertEqual( dict(span.attributes), { SpanAttributes.HTTP_METHOD: "GET", - SpanAttributes.HTTP_URL: "http://httpbin.org/status/500", + SpanAttributes.HTTP_URL: "http://mock/status/500", SpanAttributes.HTTP_STATUS_CODE: 500, }, ) @@ -365,7 +365,7 @@ def test_requests_timeout_exception(self, *_, **__): self.assertEqual(span.status.status_code, StatusCode.ERROR) def test_credential_removal(self): - url = "http://username:password@httpbin.org/status/200" + url = "http://username:password@mock/status/200" with self.assertRaises(Exception): self.perform_request(url) diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py index ae59d57c51..315cec1112 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py @@ -35,8 +35,8 @@ class TestURLLib3Instrumentor(TestBase): - HTTP_URL = "http://httpbin.org/status/200" - HTTPS_URL = "https://httpbin.org/status/200" + HTTP_URL = "http://mock/status/200" + HTTPS_URL = "https://mock/status/200" def setUp(self): super().setUp() @@ -123,7 +123,7 @@ def test_basic_http_success(self): self.assert_success_span(response, self.HTTP_URL) def test_basic_http_success_using_connection_pool(self): - pool = urllib3.HTTPConnectionPool("httpbin.org") + pool = urllib3.HTTPConnectionPool("mock") response = pool.request("GET", "/status/200") self.assert_success_span(response, self.HTTP_URL) @@ -133,13 +133,13 @@ def test_basic_https_success(self): self.assert_success_span(response, self.HTTPS_URL) def test_basic_https_success_using_connection_pool(self): - pool = urllib3.HTTPSConnectionPool("httpbin.org") + pool = urllib3.HTTPSConnectionPool("mock") response = pool.request("GET", "/status/200") self.assert_success_span(response, self.HTTPS_URL) def test_basic_not_found(self): - url_404 = "http://httpbin.org/status/404" + url_404 = "http://mock/status/404" httpretty.register_uri(httpretty.GET, url_404, status=404) response = self.perform_request(url_404) @@ -152,30 +152,30 @@ def test_basic_not_found(self): self.assertIs(trace.status.StatusCode.ERROR, span.status.status_code) def test_basic_http_non_default_port(self): - url = "http://httpbin.org:666/status/200" + url = "http://mock:666/status/200" httpretty.register_uri(httpretty.GET, url, body="Hello!") response = self.perform_request(url) self.assert_success_span(response, url) def test_basic_http_absolute_url(self): - url = "http://httpbin.org:666/status/200" + url = "http://mock:666/status/200" httpretty.register_uri(httpretty.GET, url, body="Hello!") - pool = urllib3.HTTPConnectionPool("httpbin.org", port=666) + pool = urllib3.HTTPConnectionPool("mock", port=666) response = pool.request("GET", url) self.assert_success_span(response, url) def test_url_open_explicit_arg_parameters(self): - url = "http://httpbin.org:666/status/200" + url = "http://mock:666/status/200" httpretty.register_uri(httpretty.GET, url, body="Hello!") - pool = urllib3.HTTPConnectionPool("httpbin.org", port=666) + pool = urllib3.HTTPConnectionPool("mock", port=666) response = pool.urlopen(method="GET", url="/status/200") self.assert_success_span(response, url) def test_excluded_urls_explicit(self): - url_201 = "http://httpbin.org/status/201" + url_201 = "http://mock/status/201" httpretty.register_uri( httpretty.GET, url_201, @@ -301,7 +301,7 @@ def url_filter(url): self.assert_success_span(response, self.HTTP_URL) def test_credential_removal(self): - url = "http://username:password@httpbin.org/status/200" + url = "http://username:password@mock/status/200" response = self.perform_request(url) self.assert_success_span(response, self.HTTP_URL) @@ -339,7 +339,7 @@ def request_hook(span, request, headers, body): headers = {"header1": "value1", "header2": "value2"} body = "param1=1¶m2=2" - pool = urllib3.HTTPConnectionPool("httpbin.org") + pool = urllib3.HTTPConnectionPool("mock") response = pool.request( "POST", "/status/200", body=body, headers=headers ) @@ -366,7 +366,7 @@ def request_hook(span, request, headers, body): body = "param1=1¶m2=2" - pool = urllib3.HTTPConnectionPool("httpbin.org") + pool = urllib3.HTTPConnectionPool("mock") response = pool.urlopen("POST", "/status/200", body) self.assertEqual(b"Hello!", response.data) diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py index ca691ebd47..6bf61a9fd8 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py @@ -26,7 +26,7 @@ class TestURLLib3InstrumentorMetric(HttpTestBase, TestBase): - HTTP_URL = "http://httpbin.org/status/200" + HTTP_URL = "http://mock/status/200" def setUp(self): super().setUp() @@ -68,11 +68,11 @@ def test_basic_metrics(self): min_data_point=client_duration_estimated, attributes={ "http.flavor": "1.1", - "http.host": "httpbin.org", + "http.host": "mock", "http.method": "GET", "http.scheme": "http", "http.status_code": 200, - "net.peer.name": "httpbin.org", + "net.peer.name": "mock", "net.peer.port": 80, }, ) @@ -91,11 +91,11 @@ def test_basic_metrics(self): min_data_point=0, attributes={ "http.flavor": "1.1", - "http.host": "httpbin.org", + "http.host": "mock", "http.method": "GET", "http.scheme": "http", "http.status_code": 200, - "net.peer.name": "httpbin.org", + "net.peer.name": "mock", "net.peer.port": 80, }, ) @@ -116,11 +116,11 @@ def test_basic_metrics(self): min_data_point=expected_size, attributes={ "http.flavor": "1.1", - "http.host": "httpbin.org", + "http.host": "mock", "http.method": "GET", "http.scheme": "http", "http.status_code": 200, - "net.peer.name": "httpbin.org", + "net.peer.name": "mock", "net.peer.port": 80, }, ) @@ -144,11 +144,11 @@ def test_str_request_body_size_metrics(self): min_data_point=6, attributes={ "http.flavor": "1.1", - "http.host": "httpbin.org", + "http.host": "mock", "http.method": "POST", "http.scheme": "http", "http.status_code": 200, - "net.peer.name": "httpbin.org", + "net.peer.name": "mock", "net.peer.port": 80, }, ) @@ -172,11 +172,11 @@ def test_bytes_request_body_size_metrics(self): min_data_point=6, attributes={ "http.flavor": "1.1", - "http.host": "httpbin.org", + "http.host": "mock", "http.method": "POST", "http.scheme": "http", "http.status_code": 200, - "net.peer.name": "httpbin.org", + "net.peer.name": "mock", "net.peer.port": 80, }, ) @@ -201,11 +201,11 @@ def test_fields_request_body_size_metrics(self): min_data_point=expected_value, attributes={ "http.flavor": "1.1", - "http.host": "httpbin.org", + "http.host": "mock", "http.method": "POST", "http.scheme": "http", "http.status_code": 200, - "net.peer.name": "httpbin.org", + "net.peer.name": "mock", "net.peer.port": 80, }, ) @@ -229,11 +229,11 @@ def test_bytesio_request_body_size_metrics(self): min_data_point=6, attributes={ "http.flavor": "1.1", - "http.host": "httpbin.org", + "http.host": "mock", "http.method": "POST", "http.scheme": "http", "http.status_code": 200, - "net.peer.name": "httpbin.org", + "net.peer.name": "mock", "net.peer.port": 80, }, ) diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index ffe2982052..926124caf3 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -437,10 +437,10 @@ def test_response_attributes(self): self.span.set_attribute.assert_has_calls(expected, any_order=True) def test_credential_removal(self): - self.environ["HTTP_HOST"] = "username:password@httpbin.com" + self.environ["HTTP_HOST"] = "username:password@mock" self.environ["PATH_INFO"] = "/status/200" expected = { - SpanAttributes.HTTP_URL: "http://httpbin.com/status/200", + SpanAttributes.HTTP_URL: "http://mock/status/200", SpanAttributes.NET_HOST_PORT: 80, } self.assertGreaterEqual( From 4637912418a0d23b32b0f280f8c84009a4141504 Mon Sep 17 00:00:00 2001 From: Matthew Grossman Date: Tue, 13 Jun 2023 04:23:48 -0700 Subject: [PATCH 014/200] Use `request_ctx` to determine whether or not `_teardown_request` should end flask span (#1692) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Diego Hurtado --- CHANGELOG.md | 2 + dev-requirements.txt | 2 +- .../pyproject.toml | 3 +- .../instrumentation/flask/__init__.py | 36 ++++++++++---- .../tests/base_test.py | 18 ++++++- .../tests/test_copy_context.py | 48 +++++++++++++++++++ tox.ini | 14 +++--- 7 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-flask/tests/test_copy_context.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ee92bdab7a..ca0c1db9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1738](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1738)) - Fix `None does not implement middleware` error when there are no middlewares registered ([#1766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1766)) +- Fix Flask instrumentation to only close the span if it was created by the same request context. + ([#1692](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1692)) ## Version 1.17.0/0.38b0 (2023-03-22) diff --git a/dev-requirements.txt b/dev-requirements.txt index a8efb950dd..8973fb9476 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -14,7 +14,7 @@ bleach==4.1.0 # transient dependency for readme-renderer grpcio-tools==1.29.0 mypy-protobuf>=1.23 protobuf~=3.13 -markupsafe==2.0.1 +markupsafe>=2.0.1 codespell==2.1.0 requests==2.28.1 ruamel.yaml==0.17.21 diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 2e6b9d9646..885ca8965a 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ "opentelemetry-instrumentation-wsgi == 0.40b0.dev", "opentelemetry-semantic-conventions == 0.40b0.dev", "opentelemetry-util-http == 0.40b0.dev", + "packaging >= 21.0", ] [project.optional-dependencies] @@ -38,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-flask[instruments]", - "markupsafe==2.0.1", + "markupsafe==2.1.2", "opentelemetry-test-utils == 0.40b0.dev", ] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index fd3c40aab3..73c2f4fe2d 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -238,13 +238,14 @@ def response_hook(span: Span, status: str, response_headers: List): API --- """ +import weakref from logging import getLogger -from threading import get_ident from time import time_ns from timeit import default_timer from typing import Collection import flask +from packaging import version as package_version import opentelemetry.instrumentation.wsgi as otel_wsgi from opentelemetry import context, trace @@ -265,11 +266,21 @@ def response_hook(span: Span, status: str, response_headers: List): _ENVIRON_STARTTIME_KEY = "opentelemetry-flask.starttime_key" _ENVIRON_SPAN_KEY = "opentelemetry-flask.span_key" _ENVIRON_ACTIVATION_KEY = "opentelemetry-flask.activation_key" -_ENVIRON_THREAD_ID_KEY = "opentelemetry-flask.thread_id_key" +_ENVIRON_REQCTX_REF_KEY = "opentelemetry-flask.reqctx_ref_key" _ENVIRON_TOKEN = "opentelemetry-flask.token" _excluded_urls_from_env = get_excluded_urls("FLASK") +if package_version.parse(flask.__version__) >= package_version.parse("2.2.0"): + + def _request_ctx_ref() -> weakref.ReferenceType: + return weakref.ref(flask.globals.request_ctx._get_current_object()) + +else: + + def _request_ctx_ref() -> weakref.ReferenceType: + return weakref.ref(flask._request_ctx_stack.top) + def get_default_span_name(): try: @@ -399,7 +410,7 @@ def _before_request(): activation = trace.use_span(span, end_on_exit=True) activation.__enter__() # pylint: disable=E1101 flask_request_environ[_ENVIRON_ACTIVATION_KEY] = activation - flask_request_environ[_ENVIRON_THREAD_ID_KEY] = get_ident() + flask_request_environ[_ENVIRON_REQCTX_REF_KEY] = _request_ctx_ref() flask_request_environ[_ENVIRON_SPAN_KEY] = span flask_request_environ[_ENVIRON_TOKEN] = token @@ -439,17 +450,22 @@ def _teardown_request(exc): return activation = flask.request.environ.get(_ENVIRON_ACTIVATION_KEY) - thread_id = flask.request.environ.get(_ENVIRON_THREAD_ID_KEY) - if not activation or thread_id != get_ident(): + + original_reqctx_ref = flask.request.environ.get( + _ENVIRON_REQCTX_REF_KEY + ) + current_reqctx_ref = _request_ctx_ref() + if not activation or original_reqctx_ref != current_reqctx_ref: # This request didn't start a span, maybe because it was created in # a way that doesn't run `before_request`, like when it is created # with `app.test_request_context`. # - # Similarly, check the thread_id against the current thread to ensure - # tear down only happens on the original thread. This situation can - # arise if the original thread handling the request spawn children - # threads and then uses something like copy_current_request_context - # to copy the request context. + # Similarly, check that the request_ctx that created the span + # matches the current request_ctx, and only tear down if they match. + # This situation can arise if the original request_ctx handling + # the request calls functions that push new request_ctx's, + # like any decorated with `flask.copy_current_request_context`. + return if exc is None: activation.__exit__(None, None, None) diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py b/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py index a9cc4e55f7..6117521bb9 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py @@ -19,7 +19,7 @@ from werkzeug.test import Client from werkzeug.wrappers import Response -from opentelemetry import context +from opentelemetry import context, trace class InstrumentationTest: @@ -37,6 +37,21 @@ def _sqlcommenter_endpoint(): ) return sqlcommenter_flask_values + @staticmethod + def _copy_context_endpoint(): + @flask.copy_current_request_context + def _extract_header(): + return flask.request.headers["x-req"] + + # Despite `_extract_header` copying the request context, + # calling it shouldn't detach the parent Flask span's contextvar + request_header = _extract_header() + + return { + "span_name": trace.get_current_span().name, + "request_header": request_header, + } + @staticmethod def _multithreaded_endpoint(count): def do_random_stuff(): @@ -84,6 +99,7 @@ def excluded2_endpoint(): self.app.route("/hello/")(self._hello_endpoint) self.app.route("/sqlcommenter")(self._sqlcommenter_endpoint) self.app.route("/multithreaded")(self._multithreaded_endpoint) + self.app.route("/copy_context")(self._copy_context_endpoint) self.app.route("/excluded/")(self._hello_endpoint) self.app.route("/excluded")(excluded_endpoint) self.app.route("/excluded2")(excluded2_endpoint) diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_copy_context.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_copy_context.py new file mode 100644 index 0000000000..96268de5e7 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_copy_context.py @@ -0,0 +1,48 @@ +# 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. +import flask +from werkzeug.test import Client +from werkzeug.wrappers import Response + +from opentelemetry.instrumentation.flask import FlaskInstrumentor +from opentelemetry.test.wsgitestutil import WsgiTestBase + +from .base_test import InstrumentationTest + + +class TestCopyContext(InstrumentationTest, WsgiTestBase): + def setUp(self): + super().setUp() + FlaskInstrumentor().instrument() + self.app = flask.Flask(__name__) + self._common_initialization() + + def tearDown(self): + super().tearDown() + with self.disable_logging(): + FlaskInstrumentor().uninstrument() + + def test_copycontext(self): + """Test that instrumentation tear down does not blow up + when the request calls functions where the context has been + copied via `flask.copy_current_request_context` + """ + self.app = flask.Flask(__name__) + self.app.route("/copy_context")(self._copy_context_endpoint) + client = Client(self.app, Response) + resp = client.get("/copy_context", headers={"x-req": "a-header"}) + + self.assertEqual(200, resp.status_code) + self.assertEqual("/copy_context", resp.json["span_name"]) + self.assertEqual("a-header", resp.json["request_header"]) diff --git a/tox.ini b/tox.ini index be821e9adf..32656d7214 100644 --- a/tox.ini +++ b/tox.ini @@ -84,8 +84,8 @@ envlist = pypy3-test-instrumentation-fastapi ; opentelemetry-instrumentation-flask - py3{7,8,9,10,11}-test-instrumentation-flask - pypy3-test-instrumentation-flask + py3{7,8,9,10,11}-test-instrumentation-flask{213,220} + pypy3-test-instrumentation-flask{213,220} ; opentelemetry-instrumentation-urllib py3{7,8,9,10,11}-test-instrumentation-urllib @@ -258,6 +258,8 @@ deps = falcon1: falcon ==1.4.1 falcon2: falcon >=2.0.0,<3.0.0 falcon3: falcon >=3.0.0,<4.0.0 + flask213: Flask ==2.1.3 + flask220: Flask >=2.2.0 grpc: pytest-asyncio sqlalchemy11: sqlalchemy>=1.1,<1.2 sqlalchemy14: aiosqlite @@ -304,7 +306,7 @@ changedir = test-instrumentation-elasticsearch{2,5,6}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests test-instrumentation-falcon{1,2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests - test-instrumentation-flask: instrumentation/opentelemetry-instrumentation-flask/tests + test-instrumentation-flask{213,220}: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests test-instrumentation-urllib3: instrumentation/opentelemetry-instrumentation-urllib3/tests test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests @@ -365,8 +367,8 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon{1,2,3},flask,django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3,wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] - wsgi,falcon{1,2,3},flask,django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3,wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] + wsgi,falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] asgi,django{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -380,7 +382,7 @@ commands_pre = falcon{1,2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] - flask: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] + flask{213,220}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] urllib: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] From 818ef4322303dabc066a7f84e0f8879e5f558df9 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Tue, 13 Jun 2023 17:24:41 +0530 Subject: [PATCH 015/200] remove srikanthccv from maintainers (#1792) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Diego Hurtado From 37d85f07458900762f75ec6e4942c5dec2f93694 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Tue, 13 Jun 2023 15:37:55 +0300 Subject: [PATCH 016/200] Sanitize redis db_statement by default (#1776) Co-authored-by: Srikanth Chekuri Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 + .../instrumentation/redis/__init__.py | 35 +------------- .../redis/environment_variables.py | 17 ------- .../instrumentation/redis/util.py | 46 ++++++------------- .../tests/test_redis.py | 28 +---------- .../tests/redis/test_redis_functional.py | 42 +++++++---------- 6 files changed, 36 insertions(+), 134 deletions(-) delete mode 100644 instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/environment_variables.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ca0c1db9b9..000216e2a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fix redis db.statements to be sanitized by default + ([#1778](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1778)) - Fix elasticsearch db.statement attribute to be sanitized by default ([#1758](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1758)) - Fix `AttributeError` when AWS Lambda handler receives a list event diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py index c1068bda27..188840c7b8 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py @@ -64,8 +64,6 @@ async def redis_get(): response_hook (Callable) - a function with extra user-defined logic to be performed after performing the request this function signature is: def response_hook(span: Span, instance: redis.connection.Connection, response) -> None -sanitize_query (Boolean) - default False, enable the Redis query sanitization - for example: .. code: python @@ -88,27 +86,11 @@ def response_hook(span, instance, response): client = redis.StrictRedis(host="localhost", port=6379) client.get("my-key") -Configuration -------------- - -Query sanitization -****************** -To enable query sanitization with an environment variable, set -``OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS`` to "true". - -For example, - -:: - - export OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS="true" - -will result in traced queries like "SET ? ?". API --- """ import typing -from os import environ from typing import Any, Collection import redis @@ -116,9 +98,6 @@ def response_hook(span, instance, response): from opentelemetry import trace from opentelemetry.instrumentation.instrumentor import BaseInstrumentor -from opentelemetry.instrumentation.redis.environment_variables import ( - OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS, -) from opentelemetry.instrumentation.redis.package import _instruments from opentelemetry.instrumentation.redis.util import ( _extract_conn_attributes, @@ -161,10 +140,9 @@ def _instrument( tracer, request_hook: _RequestHookT = None, response_hook: _ResponseHookT = None, - sanitize_query: bool = False, ): def _traced_execute_command(func, instance, args, kwargs): - query = _format_command_args(args, sanitize_query) + query = _format_command_args(args) if len(args) > 0 and args[0]: name = args[0] @@ -194,7 +172,7 @@ def _traced_execute_pipeline(func, instance, args, kwargs): cmds = [ _format_command_args( - c.args if hasattr(c, "args") else c[0], sanitize_query + c.args if hasattr(c, "args") else c[0], ) for c in command_stack ] @@ -307,15 +285,6 @@ def _instrument(self, **kwargs): tracer, request_hook=kwargs.get("request_hook"), response_hook=kwargs.get("response_hook"), - sanitize_query=kwargs.get( - "sanitize_query", - environ.get( - OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS, "false" - ) - .lower() - .strip() - == "true", - ), ) def _uninstrument(self, **kwargs): diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/environment_variables.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/environment_variables.py deleted file mode 100644 index 750b97445e..0000000000 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/environment_variables.py +++ /dev/null @@ -1,17 +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. - -OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS = ( - "OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS" -) diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py index 1eadaba718..b24f9b2655 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py @@ -48,41 +48,23 @@ def _extract_conn_attributes(conn_kwargs): return attributes -def _format_command_args(args, sanitize_query): +def _format_command_args(args): """Format and sanitize command arguments, and trim them as needed""" cmd_max_len = 1000 value_too_long_mark = "..." - if sanitize_query: - # Sanitized query format: "COMMAND ? ?" - args_length = len(args) - if args_length > 0: - out = [str(args[0])] + ["?"] * (args_length - 1) - out_str = " ".join(out) - if len(out_str) > cmd_max_len: - out_str = ( - out_str[: cmd_max_len - len(value_too_long_mark)] - + value_too_long_mark - ) - else: - out_str = "" - return out_str + # Sanitized query format: "COMMAND ? ?" + args_length = len(args) + if args_length > 0: + out = [str(args[0])] + ["?"] * (args_length - 1) + out_str = " ".join(out) - value_max_len = 100 - length = 0 - out = [] - for arg in args: - cmd = str(arg) + if len(out_str) > cmd_max_len: + out_str = ( + out_str[: cmd_max_len - len(value_too_long_mark)] + + value_too_long_mark + ) + else: + out_str = "" - if len(cmd) > value_max_len: - cmd = cmd[:value_max_len] + value_too_long_mark - - if length + len(cmd) > cmd_max_len: - prefix = cmd[: cmd_max_len - length] - out.append(f"{prefix}{value_too_long_mark}") - break - - out.append(cmd) - length += len(cmd) - - return " ".join(out) + return out_str diff --git a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py index 56a0df6a0a..cc6e7de75a 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py +++ b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py @@ -168,22 +168,11 @@ def test_query_sanitizer_enabled(self): span = spans[0] self.assertEqual(span.attributes.get("db.statement"), "SET ? ?") - def test_query_sanitizer_enabled_env(self): + def test_query_sanitizer(self): redis_client = redis.Redis() connection = redis.connection.Connection() redis_client.connection = connection - RedisInstrumentor().uninstrument() - - env_patch = mock.patch.dict( - "os.environ", - {"OTEL_PYTHON_INSTRUMENTATION_SANITIZE_REDIS": "true"}, - ) - env_patch.start() - RedisInstrumentor().instrument( - tracer_provider=self.tracer_provider, - ) - with mock.patch.object(redis_client, "connection"): redis_client.set("key", "value") @@ -192,21 +181,6 @@ def test_query_sanitizer_enabled_env(self): span = spans[0] self.assertEqual(span.attributes.get("db.statement"), "SET ? ?") - env_patch.stop() - - def test_query_sanitizer_disabled(self): - redis_client = redis.Redis() - connection = redis.connection.Connection() - redis_client.connection = connection - - with mock.patch.object(redis_client, "connection"): - redis_client.set("key", "value") - - spans = self.memory_exporter.get_finished_spans() - self.assertEqual(len(spans), 1) - - span = spans[0] - self.assertEqual(span.attributes.get("db.statement"), "SET key value") def test_no_op_tracer_provider(self): RedisInstrumentor().uninstrument() diff --git a/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py b/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py index 675a37fa9f..dc9cf8b1dc 100644 --- a/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py +++ b/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py @@ -47,9 +47,7 @@ def _check_span(self, span, name): def test_long_command_sanitized(self): RedisInstrumentor().uninstrument() - RedisInstrumentor().instrument( - tracer_provider=self.tracer_provider, sanitize_query=True - ) + RedisInstrumentor().instrument(tracer_provider=self.tracer_provider) self.redis_client.mget(*range(2000)) @@ -75,7 +73,7 @@ def test_long_command(self): self._check_span(span, "MGET") self.assertTrue( span.attributes.get(SpanAttributes.DB_STATEMENT).startswith( - "MGET 0 1 2 3" + "MGET ? ? ? ?" ) ) self.assertTrue( @@ -84,9 +82,7 @@ def test_long_command(self): def test_basics_sanitized(self): RedisInstrumentor().uninstrument() - RedisInstrumentor().instrument( - tracer_provider=self.tracer_provider, sanitize_query=True - ) + RedisInstrumentor().instrument(tracer_provider=self.tracer_provider) self.assertIsNone(self.redis_client.get("cheese")) spans = self.memory_exporter.get_finished_spans() @@ -105,15 +101,13 @@ def test_basics(self): span = spans[0] self._check_span(span, "GET") self.assertEqual( - span.attributes.get(SpanAttributes.DB_STATEMENT), "GET cheese" + span.attributes.get(SpanAttributes.DB_STATEMENT), "GET ?" ) self.assertEqual(span.attributes.get("db.redis.args_length"), 2) def test_pipeline_traced_sanitized(self): RedisInstrumentor().uninstrument() - RedisInstrumentor().instrument( - tracer_provider=self.tracer_provider, sanitize_query=True - ) + RedisInstrumentor().instrument(tracer_provider=self.tracer_provider) with self.redis_client.pipeline(transaction=False) as pipeline: pipeline.set("blah", 32) @@ -144,15 +138,13 @@ def test_pipeline_traced(self): self._check_span(span, "SET RPUSH HGETALL") self.assertEqual( span.attributes.get(SpanAttributes.DB_STATEMENT), - "SET blah 32\nRPUSH foo éé\nHGETALL xxx", + "SET ? ?\nRPUSH ? ?\nHGETALL ?", ) self.assertEqual(span.attributes.get("db.redis.pipeline_length"), 3) def test_pipeline_immediate_sanitized(self): RedisInstrumentor().uninstrument() - RedisInstrumentor().instrument( - tracer_provider=self.tracer_provider, sanitize_query=True - ) + RedisInstrumentor().instrument(tracer_provider=self.tracer_provider) with self.redis_client.pipeline() as pipeline: pipeline.set("a", 1) @@ -182,7 +174,7 @@ def test_pipeline_immediate(self): span = spans[0] self._check_span(span, "SET") self.assertEqual( - span.attributes.get(SpanAttributes.DB_STATEMENT), "SET b 2" + span.attributes.get(SpanAttributes.DB_STATEMENT), "SET ? ?" ) def test_parent(self): @@ -230,7 +222,7 @@ def test_basics(self): span = spans[0] self._check_span(span, "GET") self.assertEqual( - span.attributes.get(SpanAttributes.DB_STATEMENT), "GET cheese" + span.attributes.get(SpanAttributes.DB_STATEMENT), "GET ?" ) self.assertEqual(span.attributes.get("db.redis.args_length"), 2) @@ -247,7 +239,7 @@ def test_pipeline_traced(self): self._check_span(span, "SET RPUSH HGETALL") self.assertEqual( span.attributes.get(SpanAttributes.DB_STATEMENT), - "SET blah 32\nRPUSH foo éé\nHGETALL xxx", + "SET ? ?\nRPUSH ? ?\nHGETALL ?", ) self.assertEqual(span.attributes.get("db.redis.pipeline_length"), 3) @@ -308,7 +300,7 @@ def test_long_command(self): self._check_span(span, "MGET") self.assertTrue( span.attributes.get(SpanAttributes.DB_STATEMENT).startswith( - "MGET 0 1 2 3" + "MGET ? ? ? ?" ) ) self.assertTrue( @@ -322,7 +314,7 @@ def test_basics(self): span = spans[0] self._check_span(span, "GET") self.assertEqual( - span.attributes.get(SpanAttributes.DB_STATEMENT), "GET cheese" + span.attributes.get(SpanAttributes.DB_STATEMENT), "GET ?" ) self.assertEqual(span.attributes.get("db.redis.args_length"), 2) @@ -344,7 +336,7 @@ async def pipeline_simple(): self._check_span(span, "SET RPUSH HGETALL") self.assertEqual( span.attributes.get(SpanAttributes.DB_STATEMENT), - "SET blah 32\nRPUSH foo éé\nHGETALL xxx", + "SET ? ?\nRPUSH ? ?\nHGETALL ?", ) self.assertEqual(span.attributes.get("db.redis.pipeline_length"), 3) @@ -364,7 +356,7 @@ async def pipeline_immediate(): span = spans[0] self._check_span(span, "SET") self.assertEqual( - span.attributes.get(SpanAttributes.DB_STATEMENT), "SET b 2" + span.attributes.get(SpanAttributes.DB_STATEMENT), "SET ? ?" ) def test_parent(self): @@ -412,7 +404,7 @@ def test_basics(self): span = spans[0] self._check_span(span, "GET") self.assertEqual( - span.attributes.get(SpanAttributes.DB_STATEMENT), "GET cheese" + span.attributes.get(SpanAttributes.DB_STATEMENT), "GET ?" ) self.assertEqual(span.attributes.get("db.redis.args_length"), 2) @@ -434,7 +426,7 @@ async def pipeline_simple(): self._check_span(span, "SET RPUSH HGETALL") self.assertEqual( span.attributes.get(SpanAttributes.DB_STATEMENT), - "SET blah 32\nRPUSH foo éé\nHGETALL xxx", + "SET ? ?\nRPUSH ? ?\nHGETALL ?", ) self.assertEqual(span.attributes.get("db.redis.pipeline_length"), 3) @@ -488,5 +480,5 @@ def test_get(self): span = spans[0] self._check_span(span, "GET") self.assertEqual( - span.attributes.get(SpanAttributes.DB_STATEMENT), "GET foo" + span.attributes.get(SpanAttributes.DB_STATEMENT), "GET ?" ) From a5ed4da478c4360fd6e24893f7574b150431b7ee Mon Sep 17 00:00:00 2001 From: Phillip Verheyden Date: Tue, 13 Jun 2023 08:07:28 -0500 Subject: [PATCH 017/200] Relax httpx version to allow >= 0.18.0 (#1748) --- CHANGELOG.md | 2 ++ .../opentelemetry-instrumentation-httpx/pyproject.toml | 2 +- .../tests/test_httpx_integration.py | 4 ++-- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- tox.ini | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 000216e2a1..777b5a3530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748)) + ## Version 1.18.0/0.39b0 (2023-05-10) - `opentelemetry-instrumentation-system-metrics` Add `process.` prefix to `runtime.memory`, `runtime.cpu.time`, and `runtime.gc_count`. Change `runtime.memory` from count to UpDownCounter. ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735)) diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index 229fca1611..d079de20b3 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "httpx >= 0.18.0, <= 0.23.0", + "httpx >= 0.18.0", ] test = [ "opentelemetry-instrumentation-httpx[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index c0d3705dca..86c9a56ab2 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -59,7 +59,7 @@ def _async_call(coro: typing.Coroutine) -> asyncio.Task: def _response_hook(span, request: "RequestInfo", response: "ResponseInfo"): span.set_attribute( HTTP_RESPONSE_BODY, - response[2].read(), + b"".join(response[2]), ) @@ -68,7 +68,7 @@ async def _async_response_hook( ): span.set_attribute( HTTP_RESPONSE_BODY, - await response[2].aread(), + b"".join([part async for part in response[2]]), ) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 8200196ca8..f705324289 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -81,7 +81,7 @@ "instrumentation": "opentelemetry-instrumentation-grpc==0.40b0.dev", }, "httpx": { - "library": "httpx >= 0.18.0, <= 0.23.0", + "library": "httpx >= 0.18.0", "instrumentation": "opentelemetry-instrumentation-httpx==0.40b0.dev", }, "jinja2": { diff --git a/tox.ini b/tox.ini index 32656d7214..2313eab1d2 100644 --- a/tox.ini +++ b/tox.ini @@ -277,7 +277,7 @@ deps = httpx18: httpx>=0.18.0,<0.19.0 httpx18: respx~=0.17.0 httpx21: httpx>=0.19.0 - httpx21: respx~=0.19.0 + httpx21: respx~=0.20.1 ; FIXME: add coverage testing ; FIXME: add mypy testing From 743ac64661897087f2dca7f696e481648eb4d0fe Mon Sep 17 00:00:00 2001 From: Maciej Nachtygal <82878433+macieyng@users.noreply.github.com> Date: Fri, 16 Jun 2023 00:21:05 +0200 Subject: [PATCH 018/200] Issue #1757 - Update HTTP server/client instrumentation span names (#1759) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Srikanth Chekuri --- CHANGELOG.md | 4 ++ .../aiohttp_client/__init__.py | 2 +- .../tests/test_aiohttp_client_integration.py | 13 ++++--- .../instrumentation/asgi/__init__.py | 19 ++++++---- .../tests/test_asgi_middleware.py | 14 +++---- .../django/middleware/otel_middleware.py | 12 ++---- .../tests/test_middleware.py | 26 ++++--------- .../tests/test_middleware_asgi.py | 14 +++---- .../tests/test_falcon.py | 2 +- .../instrumentation/fastapi/__init__.py | 37 +++++++++++++++---- .../tests/test_fastapi_instrumentation.py | 6 +-- .../tests/test_programmatic.py | 2 +- .../instrumentation/httpx/__init__.py | 2 +- .../tests/test_httpx_integration.py | 8 ++-- .../tests/test_programmatic.py | 2 +- .../instrumentation/requests/__init__.py | 12 +++++- .../tests/test_requests_integration.py | 4 +- .../tests/test_requests_ip_support.py | 2 +- .../instrumentation/starlette/__init__.py | 37 +++++++++++++++---- .../tests/test_starlette_instrumentation.py | 4 +- .../instrumentation/tornado/__init__.py | 23 +++++++++--- .../tests/test_instrumentation.py | 23 ++++++------ .../instrumentation/urllib/__init__.py | 2 +- .../tests/test_urllib_integration.py | 4 +- .../instrumentation/urllib3/__init__.py | 2 +- .../tests/test_urllib3_integration.py | 2 +- .../tests/test_urllib3_ip_support.py | 2 +- .../instrumentation/wsgi/__init__.py | 17 ++++++++- .../tests/test_wsgi_middleware.py | 13 ++++--- .../opentelemetry/instrumentation/utils.py | 2 +- 30 files changed, 194 insertions(+), 118 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 777b5a3530..9959a49d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix Flask instrumentation to only close the span if it was created by the same request context. ([#1692](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1692)) +### Changed +- Update HTTP server/client instrumentation span names to comply with spec + ([#1759](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1759) + ## Version 1.17.0/0.38b0 (2023-03-22) ### Added diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py index 101e67f2ad..65e1601f34 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py @@ -179,7 +179,7 @@ async def on_request_start( return http_method = params.method.upper() - request_span_name = f"HTTP {http_method}" + request_span_name = f"{http_method}" request_url = ( remove_url_credentials(trace_config_ctx.url_filter(params.url)) if callable(trace_config_ctx.url_filter) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py index 7c3d7b634d..6af9d41900 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py @@ -119,7 +119,7 @@ def test_status_codes(self): self.assert_spans( [ ( - "HTTP GET", + "GET", (span_status, None), { SpanAttributes.HTTP_METHOD: "GET", @@ -213,7 +213,7 @@ def strip_query_params(url: yarl.URL) -> str: self.assert_spans( [ ( - "HTTP GET", + "GET", (StatusCode.UNSET, None), { SpanAttributes.HTTP_METHOD: "GET", @@ -247,7 +247,7 @@ async def do_request(url): self.assert_spans( [ ( - "HTTP GET", + "GET", (expected_status, None), { SpanAttributes.HTTP_METHOD: "GET", @@ -274,7 +274,7 @@ async def request_handler(request): self.assert_spans( [ ( - "HTTP GET", + "GET", (StatusCode.ERROR, None), { SpanAttributes.HTTP_METHOD: "GET", @@ -301,7 +301,7 @@ async def request_handler(request): self.assert_spans( [ ( - "HTTP GET", + "GET", (StatusCode.ERROR, None), { SpanAttributes.HTTP_METHOD: "GET", @@ -338,7 +338,7 @@ async def do_request(url): self.assert_spans( [ ( - "HTTP GET", + "GET", (StatusCode.UNSET, None), { SpanAttributes.HTTP_METHOD: "GET", @@ -391,6 +391,7 @@ def test_instrument(self): self.get_default_request(), self.URL, self.default_handler ) span = self.assert_spans(1) + self.assertEqual("GET", span.name) self.assertEqual("GET", span.attributes[SpanAttributes.HTTP_METHOD]) self.assertEqual( f"http://{host}:{port}/test-path", diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index 6fc88d3eeb..010c6accde 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -415,18 +415,23 @@ def set_status_code(span, status_code): def get_default_span_details(scope: dict) -> Tuple[str, dict]: - """Default implementation for get_default_span_details + """ + Default span name is the HTTP method and URL path, or just the method. + https://github.com/open-telemetry/opentelemetry-specification/pull/3165 + https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name + Args: scope: the ASGI scope dictionary Returns: a tuple of the span name, and any attributes to attach to the span. """ - span_name = ( - scope.get("path", "").strip() - or f"HTTP {scope.get('method', '').strip()}" - ) - - return span_name, {} + path = scope.get("path", "").strip() + method = scope.get("method", "").strip() + if method and path: # http + return f"{method} {path}", {} + if path: # websocket + return path, {} + return method, {} # http with no path def _collect_target_attribute( diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 7cbae79c6d..f9a5731fd3 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -142,12 +142,12 @@ def validate_outputs(self, outputs, error=None, modifiers=None): self.assertEqual(len(span_list), 4) expected = [ { - "name": "/ http receive", + "name": "GET / http receive", "kind": trace_api.SpanKind.INTERNAL, "attributes": {"type": "http.request"}, }, { - "name": "/ http send", + "name": "GET / http send", "kind": trace_api.SpanKind.INTERNAL, "attributes": { SpanAttributes.HTTP_STATUS_CODE: 200, @@ -155,12 +155,12 @@ def validate_outputs(self, outputs, error=None, modifiers=None): }, }, { - "name": "/ http send", + "name": "GET / http send", "kind": trace_api.SpanKind.INTERNAL, "attributes": {"type": "http.response.body"}, }, { - "name": "/", + "name": "GET /", "kind": trace_api.SpanKind.SERVER, "attributes": { SpanAttributes.HTTP_METHOD: "GET", @@ -231,7 +231,7 @@ def update_expected_span_name(expected): entry["name"] = span_name else: entry["name"] = " ".join( - [span_name] + entry["name"].split(" ")[1:] + [span_name] + entry["name"].split(" ")[2:] ) return expected @@ -493,9 +493,9 @@ def update_expected_hook_results(expected): for entry in expected: if entry["kind"] == trace_api.SpanKind.SERVER: entry["name"] = "name from server hook" - elif entry["name"] == "/ http receive": + elif entry["name"] == "GET / http receive": entry["name"] = "name from client request hook" - elif entry["name"] == "/ http send": + elif entry["name"] == "GET / http send": entry["attributes"].update({"attr-from-hook": "value"}) return expected diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py index 1baa05eca9..02313a48ee 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py @@ -173,18 +173,12 @@ def _get_span_name(request): match = resolve(request.path) if hasattr(match, "route"): - return match.route + return f"{request.method} {match.route}" - # Instead of using `view_name`, better to use `_func_name` as some applications can use similar - # view names in different modules - if hasattr(match, "_func_name"): - return match._func_name # pylint: disable=protected-access - - # Fallback for safety as `_func_name` private field - return match.view_name + return request.method except Resolver404: - return f"HTTP {request.method}" + return request.method # pylint: disable=too-many-locals def process_request(self, request): diff --git a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py index e235c8840e..1f28819df0 100644 --- a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py @@ -150,9 +150,9 @@ def test_templated_route_get(self): self.assertEqual( span.name, - "^route/(?P[0-9]{4})/template/$" + "GET ^route/(?P[0-9]{4})/template/$" if DJANGO_2_2 - else "tests.views.traced_template", + else "GET", ) self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.UNSET) @@ -177,9 +177,7 @@ def test_traced_get(self): span = spans[0] - self.assertEqual( - span.name, "^traced/" if DJANGO_2_2 else "tests.views.traced" - ) + self.assertEqual(span.name, "GET ^traced/" if DJANGO_2_2 else "GET") self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertEqual(span.attributes[SpanAttributes.HTTP_METHOD], "GET") @@ -215,9 +213,7 @@ def test_traced_post(self): span = spans[0] - self.assertEqual( - span.name, "^traced/" if DJANGO_2_2 else "tests.views.traced" - ) + self.assertEqual(span.name, "POST ^traced/" if DJANGO_2_2 else "POST") self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertEqual(span.attributes[SpanAttributes.HTTP_METHOD], "POST") @@ -241,9 +237,7 @@ def test_error(self): span = spans[0] - self.assertEqual( - span.name, "^error/" if DJANGO_2_2 else "tests.views.error" - ) + self.assertEqual(span.name, "GET ^error/" if DJANGO_2_2 else "GET") self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.ERROR) self.assertEqual(span.attributes[SpanAttributes.HTTP_METHOD], "GET") @@ -307,9 +301,7 @@ def test_span_name(self): span = span_list[0] self.assertEqual( span.name, - "^span_name/([0-9]{4})/$" - if DJANGO_2_2 - else "tests.views.route_span_name", + "GET ^span_name/([0-9]{4})/$" if DJANGO_2_2 else "GET", ) def test_span_name_for_query_string(self): @@ -323,9 +315,7 @@ def test_span_name_for_query_string(self): span = span_list[0] self.assertEqual( span.name, - "^span_name/([0-9]{4})/$" - if DJANGO_2_2 - else "tests.views.route_span_name", + "GET ^span_name/([0-9]{4})/$" if DJANGO_2_2 else "GET", ) def test_span_name_404(self): @@ -334,7 +324,7 @@ def test_span_name_404(self): self.assertEqual(len(span_list), 1) span = span_list[0] - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") def test_traced_request_attrs(self): Client().get("/span_name/1234/", CONTENT_TYPE="test/ct") diff --git a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware_asgi.py b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware_asgi.py index a78501bcb8..0e2472d15e 100644 --- a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware_asgi.py +++ b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware_asgi.py @@ -137,7 +137,7 @@ async def test_templated_route_get(self): span = spans[0] - self.assertEqual(span.name, "^route/(?P[0-9]{4})/template/$") + self.assertEqual(span.name, "GET ^route/(?P[0-9]{4})/template/$") self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertEqual(span.attributes[SpanAttributes.HTTP_METHOD], "GET") @@ -160,7 +160,7 @@ async def test_traced_get(self): span = spans[0] - self.assertEqual(span.name, "^traced/") + self.assertEqual(span.name, "GET ^traced/") self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertEqual(span.attributes[SpanAttributes.HTTP_METHOD], "GET") @@ -195,7 +195,7 @@ async def test_traced_post(self): span = spans[0] - self.assertEqual(span.name, "^traced/") + self.assertEqual(span.name, "POST ^traced/") self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertEqual(span.attributes[SpanAttributes.HTTP_METHOD], "POST") @@ -218,7 +218,7 @@ async def test_error(self): span = spans[0] - self.assertEqual(span.name, "^error/") + self.assertEqual(span.name, "GET ^error/") self.assertEqual(span.kind, SpanKind.SERVER) self.assertEqual(span.status.status_code, StatusCode.ERROR) self.assertEqual(span.attributes[SpanAttributes.HTTP_METHOD], "GET") @@ -264,7 +264,7 @@ async def test_span_name(self): self.assertEqual(len(span_list), 1) span = span_list[0] - self.assertEqual(span.name, "^span_name/([0-9]{4})/$") + self.assertEqual(span.name, "GET ^span_name/([0-9]{4})/$") async def test_span_name_for_query_string(self): """ @@ -275,7 +275,7 @@ async def test_span_name_for_query_string(self): self.assertEqual(len(span_list), 1) span = span_list[0] - self.assertEqual(span.name, "^span_name/([0-9]{4})/$") + self.assertEqual(span.name, "GET ^span_name/([0-9]{4})/$") async def test_span_name_404(self): await self.async_client.get("/span_name/1234567890/") @@ -283,7 +283,7 @@ async def test_span_name_404(self): self.assertEqual(len(span_list), 1) span = span_list[0] - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") async def test_traced_request_attrs(self): await self.async_client.get("/span_name/1234/", CONTENT_TYPE="test/ct") diff --git a/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py b/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py index aeba57a9b5..cf61a9fd3c 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py @@ -145,7 +145,7 @@ def test_404(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 1) span = spans[0] - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET /does-not-exist") self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertSpanHasAttributes( span, diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py index 934c11e110..e99c8be6ed 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py @@ -227,7 +227,7 @@ def instrument_app( app.add_middleware( OpenTelemetryMiddleware, excluded_urls=excluded_urls, - default_span_details=_get_route_details, + default_span_details=_get_default_span_details, server_request_hook=server_request_hook, client_request_hook=client_request_hook, client_response_hook=client_response_hook, @@ -300,7 +300,7 @@ def __init__(self, *args, **kwargs): self.add_middleware( OpenTelemetryMiddleware, excluded_urls=_InstrumentedFastAPI._excluded_urls, - default_span_details=_get_route_details, + default_span_details=_get_default_span_details, server_request_hook=_InstrumentedFastAPI._server_request_hook, client_request_hook=_InstrumentedFastAPI._client_request_hook, client_response_hook=_InstrumentedFastAPI._client_response_hook, @@ -316,15 +316,21 @@ def __del__(self): def _get_route_details(scope): - """Callback to retrieve the fastapi route being served. + """ + Function to retrieve Starlette route from scope. TODO: there is currently no way to retrieve http.route from a starlette application from scope. - See: https://github.com/encode/starlette/pull/804 + + Args: + scope: A Starlette scope + Returns: + A string containing the route or None """ app = scope["app"] route = None + for starlette_route in app.routes: match, _ = starlette_route.matches(scope) if match == Match.FULL: @@ -332,10 +338,27 @@ def _get_route_details(scope): break if match == Match.PARTIAL: route = starlette_route.path - # method only exists for http, if websocket - # leave it blank. - span_name = route or scope.get("method", "") + return route + + +def _get_default_span_details(scope): + """ + Callback to retrieve span name and attributes from scope. + + Args: + scope: A Starlette scope + Returns: + A tuple of span name and attributes + """ + route = _get_route_details(scope) + method = scope.get("method", "") attributes = {} if route: attributes[SpanAttributes.HTTP_ROUTE] = route + if method and route: # http + span_name = f"{method} {route}" + elif route: # websocket + span_name = route + else: # fallback + span_name = method return span_name, attributes diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index 261b2e025f..9420ba2c0e 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -106,7 +106,7 @@ def test_instrument_app_with_instrument(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 3) for span in spans: - self.assertIn("/foobar", span.name) + self.assertIn("GET /foobar", span.name) def test_uninstrument_app(self): self._client.get("/foobar") @@ -138,7 +138,7 @@ def test_basic_fastapi_call(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 3) for span in spans: - self.assertIn("/foobar", span.name) + self.assertIn("GET /foobar", span.name) def test_fastapi_route_attribute_added(self): """Ensure that fastapi routes are used as the span name.""" @@ -146,7 +146,7 @@ def test_fastapi_route_attribute_added(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 3) for span in spans: - self.assertIn("/user/{username}", span.name) + self.assertIn("GET /user/{username}", span.name) self.assertEqual( spans[-1].attributes[SpanAttributes.HTTP_ROUTE], "/user/{username}" ) diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py index 8c231b1d08..6393b927b8 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py @@ -214,7 +214,7 @@ def test_404(self): resp.close() span_list = self.memory_exporter.get_finished_spans() self.assertEqual(len(span_list), 1) - self.assertEqual(span_list[0].name, "HTTP POST") + self.assertEqual(span_list[0].name, "POST /bye") self.assertEqual(span_list[0].kind, trace.SpanKind.SERVER) self.assertEqual(span_list[0].attributes, expected_attrs) diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py index 736e6c3d32..bb40adbc26 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -209,7 +209,7 @@ class ResponseInfo(typing.NamedTuple): def _get_default_span_name(method: str) -> str: - return f"HTTP {method.strip()}" + return method.strip() def _apply_status_code(span: Span, status_code: int) -> None: diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index 86c9a56ab2..daddaad306 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -142,7 +142,7 @@ def test_basic(self): span = self.assert_span() self.assertIs(span.kind, trace.SpanKind.CLIENT) - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") self.assertEqual( span.attributes, @@ -258,7 +258,7 @@ def test_invalid_url(self): span = self.assert_span() - self.assertEqual(span.name, "HTTP POST") + self.assertEqual(span.name, "POST") self.assertEqual( span.attributes[SpanAttributes.HTTP_METHOD], "POST" ) @@ -350,7 +350,7 @@ def test_request_hook_no_span_change(self): self.assertEqual(result.text, "Hello!") span = self.assert_span() - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") def test_not_recording(self): with mock.patch("opentelemetry.trace.INVALID_SPAN") as mock_span: @@ -444,7 +444,7 @@ def test_request_hook_no_span_update(self): self.assertEqual(result.text, "Hello!") span = self.assert_span() - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") HTTPXClientInstrumentor().uninstrument() def test_not_recording(self): diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_programmatic.py index d3a4fa91db..478eab1937 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/tests/test_programmatic.py @@ -145,7 +145,7 @@ def test_404(self): resp.close() span_list = self.memory_exporter.get_finished_spans() self.assertEqual(len(span_list), 1) - self.assertEqual(span_list[0].name, "HTTP POST") + self.assertEqual(span_list[0].name, "POST /bye") self.assertEqual(span_list[0].kind, trace.SpanKind.SERVER) self.assertEqual(span_list[0].attributes, expected_attrs) diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py index e5bb24223c..c3dabf05a5 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -245,8 +245,16 @@ def _uninstrument_from(instr_root, restore_as_bound_func=False): def get_default_span_name(method): - """Default implementation for name_callback, returns HTTP {method_name}.""" - return f"HTTP {method.strip()}" + """ + Default implementation for name_callback, returns HTTP {method_name}. + https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name + + Args: + method: string representing HTTP method + Returns: + span name + """ + return method.strip() class RequestsInstrumentor(BaseInstrumentor): diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py index 6e6a68cb8f..3bd76a6995 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py @@ -116,7 +116,7 @@ def test_basic(self): span = self.assert_span() self.assertIs(span.kind, trace.SpanKind.CLIENT) - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") self.assertEqual( span.attributes, @@ -191,7 +191,7 @@ def name_callback(method, url): self.assertEqual(result.text, "Hello!") span = self.assert_span() - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") def test_not_foundbasic(self): url_404 = "http://mock/status/404" diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py index 593ed92fe9..cf2e7fb4dd 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py @@ -71,7 +71,7 @@ def assert_success_span(self, response: requests.Response): span = self.assert_span() self.assertIs(trace.SpanKind.CLIENT, span.kind) - self.assertEqual("HTTP GET", span.name) + self.assertEqual("GET", span.name) attributes = { "http.status_code": 200, diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py index 30f24cc65c..2d123aa70e 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py @@ -212,7 +212,7 @@ def instrument_app( app.add_middleware( OpenTelemetryMiddleware, excluded_urls=_excluded_urls, - default_span_details=_get_route_details, + default_span_details=_get_default_span_details, server_request_hook=server_request_hook, client_request_hook=client_request_hook, client_response_hook=client_response_hook, @@ -278,7 +278,7 @@ def __init__(self, *args, **kwargs): self.add_middleware( OpenTelemetryMiddleware, excluded_urls=_excluded_urls, - default_span_details=_get_route_details, + default_span_details=_get_default_span_details, server_request_hook=_InstrumentedStarlette._server_request_hook, client_request_hook=_InstrumentedStarlette._client_request_hook, client_response_hook=_InstrumentedStarlette._client_response_hook, @@ -294,15 +294,21 @@ def __del__(self): def _get_route_details(scope): - """Callback to retrieve the starlette route being served. + """ + Function to retrieve Starlette route from scope. TODO: there is currently no way to retrieve http.route from a starlette application from scope. - See: https://github.com/encode/starlette/pull/804 + + Args: + scope: A Starlette scope + Returns: + A string containing the route or None """ app = scope["app"] route = None + for starlette_route in app.routes: match, _ = starlette_route.matches(scope) if match == Match.FULL: @@ -310,10 +316,27 @@ def _get_route_details(scope): break if match == Match.PARTIAL: route = starlette_route.path - # method only exists for http, if websocket - # leave it blank. - span_name = route or scope.get("method", "") + return route + + +def _get_default_span_details(scope): + """ + Callback to retrieve span name and attributes from scope. + + Args: + scope: A Starlette scope + Returns: + A tuple of span name and attributes + """ + route = _get_route_details(scope) + method = scope.get("method", "") attributes = {} if route: attributes[SpanAttributes.HTTP_ROUTE] = route + if method and route: # http + span_name = f"{method} {route}" + elif route: # websocket + span_name = route + else: # fallback + span_name = method return span_name, attributes diff --git a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py index 9c658e0092..1f4570d293 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py @@ -93,7 +93,7 @@ def test_basic_starlette_call(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 3) for span in spans: - self.assertIn("/foobar", span.name) + self.assertIn("GET /foobar", span.name) def test_starlette_route_attribute_added(self): """Ensure that starlette routes are used as the span name.""" @@ -101,7 +101,7 @@ def test_starlette_route_attribute_added(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 3) for span in spans: - self.assertIn("/user/{username}", span.name) + self.assertIn("GET /user/{username}", span.name) self.assertEqual( spans[-1].attributes[SpanAttributes.HTTP_ROUTE], "/user/{username}" ) diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py index dd8da74f3f..1e2f0e5162 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py @@ -454,10 +454,23 @@ def _get_attributes_from_request(request): ) -def _get_operation_name(handler, request): - full_class_name = type(handler).__name__ - class_name = full_class_name.rsplit(".")[-1] - return f"{class_name}.{request.method.lower()}" +def _get_default_span_name(request): + """ + Default span name is the HTTP method and URL path, or just the method. + https://github.com/open-telemetry/opentelemetry-specification/pull/3165 + https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name + + Args: + request: Tornado request object. + Returns: + Default span name. + """ + + path = request.path + method = request.method + if method and path: + return f"{method} {path}" + return f"{method}" def _get_full_handler_name(handler): @@ -468,7 +481,7 @@ def _get_full_handler_name(handler): def _start_span(tracer, handler) -> _TraceContext: span, token = _start_internal_or_server_span( tracer=tracer, - span_name=_get_operation_name(handler, handler.request), + span_name=_get_default_span_name(handler.request), start_time=time_ns(), context_carrier=handler.request.headers, context_getter=textmap.default_getter, diff --git a/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py index c875a331ef..0baaa348ab 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py @@ -136,7 +136,7 @@ def _test_http_method_call(self, method): self.assertEqual(manual.parent, server.context) self.assertEqual(manual.context.trace_id, client.context.trace_id) - self.assertEqual(server.name, "MainHandler." + method.lower()) + self.assertEqual(server.name, f"{method} /") self.assertTrue(server.parent.is_remote) self.assertNotEqual(server.parent, client.context) self.assertEqual(server.parent.span_id, client.context.span_id) @@ -197,7 +197,7 @@ def _test_async_handler(self, url, handler_name): self.assertEqual(len(spans), 5) client = spans.by_name("GET") - server = spans.by_name(handler_name + ".get") + server = spans.by_name(f"GET {url}") sub_wrapper = spans.by_name("sub-task-wrapper") sub2 = spans.by_name("sub-task-2") @@ -214,7 +214,7 @@ def _test_async_handler(self, url, handler_name): self.assertEqual(sub_wrapper.parent, server.context) self.assertEqual(sub_wrapper.context.trace_id, client.context.trace_id) - self.assertEqual(server.name, handler_name + ".get") + self.assertEqual(server.name, f"GET {url}") self.assertTrue(server.parent.is_remote) self.assertNotEqual(server.parent, client.context) self.assertEqual(server.parent.span_id, client.context.span_id) @@ -230,6 +230,7 @@ def _test_async_handler(self, url, handler_name): SpanAttributes.HTTP_TARGET: url, SpanAttributes.HTTP_CLIENT_IP: "127.0.0.1", SpanAttributes.HTTP_STATUS_CODE: 201, + "tornado.handler": f"tests.tornado_test_app.{handler_name}", }, ) @@ -254,9 +255,9 @@ def test_500(self): self.assertEqual(len(spans), 2) client = spans.by_name("GET") - server = spans.by_name("BadHandler.get") + server = spans.by_name("GET /error") - self.assertEqual(server.name, "BadHandler.get") + self.assertEqual(server.name, "GET /error") self.assertEqual(server.kind, SpanKind.SERVER) self.assertSpanHasAttributes( server, @@ -291,7 +292,7 @@ def test_404(self): self.assertEqual(len(spans), 2) server, client = spans - self.assertEqual(server.name, "ErrorHandler.get") + self.assertEqual(server.name, "GET /missing-url") self.assertEqual(server.kind, SpanKind.SERVER) self.assertSpanHasAttributes( server, @@ -326,7 +327,7 @@ def test_http_error(self): self.assertEqual(len(spans), 2) server, client = spans - self.assertEqual(server.name, "RaiseHTTPErrorHandler.get") + self.assertEqual(server.name, "GET /raise_403") self.assertEqual(server.kind, SpanKind.SERVER) self.assertSpanHasAttributes( server, @@ -367,7 +368,7 @@ def test_dynamic_handler(self): self.assertEqual(len(spans), 2) server, client = spans - self.assertEqual(server.name, "DynamicHandler.get") + self.assertEqual(server.name, "GET /dyna") self.assertTrue(server.parent.is_remote) self.assertNotEqual(server.parent, client.context) self.assertEqual(server.parent.span_id, client.context.span_id) @@ -408,7 +409,7 @@ def test_handler_on_finish(self): self.assertEqual(len(spans), 3) auditor, server, client = spans - self.assertEqual(server.name, "FinishedHandler.get") + self.assertEqual(server.name, "GET /on_finish") self.assertTrue(server.parent.is_remote) self.assertNotEqual(server.parent, client.context) self.assertEqual(server.parent.span_id, client.context.span_id) @@ -535,7 +536,7 @@ def test_xheaders(self): self.assertEqual(response.code, 201) spans = self.get_finished_spans() self.assertSpanHasAttributes( - spans.by_name("MainHandler.get"), + spans.by_name("GET /"), { SpanAttributes.HTTP_METHOD: "GET", SpanAttributes.HTTP_SCHEME: "http", @@ -609,7 +610,7 @@ def test_uninstrument(self): self.assertEqual(len(spans), 3) manual, server, client = self.sorted_spans(spans) self.assertEqual(manual.name, "manual") - self.assertEqual(server.name, "MainHandler.get") + self.assertEqual(server.name, "GET /") self.assertEqual(client.name, "GET") self.memory_exporter.clear() diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py index 091ccf99b1..cdd35a0bad 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py @@ -207,7 +207,7 @@ def _instrumented_open_call( method = request.get_method().upper() - span_name = f"HTTP {method}".strip() + span_name = method.strip() url = remove_url_credentials(url) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py index 35e9e1f1c7..f27f594a30 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py @@ -124,7 +124,7 @@ def test_basic(self): span = self.assert_span() self.assertIs(span.kind, trace.SpanKind.CLIENT) - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") self.assertEqual( span.attributes, @@ -209,7 +209,7 @@ def test_response_code_none(self): span = self.assert_span() self.assertIs(span.kind, trace.SpanKind.CLIENT) - self.assertEqual(span.name, "HTTP GET") + self.assertEqual(span.name, "GET") self.assertEqual( span.attributes, diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py index 91d5576fc0..809f9b595f 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py @@ -225,7 +225,7 @@ def instrumented_urlopen(wrapped, instance, args, kwargs): headers = _prepare_headers(kwargs) body = _get_url_open_arg("body", args, kwargs) - span_name = f"HTTP {method.strip()}" + span_name = method.strip() span_attributes = { SpanAttributes.HTTP_METHOD: method, SpanAttributes.HTTP_URL: url, diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py index 315cec1112..1082776f9a 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py @@ -87,7 +87,7 @@ def assert_success_span( span = self.assert_span() self.assertIs(trace.SpanKind.CLIENT, span.kind) - self.assertEqual("HTTP GET", span.name) + self.assertEqual("GET", span.name) attributes = { SpanAttributes.HTTP_METHOD: "GET", diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_ip_support.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_ip_support.py index 5baddee516..1199ad3d5b 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_ip_support.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_ip_support.py @@ -77,7 +77,7 @@ def assert_success_span( span = self.assert_span() self.assertIs(trace.SpanKind.CLIENT, span.kind) - self.assertEqual("HTTP GET", span.name) + self.assertEqual("GET", span.name) attributes = { "http.status_code": 200, diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py index b4d53f9a8b..f4012d7904 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -440,8 +440,21 @@ def add_response_attributes( def get_default_span_name(environ): - """Default implementation for name_callback, returns HTTP {METHOD_NAME}.""" - return f"HTTP {environ.get('REQUEST_METHOD', '')}".strip() + """ + Default span name is the HTTP method and URL path, or just the method. + https://github.com/open-telemetry/opentelemetry-specification/pull/3165 + https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name + + Args: + environ: The WSGI environ object. + Returns: + The span name. + """ + method = environ.get("REQUEST_METHOD", "").strip() + path = environ.get("PATH_INFO", "").strip() + if method and path: + return f"{method} {path}" + return method class OpenTelemetryMiddleware: diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index 926124caf3..c2aaf3820d 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -128,7 +128,7 @@ def validate_response( self, response, error=None, - span_name="HTTP GET", + span_name="GET /", http_method="GET", span_attributes=None, response_headers=None, @@ -284,12 +284,13 @@ def test_wsgi_metrics(self): ) self.assertTrue(number_data_point_seen and histogram_data_point_seen) - def test_default_span_name_missing_request_method(self): - """Test that default span_names with missing request method.""" - self.environ.pop("REQUEST_METHOD") + def test_default_span_name_missing_path_info(self): + """Test that default span_names with missing path info.""" + self.environ.pop("PATH_INFO") + method = self.environ.get("REQUEST_METHOD", "").strip() app = otel_wsgi.OpenTelemetryMiddleware(simple_wsgi) response = app(self.environ, self.start_response) - self.validate_response(response, span_name="HTTP", http_method=None) + self.validate_response(response, span_name=method) class TestWsgiAttributes(unittest.TestCase): @@ -455,7 +456,7 @@ def validate_response( response, exporter, error=None, - span_name="HTTP GET", + span_name="GET /", http_method="GET", ): while True: diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py index 3022e6ddd0..35a55a1279 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py @@ -95,7 +95,7 @@ def _start_internal_or_server_span( Args: tracer : tracer in use by given instrumentation library - name (string): name of the span + span_name (string): name of the span start_time : start time of the span context_carrier : object which contains values that are used to construct a Context. This object From f9f7b014160a376360f254184159abf3f1b5b01b Mon Sep 17 00:00:00 2001 From: Filip Nikolovski Date: Fri, 16 Jun 2023 18:18:08 +0200 Subject: [PATCH 019/200] Fix falcon usage of Span Status (#1840) * Fix falcon usage of Span Status to only set the description if the status code is ERROR * Update changelog * Update CHANGELOG.md Co-authored-by: Srikanth Chekuri * fix lint * Use fewer variables to satisfy R0914 lint rule --------- Co-authored-by: Srikanth Chekuri --- CHANGELOG.md | 6 ++++-- .../instrumentation/falcon/__init__.py | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9959a49d01..cde00bb9ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR. + ([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840)) - Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748)) ## Version 1.18.0/0.39b0 (2023-05-10) @@ -23,9 +25,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1778](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1778)) - Add `excluded_urls` functionality to `urllib` and `urllib3` instrumentations ([#1733](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1733)) -- Make Django request span attributes available for `start_span`. +- Make Django request span attributes available for `start_span`. ([#1730](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1730)) -- Make ASGI request span attributes available for `start_span`. +- Make ASGI request span attributes available for `start_span`. ([#1762](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1762)) - `opentelemetry-instrumentation-celery` Add support for anonymous tasks. ([#1407](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1407)) diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py index 3a6a86e4fb..73c005fa17 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py @@ -208,7 +208,7 @@ def response_hook(span, req, resp): from opentelemetry.metrics import get_meter from opentelemetry.semconv.metrics import MetricInstruments from opentelemetry.semconv.trace import SpanAttributes -from opentelemetry.trace.status import Status +from opentelemetry.trace.status import Status, StatusCode from opentelemetry.util.http import get_excluded_urls, get_traced_request_attrs _logger = getLogger(__name__) @@ -461,11 +461,17 @@ def process_response( try: status_code = int(status) span.set_attribute(SpanAttributes.HTTP_STATUS_CODE, status_code) + otel_status_code = http_status_to_status_code( + status_code, server_span=True + ) + + # set the description only when the status code is ERROR + if otel_status_code is not StatusCode.ERROR: + reason = None + span.set_status( Status( - status_code=http_status_to_status_code( - status_code, server_span=True - ), + status_code=otel_status_code, description=reason, ) ) From 7292beefae6ee08c886ca3a8728e8cfe71b43fb8 Mon Sep 17 00:00:00 2001 From: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:40:46 -0700 Subject: [PATCH 020/200] Request Flask attributes passed to Sampler (#1784) * Request Flask attributes passed to Sampler * Update changelog * Lint * Fix botocore test keyerror * Revert "Fix botocore test keyerror" This reverts commit fd03c55a3902b3456afd6a2ecf429afba11b0691. * botocore test does get_queue_url * Revert "botocore test does get_queue_url" This reverts commit 9530cd250dd836b3181a9361decb130e2aae1202. * Update changelog --------- Co-authored-by: Srikanth Chekuri Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 4 ++++ .../instrumentation/flask/__init__.py | 17 ++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cde00bb9ab..70ba0033de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Make Flask request span attributes available for `start_span`. + ([#1784](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1784)) - Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR. ([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840)) - Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748)) diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index 73c2f4fe2d..432c6b1fbf 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -375,27 +375,26 @@ def _before_request(): flask_request_environ = flask.request.environ span_name = get_default_span_name() + attributes = otel_wsgi.collect_request_attributes( + flask_request_environ + ) + if flask.request.url_rule: + # For 404 that result from no route found, etc, we + # don't have a url_rule. + attributes[SpanAttributes.HTTP_ROUTE] = flask.request.url_rule.rule span, token = _start_internal_or_server_span( tracer=tracer, span_name=span_name, start_time=flask_request_environ.get(_ENVIRON_STARTTIME_KEY), context_carrier=flask_request_environ, context_getter=otel_wsgi.wsgi_getter, + attributes=attributes, ) if request_hook: request_hook(span, flask_request_environ) if span.is_recording(): - attributes = otel_wsgi.collect_request_attributes( - flask_request_environ - ) - if flask.request.url_rule: - # For 404 that result from no route found, etc, we - # don't have a url_rule. - attributes[ - SpanAttributes.HTTP_ROUTE - ] = flask.request.url_rule.rule for key, value in attributes.items(): span.set_attribute(key, value) if span.is_recording() and span.kind == trace.SpanKind.SERVER: From a3a0b2409cc1fe9a03bb73da9c8bbf47b9d3d5ea Mon Sep 17 00:00:00 2001 From: Yashaswi Makula Date: Sat, 17 Jun 2023 04:38:51 +0530 Subject: [PATCH 021/200] Fixed urllib3 instrumentation example in instrumentation documentation (#1793) * corrected instrumentation example in urllib3 * Remove changelog entry --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Diego Hurtado --- .../opentelemetry-instrumentation-urllib3/README.rst | 4 ++-- .../src/opentelemetry/instrumentation/urllib3/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/README.rst b/instrumentation/opentelemetry-instrumentation-urllib3/README.rst index 0c53c299a0..4e0089e21e 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/README.rst +++ b/instrumentation/opentelemetry-instrumentation-urllib3/README.rst @@ -38,8 +38,8 @@ The hooks can be configured as follows: def response_hook(span, request, response): pass - URLLib3Instrumentor.instrument( - request_hook=request_hook, response_hook=response_hook) + URLLib3Instrumentor().instrument( + request_hook=request_hook, response_hook=response_hook ) Exclude lists diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py index 809f9b595f..d3016ea5ee 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py @@ -56,8 +56,8 @@ def request_hook(span, request): def response_hook(span, request, response): pass - URLLib3Instrumentor.instrument( - request_hook=request_hook, response_hook=response_hook) + URLLib3Instrumentor().instrument( + request_hook=request_hook, response_hook=response_hook ) Exclude lists From 78040836d2d401c9a0ba5013e73140b768fb58ee Mon Sep 17 00:00:00 2001 From: Iman Shafiei Date: Fri, 16 Jun 2023 16:55:15 -0700 Subject: [PATCH 022/200] Fix Invalid type NoneType for attribute X error | AWS-Lambda instrumentation (#1785) * Add None checking to the aws-lambda logic * Update changelog. * Change .get() check to 'key' in dict check. * Fix consistency issues. * Update changelog. --------- Co-authored-by: Srikanth Chekuri Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 + .../instrumentation/aws_lambda/__init__.py | 94 ++++++++++--------- 2 files changed, 53 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ba0033de..29cecbd899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR. ([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840)) - Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748)) +- Fix `Invalid type NoneType for attribute X (opentelemetry-instrumentation-aws-lambda)` error when some attributes do not exist + ([#1780](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1780)) ## Version 1.18.0/0.39b0 (2023-05-10) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index 4404839c66..799becbdcc 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -201,30 +201,35 @@ def _set_api_gateway_v1_proxy_attributes( span.set_attribute( SpanAttributes.HTTP_METHOD, lambda_event.get("httpMethod") ) - span.set_attribute(SpanAttributes.HTTP_ROUTE, lambda_event.get("resource")) if lambda_event.get("headers"): - span.set_attribute( - SpanAttributes.HTTP_USER_AGENT, - lambda_event["headers"].get("User-Agent"), - ) - span.set_attribute( - SpanAttributes.HTTP_SCHEME, - lambda_event["headers"].get("X-Forwarded-Proto"), - ) - span.set_attribute( - SpanAttributes.NET_HOST_NAME, lambda_event["headers"].get("Host") - ) + if "User-Agent" in lambda_event["headers"]: + span.set_attribute( + SpanAttributes.HTTP_USER_AGENT, + lambda_event["headers"]["User-Agent"], + ) + if "X-Forwarded-Proto" in lambda_event["headers"]: + span.set_attribute( + SpanAttributes.HTTP_SCHEME, + lambda_event["headers"]["X-Forwarded-Proto"], + ) + if "Host" in lambda_event["headers"]: + span.set_attribute( + SpanAttributes.NET_HOST_NAME, + lambda_event["headers"]["Host"], + ) + if "resource" in lambda_event: + span.set_attribute(SpanAttributes.HTTP_ROUTE, lambda_event["resource"]) - if lambda_event.get("queryStringParameters"): - span.set_attribute( - SpanAttributes.HTTP_TARGET, - f"{lambda_event.get('resource')}?{urlencode(lambda_event.get('queryStringParameters'))}", - ) - else: - span.set_attribute( - SpanAttributes.HTTP_TARGET, lambda_event.get("resource") - ) + if lambda_event.get("queryStringParameters"): + span.set_attribute( + SpanAttributes.HTTP_TARGET, + f"{lambda_event['resource']}?{urlencode(lambda_event['queryStringParameters'])}", + ) + else: + span.set_attribute( + SpanAttributes.HTTP_TARGET, lambda_event["resource"] + ) return span @@ -237,35 +242,38 @@ def _set_api_gateway_v2_proxy_attributes( More info: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html """ - span.set_attribute( - SpanAttributes.NET_HOST_NAME, - lambda_event["requestContext"].get("domainName"), - ) - - if lambda_event["requestContext"].get("http"): + if "domainName" in lambda_event["requestContext"]: span.set_attribute( - SpanAttributes.HTTP_METHOD, - lambda_event["requestContext"]["http"].get("method"), - ) - span.set_attribute( - SpanAttributes.HTTP_USER_AGENT, - lambda_event["requestContext"]["http"].get("userAgent"), - ) - span.set_attribute( - SpanAttributes.HTTP_ROUTE, - lambda_event["requestContext"]["http"].get("path"), + SpanAttributes.NET_HOST_NAME, + lambda_event["requestContext"]["domainName"], ) - if lambda_event.get("rawQueryString"): + if lambda_event["requestContext"].get("http"): + if "method" in lambda_event["requestContext"]["http"]: span.set_attribute( - SpanAttributes.HTTP_TARGET, - f"{lambda_event['requestContext']['http'].get('path')}?{lambda_event.get('rawQueryString')}", + SpanAttributes.HTTP_METHOD, + lambda_event["requestContext"]["http"]["method"], ) - else: + if "userAgent" in lambda_event["requestContext"]["http"]: span.set_attribute( - SpanAttributes.HTTP_TARGET, - lambda_event["requestContext"]["http"].get("path"), + SpanAttributes.HTTP_USER_AGENT, + lambda_event["requestContext"]["http"]["userAgent"], + ) + if "path" in lambda_event["requestContext"]["http"]: + span.set_attribute( + SpanAttributes.HTTP_ROUTE, + lambda_event["requestContext"]["http"]["path"], ) + if lambda_event.get("rawQueryString"): + span.set_attribute( + SpanAttributes.HTTP_TARGET, + f"{lambda_event['requestContext']['http']['path']}?{lambda_event['rawQueryString']}", + ) + else: + span.set_attribute( + SpanAttributes.HTTP_TARGET, + lambda_event["requestContext"]["http"]["path"], + ) return span From 1dd17edeeab4cb45477755fb2ef0eef23fbd8289 Mon Sep 17 00:00:00 2001 From: Akochavi <121871419+Akochavi@users.noreply.github.com> Date: Sun, 18 Jun 2023 13:45:00 +0300 Subject: [PATCH 023/200] Add metrics instrumentation celery (#1679) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 3 + .../instrumentation/celery/__init__.py | 46 ++++++++++- .../tests/test_metrics.py | 76 +++++++++++++++++++ 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 29cecbd899..b591e9a143 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased + ### Added - Make Flask request span attributes available for `start_span`. @@ -16,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748)) - Fix `Invalid type NoneType for attribute X (opentelemetry-instrumentation-aws-lambda)` error when some attributes do not exist ([#1780](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1780)) +- Add metric instrumentation for celery + ([#1679](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1679)) ## Version 1.18.0/0.39b0 (2023-05-10) diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py index cb265b46f8..a216765fb0 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py @@ -60,6 +60,7 @@ def add(x, y): """ import logging +from timeit import default_timer from typing import Collection, Iterable from celery import signals # pylint: disable=no-name-in-module @@ -69,6 +70,7 @@ def add(x, y): from opentelemetry.instrumentation.celery.package import _instruments from opentelemetry.instrumentation.celery.version import __version__ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor +from opentelemetry.metrics import get_meter from opentelemetry.propagate import extract, inject from opentelemetry.propagators.textmap import Getter from opentelemetry.semconv.trace import SpanAttributes @@ -104,6 +106,11 @@ def keys(self, carrier): class CeleryInstrumentor(BaseInstrumentor): + def __init__(self): + super().__init__() + self.metrics = None + self.task_id_to_start_time = {} + def instrumentation_dependencies(self) -> Collection[str]: return _instruments @@ -113,6 +120,11 @@ def _instrument(self, **kwargs): # pylint: disable=attribute-defined-outside-init self._tracer = trace.get_tracer(__name__, __version__, tracer_provider) + meter_provider = kwargs.get("meter_provider") + meter = get_meter(__name__, __version__, meter_provider) + + self.create_celery_metrics(meter) + signals.task_prerun.connect(self._trace_prerun, weak=False) signals.task_postrun.connect(self._trace_postrun, weak=False) signals.before_task_publish.connect( @@ -139,6 +151,7 @@ def _trace_prerun(self, *args, **kwargs): if task is None or task_id is None: return + self.update_task_duration_time(task_id) request = task.request tracectx = extract(request, getter=celery_getter) or None @@ -153,8 +166,7 @@ def _trace_prerun(self, *args, **kwargs): activation.__enter__() # pylint: disable=E1101 utils.attach_span(task, task_id, (span, activation)) - @staticmethod - def _trace_postrun(*args, **kwargs): + def _trace_postrun(self, *args, **kwargs): task = utils.retrieve_task(kwargs) task_id = utils.retrieve_task_id(kwargs) @@ -178,6 +190,9 @@ def _trace_postrun(*args, **kwargs): activation.__exit__(None, None, None) utils.detach_span(task, task_id) + self.update_task_duration_time(task_id) + labels = {"task": task.name, "worker": task.request.hostname} + self._record_histograms(task_id, labels) def _trace_before_publish(self, *args, **kwargs): task = utils.retrieve_task_from_sender(kwargs) @@ -277,3 +292,30 @@ def _trace_retry(*args, **kwargs): # Use `str(reason)` instead of `reason.message` in case we get # something that isn't an `Exception` span.set_attribute(_TASK_RETRY_REASON_KEY, str(reason)) + + def update_task_duration_time(self, task_id): + cur_time = default_timer() + task_duration_time_until_now = ( + cur_time - self.task_id_to_start_time[task_id] + if task_id in self.task_id_to_start_time + else cur_time + ) + self.task_id_to_start_time[task_id] = task_duration_time_until_now + + def _record_histograms(self, task_id, metric_attributes): + if task_id is None: + return + + self.metrics["flower.task.runtime.seconds"].record( + self.task_id_to_start_time.get(task_id), + attributes=metric_attributes, + ) + + def create_celery_metrics(self, meter) -> None: + self.metrics = { + "flower.task.runtime.seconds": meter.create_histogram( + name="flower.task.runtime.seconds", + unit="seconds", + description="The time it took to run the task.", + ) + } diff --git a/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py new file mode 100644 index 0000000000..46e39a6046 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py @@ -0,0 +1,76 @@ +import threading +import time +from timeit import default_timer + +from opentelemetry.instrumentation.celery import CeleryInstrumentor +from opentelemetry.test.test_base import TestBase + +from .celery_test_tasks import app, task_add + + +class TestMetrics(TestBase): + def setUp(self): + super().setUp() + self._worker = app.Worker( + app=app, pool="solo", concurrency=1, hostname="celery@akochavi" + ) + self._thread = threading.Thread(target=self._worker.start) + self._thread.daemon = True + self._thread.start() + + def tearDown(self): + super().tearDown() + self._worker.stop() + self._thread.join() + + def get_metrics(self): + result = task_add.delay(1, 2) + + timeout = time.time() + 60 * 1 # 1 minutes from now + while not result.ready(): + if time.time() > timeout: + break + time.sleep(0.05) + return self.get_sorted_metrics() + + def test_basic_metric(self): + CeleryInstrumentor().instrument() + start_time = default_timer() + task_runtime_estimated = (default_timer() - start_time) * 1000 + + metrics = self.get_metrics() + CeleryInstrumentor().uninstrument() + self.assertEqual(len(metrics), 1) + + task_runtime = metrics[0] + print(task_runtime) + self.assertEqual(task_runtime.name, "flower.task.runtime.seconds") + self.assert_metric_expected( + task_runtime, + [ + self.create_histogram_data_point( + count=1, + sum_data_point=task_runtime_estimated, + max_data_point=task_runtime_estimated, + min_data_point=task_runtime_estimated, + attributes={ + "task": "tests.celery_test_tasks.task_add", + "worker": "celery@akochavi", + }, + ) + ], + est_value_delta=200, + ) + + def test_metric_uninstrument(self): + CeleryInstrumentor().instrument() + metrics = self.get_metrics() + self.assertEqual(len(metrics), 1) + CeleryInstrumentor().uninstrument() + + metrics = self.get_metrics() + self.assertEqual(len(metrics), 1) + + for metric in metrics: + for point in list(metric.data.data_points): + self.assertEqual(point.count, 1) From 5ac58c2ffb4c595c9281f50606306943ce7b5044 Mon Sep 17 00:00:00 2001 From: David Gonoradsky Date: Sun, 18 Jun 2023 16:20:21 +0300 Subject: [PATCH 024/200] Add support for confluent_kafka until 2.1.1 version (#1815) * Add support for confulent_kafka until 2.1.1 version * Include 2.1.1 version * update CHANGELOG.md * run: 'tox -e generate' * resolve comments * update top version to 2.2.0 --------- Co-authored-by: Ran Nozik --- CHANGELOG.md | 2 ++ docs-requirements.txt | 2 +- instrumentation/README.md | 2 +- .../pyproject.toml | 2 +- .../opentelemetry/instrumentation/confluent_kafka/package.py | 2 +- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b591e9a143..0e0229e51b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706)) - `opentelemetry-instrumentation-pymemcache` Update instrumentation to support pymemcache >4 ([#1764](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1764)) +- `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions of confluent_kafka + ([#1815](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1815)) ### Added diff --git a/docs-requirements.txt b/docs-requirements.txt index 6d11d20198..4af8839334 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -26,7 +26,7 @@ boto~=2.0 botocore~=1.0 boto3~=1.0 celery>=4.0 -confluent-kafka>= 1.8.2,< 2.0.0 +confluent-kafka>= 1.8.2,<= 2.2.0 elasticsearch>=2.0,<9.0 flask~=2.0 falcon~=2.0 diff --git a/instrumentation/README.md b/instrumentation/README.md index e69dd6adbd..933e9b763d 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -11,7 +11,7 @@ | [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No | [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 | No | [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No -| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, < 2.0.0 | No +| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.2.0 | No | [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No | [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index a84f7d959e..2ef1fd6b49 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "confluent-kafka >= 1.8.2, < 2.0.0", + "confluent-kafka >= 1.8.2, <= 2.2.0", ] test = [ "opentelemetry-instrumentation-confluent-kafka[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py index eab664d9ee..21d37ebfae 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("confluent-kafka >= 1.8.2, < 2.0.0",) +_instruments = ("confluent-kafka >= 1.8.2, <= 2.2.0",) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index f705324289..1e0b9fd2f5 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -53,7 +53,7 @@ "instrumentation": "opentelemetry-instrumentation-celery==0.40b0.dev", }, "confluent-kafka": { - "library": "confluent-kafka >= 1.8.2, < 2.0.0", + "library": "confluent-kafka >= 1.8.2, <= 2.2.0", "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.40b0.dev", }, "django": { From 8cc10a0859d0da4773985e1025d261c3e334ea28 Mon Sep 17 00:00:00 2001 From: Pablo Collins Date: Sun, 18 Jun 2023 09:55:17 -0400 Subject: [PATCH 025/200] fix redis doc (#1808) doc string rendered at https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/redis/redis.html refers to `opentelemetry-instrumentation` executable which appears to be a typo Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 1 - .../src/opentelemetry/instrumentation/redis/__init__.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e0229e51b..c096812a60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased - ### Added - Make Flask request span attributes available for `start_span`. diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py index 188840c7b8..3c8acdef31 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py @@ -16,7 +16,7 @@ Instrument `redis`_ to report Redis queries. There are two options for instrumenting code. The first option is to use the -``opentelemetry-instrumentation`` executable which will automatically +``opentelemetry-instrument`` executable which will automatically instrument your Redis client. The second is to programmatically enable instrumentation via the following code: From 60753e2a5528ac34aa415f1daa2fc2db53fc5eb4 Mon Sep 17 00:00:00 2001 From: Iman Shafiei Date: Mon, 19 Jun 2023 13:00:59 -0700 Subject: [PATCH 026/200] Add http.server.response.size metric to ASGI implementation. (#1789) * Add http.server.response.size metric to ASGI implementation. Add new unit tests. * Update changelog. * Fix linting by disabling too-many-nested-blocks * Put new logic in a new method * Refactor the placement of new logic. * Fixed the unit tests in FastAPI and Starlette * Update changelog. * FIx lint errors. * Refactor getting content-length header * Refactor getting content-length header --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Diego Hurtado --- CHANGELOG.md | 2 ++ .../instrumentation/asgi/__init__.py | 17 ++++++++++ .../tests/test_asgi_middleware.py | 31 +++++++++++++------ .../tests/test_fastapi_instrumentation.py | 7 ++++- .../tests/test_starlette_instrumentation.py | 4 ++- 5 files changed, 50 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c096812a60..de2ed9475e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1780](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1780)) - Add metric instrumentation for celery ([#1679](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1679)) +- `opentelemetry-instrumentation-asgi` Add `http.server.response.size` metric + ([#1789](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1789)) ## Version 1.18.0/0.39b0 (2023-05-10) diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index 010c6accde..1ee25ae7d9 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -506,6 +506,11 @@ def __init__( unit="ms", description="measures the duration of the inbound HTTP request", ) + self.server_response_size_histogram = self.meter.create_histogram( + name=MetricInstruments.HTTP_SERVER_RESPONSE_SIZE, + unit="By", + description="measures the size of HTTP response messages (compressed).", + ) self.active_requests_counter = self.meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, unit="requests", @@ -518,6 +523,7 @@ def __init__( self.server_request_hook = server_request_hook self.client_request_hook = client_request_hook self.client_response_hook = client_response_hook + self.content_length_header = None async def __call__(self, scope, receive, send): """The ASGI application @@ -593,6 +599,10 @@ async def __call__(self, scope, receive, send): self.active_requests_counter.add( -1, active_requests_count_attrs ) + if self.content_length_header: + self.server_response_size_histogram.record( + self.content_length_header, duration_attrs + ) if token: context.detach(token) @@ -660,6 +670,13 @@ async def otel_send(message): setter=asgi_setter, ) + content_length = asgi_getter.get(message, "content-length") + if content_length: + try: + self.content_length_header = int(content_length[0]) + except ValueError: + pass + await send(message) return otel_send diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index f9a5731fd3..0a0c2c301f 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -46,10 +46,12 @@ _expected_metric_names = [ "http.server.active_requests", "http.server.duration", + "http.server.response.size", ] _recommended_attrs = { "http.server.active_requests": _active_requests_count_attrs, "http.server.duration": _duration_attrs, + "http.server.response.size": _duration_attrs, } @@ -61,7 +63,10 @@ async def http_app(scope, receive, send): { "type": "http.response.start", "status": 200, - "headers": [[b"Content-Type", b"text/plain"]], + "headers": [ + [b"Content-Type", b"text/plain"], + [b"content-length", b"1024"], + ], } ) await send({"type": "http.response.body", "body": b"*"}) @@ -103,7 +108,10 @@ async def error_asgi(scope, receive, send): { "type": "http.response.start", "status": 200, - "headers": [[b"Content-Type", b"text/plain"]], + "headers": [ + [b"Content-Type", b"text/plain"], + [b"content-length", b"1024"], + ], } ) await send({"type": "http.response.body", "body": b"*"}) @@ -126,7 +134,8 @@ def validate_outputs(self, outputs, error=None, modifiers=None): # Check http response start self.assertEqual(response_start["status"], 200) self.assertEqual( - response_start["headers"], [[b"Content-Type", b"text/plain"]] + response_start["headers"], + [[b"Content-Type", b"text/plain"], [b"content-length", b"1024"]], ) exc_info = self.scope.get("hack_exc_info") @@ -352,6 +361,7 @@ def test_traceresponse_header(self): response_start["headers"], [ [b"Content-Type", b"text/plain"], + [b"content-length", b"1024"], [b"traceresponse", f"{traceresponse}".encode()], [b"access-control-expose-headers", b"traceresponse"], ], @@ -565,6 +575,7 @@ def test_basic_metric_success(self): "http.flavor": "1.0", } metrics_list = self.memory_metrics_reader.get_metrics_data() + # pylint: disable=too-many-nested-blocks for resource_metric in metrics_list.resource_metrics: for scope_metrics in resource_metric.scope_metrics: for metric in scope_metrics.metrics: @@ -575,9 +586,12 @@ def test_basic_metric_success(self): dict(point.attributes), ) self.assertEqual(point.count, 1) - self.assertAlmostEqual( - duration, point.sum, delta=5 - ) + if metric.name == "http.server.duration": + self.assertAlmostEqual( + duration, point.sum, delta=5 + ) + elif metric.name == "http.server.response.size": + self.assertEqual(1024, point.sum) elif isinstance(point, NumberDataPoint): self.assertDictEqual( expected_requests_count_attributes, @@ -602,13 +616,12 @@ async def target_asgi(scope, receive, send): app = otel_asgi.OpenTelemetryMiddleware(target_asgi) self.seed_app(app) self.send_default_request() - metrics_list = self.memory_metrics_reader.get_metrics_data() assertions = 0 for resource_metric in metrics_list.resource_metrics: for scope_metrics in resource_metric.scope_metrics: for metric in scope_metrics.metrics: - if metric.name != "http.server.duration": + if metric.name == "http.server.active_requests": continue for point in metric.data.data_points: if isinstance(point, HistogramDataPoint): @@ -617,7 +630,7 @@ async def target_asgi(scope, receive, send): expected_target, ) assertions += 1 - self.assertEqual(assertions, 1) + self.assertEqual(assertions, 2) def test_no_metric_for_websockets(self): self.scope = { diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index 9420ba2c0e..7f12d6e3f3 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -44,10 +44,15 @@ _expected_metric_names = [ "http.server.active_requests", "http.server.duration", + "http.server.response.size", ] _recommended_attrs = { "http.server.active_requests": _active_requests_count_attrs, "http.server.duration": {*_duration_attrs, SpanAttributes.HTTP_TARGET}, + "http.server.response.size": { + *_duration_attrs, + SpanAttributes.HTTP_TARGET, + }, } @@ -187,7 +192,7 @@ def test_fastapi_metrics(self): for resource_metric in metrics_list.resource_metrics: self.assertTrue(len(resource_metric.scope_metrics) == 1) for scope_metric in resource_metric.scope_metrics: - self.assertTrue(len(scope_metric.metrics) == 2) + self.assertTrue(len(scope_metric.metrics) == 3) for metric in scope_metric.metrics: self.assertIn(metric.name, _expected_metric_names) data_points = list(metric.data.data_points) diff --git a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py index 1f4570d293..2a53bdffb7 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py @@ -49,10 +49,12 @@ _expected_metric_names = [ "http.server.active_requests", "http.server.duration", + "http.server.response.size", ] _recommended_attrs = { "http.server.active_requests": _active_requests_count_attrs, "http.server.duration": _duration_attrs, + "http.server.response.size": _duration_attrs, } @@ -128,7 +130,7 @@ def test_starlette_metrics(self): for resource_metric in metrics_list.resource_metrics: self.assertTrue(len(resource_metric.scope_metrics) == 1) for scope_metric in resource_metric.scope_metrics: - self.assertTrue(len(scope_metric.metrics) == 2) + self.assertTrue(len(scope_metric.metrics) == 3) for metric in scope_metric.metrics: self.assertIn(metric.name, _expected_metric_names) data_points = list(metric.data.data_points) From fe9405730f8d18fe70308db52093b7b5b1e74e0c Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 20 Jun 2023 14:09:53 +0300 Subject: [PATCH 027/200] fix: Update falcon instrumentation to follow semantic conventions (#1824) * fix: Update falcon instrumentation to follow semantic conventions * docs: Update changelog * fix linter errors * Disable falcon.HTTP_200 pylint checck --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Srikanth Chekuri --- CHANGELOG.md | 5 +++ .../instrumentation/falcon/__init__.py | 7 +++- .../tests/app.py | 9 +++++ .../tests/test_falcon.py | 33 +++++++++++++++++-- 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de2ed9475e..c83443dc02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- Update falcon instrumentation to follow semantic conventions + ([#1824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1824)) + ### Added - Make Flask request span attributes available for `start_span`. diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py index 73c005fa17..669f41b0ab 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py @@ -428,7 +428,6 @@ def process_resource(self, req, resp, resource, params): resource_name = resource.__class__.__name__ span.set_attribute("falcon.resource", resource_name) - span.update_name(f"{resource_name}.on_{req.method.lower()}") def process_response( self, req, resp, resource, req_succeeded=None @@ -483,6 +482,12 @@ def process_response( response_headers = resp.headers if span.is_recording() and span.kind == trace.SpanKind.SERVER: + # Check if low-cardinality route is available as per semantic-conventions + if req.uri_template: + span.update_name(f"{req.method} {req.uri_template}") + else: + span.update_name(f"{req.method}") + custom_attributes = ( otel_wsgi.collect_custom_response_headers_attributes( response_headers.items() diff --git a/instrumentation/opentelemetry-instrumentation-falcon/tests/app.py b/instrumentation/opentelemetry-instrumentation-falcon/tests/app.py index 3e4c62ec3e..a4d279149d 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/tests/app.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/tests/app.py @@ -61,6 +61,13 @@ def on_get(self, _, resp): resp.set_header("my-secret-header", "my-secret-value") +class UserResource: + def on_get(self, req, resp, user_id): + # pylint: disable=no-member + resp.status = falcon.HTTP_200 + resp.body = f"Hello user {user_id}" + + def make_app(): _parsed_falcon_version = package_version.parse(falcon.__version__) if _parsed_falcon_version < package_version.parse("3.0.0"): @@ -76,4 +83,6 @@ def make_app(): app.add_route( "/test_custom_response_headers", CustomResponseHeaderResource() ) + app.add_route("/user/{user_id}", UserResource()) + return app diff --git a/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py b/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py index cf61a9fd3c..2245dbfd80 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py @@ -110,7 +110,7 @@ def _test_method(self, method): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 1) span = spans[0] - self.assertEqual(span.name, f"HelloWorldResource.on_{method.lower()}") + self.assertEqual(span.name, f"{method} /hello") self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertEqual( span.status.description, @@ -145,7 +145,7 @@ def test_404(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 1) span = spans[0] - self.assertEqual(span.name, "GET /does-not-exist") + self.assertEqual(span.name, "GET") self.assertEqual(span.status.status_code, StatusCode.UNSET) self.assertSpanHasAttributes( span, @@ -177,7 +177,7 @@ def test_500(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 1) span = spans[0] - self.assertEqual(span.name, "ErrorResource.on_get") + self.assertEqual(span.name, "GET /error") self.assertFalse(span.status.is_ok) self.assertEqual(span.status.status_code, StatusCode.ERROR) self.assertEqual( @@ -206,6 +206,33 @@ def test_500(self): span.attributes[SpanAttributes.NET_PEER_IP], "127.0.0.1" ) + def test_url_template(self): + self.client().simulate_get("/user/123") + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + span = spans[0] + self.assertEqual(span.name, "GET /user/{user_id}") + self.assertEqual(span.status.status_code, StatusCode.UNSET) + self.assertEqual( + span.status.description, + None, + ) + self.assertSpanHasAttributes( + span, + { + SpanAttributes.HTTP_METHOD: "GET", + SpanAttributes.HTTP_SERVER_NAME: "falconframework.org", + SpanAttributes.HTTP_SCHEME: "http", + SpanAttributes.NET_HOST_PORT: 80, + SpanAttributes.HTTP_HOST: "falconframework.org", + SpanAttributes.HTTP_TARGET: "/", + SpanAttributes.NET_PEER_PORT: "65133", + SpanAttributes.HTTP_FLAVOR: "1.1", + "falcon.resource": "UserResource", + SpanAttributes.HTTP_STATUS_CODE: 200, + }, + ) + def test_uninstrument(self): self.client().simulate_get(path="/hello") spans = self.memory_exporter.get_finished_spans() From ffc9334dd73d1247f28db92a143ec7cc91624995 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:01:36 +0000 Subject: [PATCH 028/200] Bump requests from 2.28.1 to 2.31.0 (#1818) Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.31.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.31.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 8973fb9476..feab6b4b02 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -16,5 +16,5 @@ mypy-protobuf>=1.23 protobuf~=3.13 markupsafe>=2.0.1 codespell==2.1.0 -requests==2.28.1 +requests==2.31.0 ruamel.yaml==0.17.21 From 32ae65ed55150131a6889e6661de5684b133b5da Mon Sep 17 00:00:00 2001 From: Matt Oberle Date: Wed, 21 Jun 2023 08:30:35 -0400 Subject: [PATCH 029/200] fix(grpc): Allow gRPC connections via Unix socket (#1833) * fix(grpc): Allow gRPC connections via Unix socket This commit addresses issue #1832. The way `NET_PEER_IP` and `NET_PEER_PORT` are retrieved raises a `ValueError` when gRPC connections are handled via Unix sockets. ```py ip, port = ( context.peer().split(",")[0].split(":", 1)[1].rsplit(":", 1) ) ``` When using an address like `unix:///tmp/grpc.sock` the value of `context.peer()` is `"unix:"`. Substituting that in the function above... ```py ip, port = "unix:".split(",")[0].split(":", 1)[1].rsplit(":", 1) ip, port = ["unix:"][0].split(":", 1)[1].rsplit(":", 1) ip, port = "unix:".split(":", 1)[1].rsplit(":", 1) ip, port = ["unix", ""][1].rsplit(":", 1) ip, port = "".rsplit(":", 1) ip, port = [""] # ValueError ``` I "addressed" the issue by guarding the retrieval of `net.peer.*` values under an `if` statement that checks if we are using a Unix socket. I extended the `server_interceptor` tests to run against TCP and Unix socket configurations. --- **Open Questions** - [ ] The socket tests will fail on Windows. Is there a way to annotate that? - [ ] Are there other span values we should be setting for the unix socket? * Update CHANGELOG * Add placeholder attributes for linter * fix lint --------- Co-authored-by: Matt Oberle Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 + .../instrumentation/grpc/_server.py | 38 ++-- .../tests/test_server_interceptor.py | 188 ++++++++---------- 3 files changed, 107 insertions(+), 121 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c83443dc02..ad6f969aa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1679](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1679)) - `opentelemetry-instrumentation-asgi` Add `http.server.response.size` metric ([#1789](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1789)) +- `opentelemetry-instrumentation-grpc` Allow gRPC connections via Unix socket + ([#1833](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1833)) ## Version 1.18.0/0.39b0 (2023-05-10) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py index a34cac0b3c..dcee959b4d 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py @@ -250,24 +250,30 @@ def _start_span( # * ipv4:127.0.0.1:57284 # * ipv4:10.2.1.1:57284,127.0.0.1:57284 # - try: - ip, port = ( - context.peer().split(",")[0].split(":", 1)[1].rsplit(":", 1) - ) - ip = unquote(ip) - attributes.update( - { - SpanAttributes.NET_PEER_IP: ip, - SpanAttributes.NET_PEER_PORT: port, - } - ) + if context.peer() != "unix:": + try: + ip, port = ( + context.peer() + .split(",")[0] + .split(":", 1)[1] + .rsplit(":", 1) + ) + ip = unquote(ip) + attributes.update( + { + SpanAttributes.NET_PEER_IP: ip, + SpanAttributes.NET_PEER_PORT: port, + } + ) - # other telemetry sources add this, so we will too - if ip in ("[::1]", "127.0.0.1"): - attributes[SpanAttributes.NET_PEER_NAME] = "localhost" + # other telemetry sources add this, so we will too + if ip in ("[::1]", "127.0.0.1"): + attributes[SpanAttributes.NET_PEER_NAME] = "localhost" - except IndexError: - logger.warning("Failed to parse peer address '%s'", context.peer()) + except IndexError: + logger.warning( + "Failed to parse peer address '%s'", context.peer() + ) return self._tracer.start_as_current_span( name=handler_call_details.method, diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py index b48d887f5a..57f27c89d6 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py @@ -15,6 +15,8 @@ # pylint:disable=unused-argument # pylint:disable=no-self-use +import contextlib +import tempfile import threading from concurrent import futures @@ -78,23 +80,32 @@ def ServerStreamingMethod(self, request, context): class TestOpenTelemetryServerInterceptor(TestBase): - def test_instrumentor(self): - def handler(request, context): - return b"" - - grpc_server_instrumentor = GrpcInstrumentorServer() - grpc_server_instrumentor.instrument() - with futures.ThreadPoolExecutor(max_workers=1) as executor: + net_peer_span_attributes = { + SpanAttributes.NET_PEER_IP: "[::1]", + SpanAttributes.NET_PEER_NAME: "localhost", + } + + @contextlib.contextmanager + def server(self, max_workers=1, interceptors=None): + with futures.ThreadPoolExecutor(max_workers=max_workers) as executor: server = grpc.server( executor, options=(("grpc.so_reuseport", 0),), + interceptors=interceptors or [], ) - server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) - port = server.add_insecure_port("[::]:0") channel = grpc.insecure_channel(f"localhost:{port:d}") + yield server, channel + + def test_instrumentor(self): + def handler(request, context): + return b"" + grpc_server_instrumentor = GrpcInstrumentorServer() + grpc_server_instrumentor.instrument() + with self.server(max_workers=1) as (server, channel): + server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) rpc_call = "TestServicer/handler" try: server.start() @@ -117,8 +128,7 @@ def handler(request, context): self.assertSpanHasAttributes( span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "handler", SpanAttributes.RPC_SERVICE: "TestServicer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -137,17 +147,8 @@ def handler(request, context): grpc_server_instrumentor = GrpcInstrumentorServer() grpc_server_instrumentor.instrument() grpc_server_instrumentor.uninstrument() - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - ) - + with self.server(max_workers=1) as (server, channel): server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) - - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") - rpc_call = "TestServicer/test" try: server.start() @@ -164,15 +165,11 @@ def test_create_span(self): # Intercept gRPC calls... interceptor = server_interceptor() - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): add_GRPCTestServerServicer_to_server(Servicer(), server) - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") rpc_call = "/GRPCTestServer/SimpleMethod" request = Request(client_id=1, request_data="test") @@ -199,8 +196,7 @@ def test_create_span(self): self.assertSpanHasAttributes( span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "SimpleMethod", SpanAttributes.RPC_SERVICE: "GRPCTestServer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -231,15 +227,11 @@ def SimpleMethod(self, request, context): interceptor = server_interceptor() # setup the server - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): add_GRPCTestServerServicer_to_server(TwoSpanServicer(), server) - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") # setup the RPC rpc_call = "/GRPCTestServer/SimpleMethod" @@ -268,8 +260,7 @@ def SimpleMethod(self, request, context): self.assertSpanHasAttributes( parent_span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "SimpleMethod", SpanAttributes.RPC_SERVICE: "GRPCTestServer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -292,15 +283,11 @@ def test_create_span_streaming(self): # Intercept gRPC calls... interceptor = server_interceptor() - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): add_GRPCTestServerServicer_to_server(Servicer(), server) - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") # setup the RPC rpc_call = "/GRPCTestServer/ServerStreamingMethod" @@ -328,8 +315,7 @@ def test_create_span_streaming(self): self.assertSpanHasAttributes( span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "ServerStreamingMethod", SpanAttributes.RPC_SERVICE: "GRPCTestServer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -360,15 +346,11 @@ def ServerStreamingMethod(self, request, context): # Intercept gRPC calls... interceptor = server_interceptor() - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): add_GRPCTestServerServicer_to_server(TwoSpanServicer(), server) - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") # setup the RPC rpc_call = "/GRPCTestServer/ServerStreamingMethod" @@ -397,8 +379,7 @@ def ServerStreamingMethod(self, request, context): self.assertSpanHasAttributes( parent_span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "ServerStreamingMethod", SpanAttributes.RPC_SERVICE: "GRPCTestServer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -427,17 +408,12 @@ def handler(request, context): active_span_in_handler = trace.get_current_span() return b"" - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") - active_span_before_call = trace.get_current_span() try: server.start() @@ -463,17 +439,12 @@ def handler(request, context): active_spans_in_handler.append(trace.get_current_span()) return b"" - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") - try: server.start() channel.unary_unary("TestServicer/handler")(b"") @@ -496,8 +467,7 @@ def handler(request, context): self.assertSpanHasAttributes( span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "handler", SpanAttributes.RPC_SERVICE: "TestServicer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -527,17 +497,12 @@ def handler(request, context): active_spans_in_handler.append(trace.get_current_span()) return b"" - with futures.ThreadPoolExecutor(max_workers=2) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) + with self.server( + max_workers=2, + interceptors=[interceptor], + ) as (server, channel): server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") - try: server.start() # Interleave calls so spans are active on each thread at the same @@ -568,8 +533,7 @@ def handler(request, context): self.assertSpanHasAttributes( span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "handler", SpanAttributes.RPC_SERVICE: "TestServicer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -592,18 +556,11 @@ def test_abort(self): def handler(request, context): context.abort(grpc.StatusCode.FAILED_PRECONDITION, failure_message) - with futures.ThreadPoolExecutor(max_workers=1) as executor: - server = grpc.server( - executor, - options=(("grpc.so_reuseport", 0),), - interceptors=[interceptor], - ) - + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) - - port = server.add_insecure_port("[::]:0") - channel = grpc.insecure_channel(f"localhost:{port:d}") - rpc_call = "TestServicer/handler" server.start() @@ -635,8 +592,7 @@ def handler(request, context): self.assertSpanHasAttributes( span, { - SpanAttributes.NET_PEER_IP: "[::1]", - SpanAttributes.NET_PEER_NAME: "localhost", + **self.net_peer_span_attributes, SpanAttributes.RPC_METHOD: "handler", SpanAttributes.RPC_SERVICE: "TestServicer", SpanAttributes.RPC_SYSTEM: "grpc", @@ -647,6 +603,28 @@ def handler(request, context): ) +class TestOpenTelemetryServerInterceptorUnix( + TestOpenTelemetryServerInterceptor, +): + net_peer_span_attributes = {} + + @contextlib.contextmanager + def server(self, max_workers=1, interceptors=None): + with futures.ThreadPoolExecutor( + max_workers=max_workers + ) as executor, tempfile.TemporaryDirectory() as tmp: + server = grpc.server( + executor, + options=(("grpc.so_reuseport", 0),), + interceptors=interceptors or [], + ) + + sock = f"unix://{tmp}/grpc.sock" + server.add_insecure_port(sock) + channel = grpc.insecure_channel(sock) + yield server, channel + + def get_latch(num): """Get a countdown latch function for use in n threads.""" cv = threading.Condition() From 256d8ce12d28d80586446f94e14fa59a91596230 Mon Sep 17 00:00:00 2001 From: Iman Shafiei Date: Wed, 21 Jun 2023 13:56:38 -0700 Subject: [PATCH 030/200] Add http.server.request.size for ASGI metric implementation (#1867) * Update changelog file. * Update changelog file. * Add new request.size metric for ASGI middleware. * Clean-up. * Refactor try except section. --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 ++ .../instrumentation/asgi/__init__.py | 15 +++++++++++++++ .../tests/test_asgi_middleware.py | 8 +++++++- .../tests/test_fastapi_instrumentation.py | 19 +++++++++++++++++-- .../tests/test_starlette_instrumentation.py | 16 ++++++++++++++-- 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad6f969aa1..9aeb2e2cd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +- `opentelemetry-instrumentation-asgi` Add `http.server.request.size` metric + ([#1867](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1867)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index 1ee25ae7d9..a1fa1f8e31 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -511,6 +511,11 @@ def __init__( unit="By", description="measures the size of HTTP response messages (compressed).", ) + self.server_request_size_histogram = self.meter.create_histogram( + name=MetricInstruments.HTTP_SERVER_REQUEST_SIZE, + unit="By", + description="Measures the size of HTTP request messages (compressed).", + ) self.active_requests_counter = self.meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, unit="requests", @@ -603,6 +608,16 @@ async def __call__(self, scope, receive, send): self.server_response_size_histogram.record( self.content_length_header, duration_attrs ) + request_size = asgi_getter.get(scope, "content-length") + if request_size: + try: + request_size_amount = int(request_size[0]) + except ValueError: + pass + else: + self.server_request_size_histogram.record( + request_size_amount, duration_attrs + ) if token: context.detach(token) diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 0a0c2c301f..8ca82d0226 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -47,16 +47,19 @@ "http.server.active_requests", "http.server.duration", "http.server.response.size", + "http.server.request.size", ] _recommended_attrs = { "http.server.active_requests": _active_requests_count_attrs, "http.server.duration": _duration_attrs, "http.server.response.size": _duration_attrs, + "http.server.request.size": _duration_attrs, } async def http_app(scope, receive, send): message = await receive() + scope["headers"] = [(b"content-length", b"128")] assert scope["type"] == "http" if message.get("type") == "http.request": await send( @@ -99,6 +102,7 @@ async def error_asgi(scope, receive, send): assert isinstance(scope, dict) assert scope["type"] == "http" message = await receive() + scope["headers"] = [(b"content-length", b"128")] if message.get("type") == "http.request": try: raise ValueError @@ -592,6 +596,8 @@ def test_basic_metric_success(self): ) elif metric.name == "http.server.response.size": self.assertEqual(1024, point.sum) + elif metric.name == "http.server.request.size": + self.assertEqual(128, point.sum) elif isinstance(point, NumberDataPoint): self.assertDictEqual( expected_requests_count_attributes, @@ -630,7 +636,7 @@ async def target_asgi(scope, receive, send): expected_target, ) assertions += 1 - self.assertEqual(assertions, 2) + self.assertEqual(assertions, 3) def test_no_metric_for_websockets(self): self.scope = { diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index 7f12d6e3f3..4269dfa2e4 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -45,6 +45,7 @@ "http.server.active_requests", "http.server.duration", "http.server.response.size", + "http.server.request.size", ] _recommended_attrs = { "http.server.active_requests": _active_requests_count_attrs, @@ -53,6 +54,10 @@ *_duration_attrs, SpanAttributes.HTTP_TARGET, }, + "http.server.request.size": { + *_duration_attrs, + SpanAttributes.HTTP_TARGET, + }, } @@ -251,8 +256,13 @@ def test_basic_metric_success(self): def test_basic_post_request_metric_success(self): start = default_timer() - self._client.post("/foobar") + response = self._client.post( + "/foobar", + json={"foo": "bar"}, + ) duration = max(round((default_timer() - start) * 1000), 0) + response_size = int(response.headers.get("content-length")) + request_size = int(response.request.headers.get("content-length")) metrics_list = self.memory_metrics_reader.get_metrics_data() for metric in ( metrics_list.resource_metrics[0].scope_metrics[0].metrics @@ -260,7 +270,12 @@ def test_basic_post_request_metric_success(self): for point in list(metric.data.data_points): if isinstance(point, HistogramDataPoint): self.assertEqual(point.count, 1) - self.assertAlmostEqual(duration, point.sum, delta=30) + if metric.name == "http.server.duration": + self.assertAlmostEqual(duration, point.sum, delta=30) + elif metric.name == "http.server.response.size": + self.assertEqual(response_size, point.sum) + elif metric.name == "http.server.request.size": + self.assertEqual(request_size, point.sum) if isinstance(point, NumberDataPoint): self.assertEqual(point.value, 0) diff --git a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py index 2a53bdffb7..e1c77312a4 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py @@ -50,11 +50,13 @@ "http.server.active_requests", "http.server.duration", "http.server.response.size", + "http.server.request.size", ] _recommended_attrs = { "http.server.active_requests": _active_requests_count_attrs, "http.server.duration": _duration_attrs, "http.server.response.size": _duration_attrs, + "http.server.request.size": _duration_attrs, } @@ -165,8 +167,13 @@ def test_basic_post_request_metric_success(self): "http.scheme": "http", "http.server_name": "testserver", } - self._client.post("/foobar") + response = self._client.post( + "/foobar", + json={"foo": "bar"}, + ) duration = max(round((default_timer() - start) * 1000), 0) + response_size = int(response.headers.get("content-length")) + request_size = int(response.request.headers.get("content-length")) metrics_list = self.memory_metrics_reader.get_metrics_data() for metric in ( metrics_list.resource_metrics[0].scope_metrics[0].metrics @@ -174,10 +181,15 @@ def test_basic_post_request_metric_success(self): for point in list(metric.data.data_points): if isinstance(point, HistogramDataPoint): self.assertEqual(point.count, 1) - self.assertAlmostEqual(duration, point.sum, delta=30) self.assertDictEqual( dict(point.attributes), expected_duration_attributes ) + if metric.name == "http.server.duration": + self.assertAlmostEqual(duration, point.sum, delta=30) + elif metric.name == "http.server.response.size": + self.assertEqual(response_size, point.sum) + elif metric.name == "http.server.request.size": + self.assertEqual(request_size, point.sum) if isinstance(point, NumberDataPoint): self.assertDictEqual( expected_requests_count_attributes, From c9004bd375c02171085f2b103cda2349ba8de954 Mon Sep 17 00:00:00 2001 From: Nimrod Shlagman Date: Sun, 25 Jun 2023 07:44:57 +0300 Subject: [PATCH 031/200] Fix elastic-search sanitization for bulk queries (#1870) * support sanitization for str body response * add CHANGELOG entry --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 ++ .../src/opentelemetry/instrumentation/elasticsearch/utils.py | 4 ++++ .../tests/test_elasticsearch.py | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aeb2e2cd4..a9c0097431 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fix elastic-search instrumentation sanitization to support bulk queries + ([#1870](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1870)) - Update falcon instrumentation to follow semantic conventions ([#1824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1824)) diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/utils.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/utils.py index ca4a466bab..97f2bc3b87 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/utils.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/utils.py @@ -11,6 +11,7 @@ # 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. +import json sanitized_keys = ( "message", @@ -51,6 +52,9 @@ def _unflatten_dict(d): def sanitize_body(body) -> str: + if isinstance(body, str): + body = json.loads(body) + flatten_body = _flatten_dict(body) for key in flatten_body: diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py index 02bf3eb591..df91fe6d65 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py @@ -479,3 +479,7 @@ def test_body_sanitization(self, _): sanitize_body(sanitization_queries.filter_query), str(sanitization_queries.filter_query_sanitized), ) + self.assertEqual( + sanitize_body(json.dumps(sanitization_queries.interval_query)), + str(sanitization_queries.interval_query_sanitized), + ) From e70437a36ea8d153c0fa11b9ceb575f7001ad744 Mon Sep 17 00:00:00 2001 From: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Date: Sat, 24 Jun 2023 22:25:09 -0700 Subject: [PATCH 032/200] Add conditional elastic_transport import (#1810) * Add conditional elastic_transport import * Update changelog * Add future es8 tests * Update CHANGELOG.md Co-authored-by: Diego Hurtado * Add license, rm pylint disable * Consistent elastic version check * lint import * Update CHANGELOG.md --------- Co-authored-by: Diego Hurtado Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 + .../instrumentation/elasticsearch/__init__.py | 38 ++++++++++++----- .../tests/helpers_es8.py | 41 +++++++++++++++++++ .../tests/test_elasticsearch.py | 4 +- tox.ini | 2 + 5 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py diff --git a/CHANGELOG.md b/CHANGELOG.md index a9c0097431..ea4843f843 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1789](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1789)) - `opentelemetry-instrumentation-grpc` Allow gRPC connections via Unix socket ([#1833](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1833)) +- Fix elasticsearch `Transport.perform_request` instrument wrap for elasticsearch >= 8 + ([#1810](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1810)) ## Version 1.18.0/0.39b0 (2023-05-10) diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py index d39c172c6a..480ccb6402 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py @@ -98,6 +98,12 @@ def response_hook(span, response): from .utils import sanitize_body +# Split of elasticsearch and elastic_transport in 8.0.0+ +# https://www.elastic.co/guide/en/elasticsearch/client/python-api/master/release-notes.html#rn-8-0-0 +es_transport_split = elasticsearch.VERSION[0] > 7 +if es_transport_split: + import elastic_transport + logger = getLogger(__name__) @@ -137,16 +143,28 @@ def _instrument(self, **kwargs): tracer = get_tracer(__name__, __version__, tracer_provider) request_hook = kwargs.get("request_hook") response_hook = kwargs.get("response_hook") - _wrap( - elasticsearch, - "Transport.perform_request", - _wrap_perform_request( - tracer, - self._span_name_prefix, - request_hook, - response_hook, - ), - ) + if es_transport_split: + _wrap( + elastic_transport, + "Transport.perform_request", + _wrap_perform_request( + tracer, + self._span_name_prefix, + request_hook, + response_hook, + ), + ) + else: + _wrap( + elasticsearch, + "Transport.perform_request", + _wrap_perform_request( + tracer, + self._span_name_prefix, + request_hook, + response_hook, + ), + ) def _uninstrument(self, **kwargs): unwrap(elasticsearch.Transport, "perform_request") diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py new file mode 100644 index 0000000000..04ed2efda2 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/helpers_es8.py @@ -0,0 +1,41 @@ +# 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. + +from elasticsearch_dsl import Document, Keyword, Text + + +class Article(Document): + title = Text(analyzer="snowball", fields={"raw": Keyword()}) + body = Text(analyzer="snowball") + + class Index: + name = "test-index" + + +dsl_create_statement = { + "mappings": { + "properties": { + "title": { + "analyzer": "snowball", + "fields": {"raw": {"type": "keyword"}}, + "type": "text", + }, + "body": {"analyzer": "snowball", "type": "text"}, + } + } +} +dsl_index_result = (1, {}, '{"result": "created"}') +dsl_index_span_name = "Elasticsearch/test-index/_doc/2" +dsl_index_url = "/test-index/_doc/2" +dsl_search_method = "POST" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py index df91fe6d65..37dd5f9cd7 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py @@ -37,7 +37,9 @@ major_version = elasticsearch.VERSION[0] -if major_version == 7: +if major_version == 8: + from . import helpers_es8 as helpers # pylint: disable=no-name-in-module +elif major_version == 7: from . import helpers_es7 as helpers # pylint: disable=no-name-in-module elif major_version == 6: from . import helpers_es6 as helpers # pylint: disable=no-name-in-module diff --git a/tox.ini b/tox.ini index 2313eab1d2..c7d4c56193 100644 --- a/tox.ini +++ b/tox.ini @@ -255,6 +255,8 @@ deps = ; FIXME: Elasticsearch >=7 causes CI workflow tests to hang, see open-telemetry/opentelemetry-python-contrib#620 ; elasticsearch7: elasticsearch-dsl>=7.0,<8.0 ; elasticsearch7: elasticsearch>=7.0,<8.0 + ; elasticsearch8: elasticsearch-dsl>=8.0,<9.0 + ; elasticsearch8: elasticsearch>=8.0,<9.0 falcon1: falcon ==1.4.1 falcon2: falcon >=2.0.0,<3.0.0 falcon3: falcon >=3.0.0,<4.0.0 From cd6b024327a53e3cd81249068a372129f68efaf4 Mon Sep 17 00:00:00 2001 From: Vivanov98 <66319645+Vivanov98@users.noreply.github.com> Date: Sun, 25 Jun 2023 13:03:54 +0100 Subject: [PATCH 033/200] Fix async redis clients tracing (#1830) * Fix async redis clients tracing * Update changelog * Add functional integration tests and fix linting issues --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 1 + .../instrumentation/redis/__init__.py | 122 +++++++++++----- .../tests/test_redis.py | 49 +++++++ .../tests/redis/test_redis_functional.py | 132 ++++++++++++++++++ 4 files changed, 270 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea4843f843..82fd3a23fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Fix async redis clients not being traced correctly ([#1830](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1830)) - Make Flask request span attributes available for `start_span`. ([#1784](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1784)) - Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR. diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py index 3c8acdef31..ba4b8d529e 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py @@ -136,6 +136,43 @@ def _set_connection_attributes(span, conn): span.set_attribute(key, value) +def _build_span_name(instance, cmd_args): + if len(cmd_args) > 0 and cmd_args[0]: + name = cmd_args[0] + else: + name = instance.connection_pool.connection_kwargs.get("db", 0) + return name + + +def _build_span_meta_data_for_pipeline(instance): + try: + command_stack = ( + instance.command_stack + if hasattr(instance, "command_stack") + else instance._command_stack + ) + + cmds = [ + _format_command_args(c.args if hasattr(c, "args") else c[0]) + for c in command_stack + ] + resource = "\n".join(cmds) + + span_name = " ".join( + [ + (c.args[0] if hasattr(c, "args") else c[0][0]) + for c in command_stack + ] + ) + except (AttributeError, IndexError): + command_stack = [] + resource = "" + span_name = "" + + return command_stack, resource, span_name + + +# pylint: disable=R0915 def _instrument( tracer, request_hook: _RequestHookT = None, @@ -143,11 +180,8 @@ def _instrument( ): def _traced_execute_command(func, instance, args, kwargs): query = _format_command_args(args) + name = _build_span_name(instance, args) - if len(args) > 0 and args[0]: - name = args[0] - else: - name = instance.connection_pool.connection_kwargs.get("db", 0) with tracer.start_as_current_span( name, kind=trace.SpanKind.CLIENT ) as span: @@ -163,31 +197,11 @@ def _traced_execute_command(func, instance, args, kwargs): return response def _traced_execute_pipeline(func, instance, args, kwargs): - try: - command_stack = ( - instance.command_stack - if hasattr(instance, "command_stack") - else instance._command_stack - ) - - cmds = [ - _format_command_args( - c.args if hasattr(c, "args") else c[0], - ) - for c in command_stack - ] - resource = "\n".join(cmds) - - span_name = " ".join( - [ - (c.args[0] if hasattr(c, "args") else c[0][0]) - for c in command_stack - ] - ) - except (AttributeError, IndexError): - command_stack = [] - resource = "" - span_name = "" + ( + command_stack, + resource, + span_name, + ) = _build_span_meta_data_for_pipeline(instance) with tracer.start_as_current_span( span_name, kind=trace.SpanKind.CLIENT @@ -232,32 +246,72 @@ def _traced_execute_pipeline(func, instance, args, kwargs): "ClusterPipeline.execute", _traced_execute_pipeline, ) + + async def _async_traced_execute_command(func, instance, args, kwargs): + query = _format_command_args(args) + name = _build_span_name(instance, args) + + with tracer.start_as_current_span( + name, kind=trace.SpanKind.CLIENT + ) as span: + if span.is_recording(): + span.set_attribute(SpanAttributes.DB_STATEMENT, query) + _set_connection_attributes(span, instance) + span.set_attribute("db.redis.args_length", len(args)) + if callable(request_hook): + request_hook(span, instance, args, kwargs) + response = await func(*args, **kwargs) + if callable(response_hook): + response_hook(span, instance, response) + return response + + async def _async_traced_execute_pipeline(func, instance, args, kwargs): + ( + command_stack, + resource, + span_name, + ) = _build_span_meta_data_for_pipeline(instance) + + with tracer.start_as_current_span( + span_name, kind=trace.SpanKind.CLIENT + ) as span: + if span.is_recording(): + span.set_attribute(SpanAttributes.DB_STATEMENT, resource) + _set_connection_attributes(span, instance) + span.set_attribute( + "db.redis.pipeline_length", len(command_stack) + ) + response = await func(*args, **kwargs) + if callable(response_hook): + response_hook(span, instance, response) + return response + if redis.VERSION >= _REDIS_ASYNCIO_VERSION: wrap_function_wrapper( "redis.asyncio", f"{redis_class}.execute_command", - _traced_execute_command, + _async_traced_execute_command, ) wrap_function_wrapper( "redis.asyncio.client", f"{pipeline_class}.execute", - _traced_execute_pipeline, + _async_traced_execute_pipeline, ) wrap_function_wrapper( "redis.asyncio.client", f"{pipeline_class}.immediate_execute_command", - _traced_execute_command, + _async_traced_execute_command, ) if redis.VERSION >= _REDIS_ASYNCIO_CLUSTER_VERSION: wrap_function_wrapper( "redis.asyncio.cluster", "RedisCluster.execute_command", - _traced_execute_command, + _async_traced_execute_command, ) wrap_function_wrapper( "redis.asyncio.cluster", "ClusterPipeline.execute", - _traced_execute_pipeline, + _async_traced_execute_pipeline, ) diff --git a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py index cc6e7de75a..11e56ad953 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py +++ b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py @@ -11,9 +11,11 @@ # 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. +import asyncio from unittest import mock import redis +import redis.asyncio from opentelemetry import trace from opentelemetry.instrumentation.redis import RedisInstrumentor @@ -21,6 +23,24 @@ from opentelemetry.trace import SpanKind +class AsyncMock: + """A sufficient async mock implementation. + + Python 3.7 doesn't have an inbuilt async mock class, so this is used. + """ + + def __init__(self): + self.mock = mock.Mock() + + async def __call__(self, *args, **kwargs): + future = asyncio.Future() + future.set_result("random") + return future + + def __getattr__(self, item): + return AsyncMock() + + class TestRedis(TestBase): def setUp(self): super().setUp() @@ -87,6 +107,35 @@ def test_instrument_uninstrument(self): spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 1) + def test_instrument_uninstrument_async_client_command(self): + redis_client = redis.asyncio.Redis() + + with mock.patch.object(redis_client, "connection", AsyncMock()): + asyncio.run(redis_client.get("key")) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + self.memory_exporter.clear() + + # Test uninstrument + RedisInstrumentor().uninstrument() + + with mock.patch.object(redis_client, "connection", AsyncMock()): + asyncio.run(redis_client.get("key")) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 0) + self.memory_exporter.clear() + + # Test instrument again + RedisInstrumentor().instrument() + + with mock.patch.object(redis_client, "connection", AsyncMock()): + asyncio.run(redis_client.get("key")) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + def test_response_hook(self): redis_client = redis.Redis() connection = redis.connection.Connection() diff --git a/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py b/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py index dc9cf8b1dc..481b8d21c8 100644 --- a/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py +++ b/tests/opentelemetry-docker-tests/tests/redis/test_redis_functional.py @@ -13,6 +13,7 @@ # limitations under the License. import asyncio +from time import time_ns import redis import redis.asyncio @@ -318,6 +319,29 @@ def test_basics(self): ) self.assertEqual(span.attributes.get("db.redis.args_length"), 2) + def test_execute_command_traced_full_time(self): + """Command should be traced for coroutine execution time, not creation time.""" + coro_created_time = None + finish_time = None + + async def pipeline_simple(): + nonlocal coro_created_time + nonlocal finish_time + + # delay coroutine creation from coroutine execution + coro = self.redis_client.get("foo") + coro_created_time = time_ns() + await coro + finish_time = time_ns() + + async_call(pipeline_simple()) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + span = spans[0] + self.assertTrue(span.start_time > coro_created_time) + self.assertTrue(span.end_time < finish_time) + def test_pipeline_traced(self): async def pipeline_simple(): async with self.redis_client.pipeline( @@ -340,6 +364,35 @@ async def pipeline_simple(): ) self.assertEqual(span.attributes.get("db.redis.pipeline_length"), 3) + def test_pipeline_traced_full_time(self): + """Command should be traced for coroutine execution time, not creation time.""" + coro_created_time = None + finish_time = None + + async def pipeline_simple(): + async with self.redis_client.pipeline( + transaction=False + ) as pipeline: + nonlocal coro_created_time + nonlocal finish_time + pipeline.set("blah", 32) + pipeline.rpush("foo", "éé") + pipeline.hgetall("xxx") + + # delay coroutine creation from coroutine execution + coro = pipeline.execute() + coro_created_time = time_ns() + await coro + finish_time = time_ns() + + async_call(pipeline_simple()) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + span = spans[0] + self.assertTrue(span.start_time > coro_created_time) + self.assertTrue(span.end_time < finish_time) + def test_pipeline_immediate(self): async def pipeline_immediate(): async with self.redis_client.pipeline() as pipeline: @@ -359,6 +412,33 @@ async def pipeline_immediate(): span.attributes.get(SpanAttributes.DB_STATEMENT), "SET ? ?" ) + def test_pipeline_immediate_traced_full_time(self): + """Command should be traced for coroutine execution time, not creation time.""" + coro_created_time = None + finish_time = None + + async def pipeline_simple(): + async with self.redis_client.pipeline( + transaction=False + ) as pipeline: + nonlocal coro_created_time + nonlocal finish_time + pipeline.set("a", 1) + + # delay coroutine creation from coroutine execution + coro = pipeline.immediate_execute_command("SET", "b", 2) + coro_created_time = time_ns() + await coro + finish_time = time_ns() + + async_call(pipeline_simple()) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + span = spans[0] + self.assertTrue(span.start_time > coro_created_time) + self.assertTrue(span.end_time < finish_time) + def test_parent(self): """Ensure OpenTelemetry works with redis.""" ot_tracer = trace.get_tracer("redis_svc") @@ -408,6 +488,29 @@ def test_basics(self): ) self.assertEqual(span.attributes.get("db.redis.args_length"), 2) + def test_execute_command_traced_full_time(self): + """Command should be traced for coroutine execution time, not creation time.""" + coro_created_time = None + finish_time = None + + async def pipeline_simple(): + nonlocal coro_created_time + nonlocal finish_time + + # delay coroutine creation from coroutine execution + coro = self.redis_client.get("foo") + coro_created_time = time_ns() + await coro + finish_time = time_ns() + + async_call(pipeline_simple()) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + span = spans[0] + self.assertTrue(span.start_time > coro_created_time) + self.assertTrue(span.end_time < finish_time) + def test_pipeline_traced(self): async def pipeline_simple(): async with self.redis_client.pipeline( @@ -430,6 +533,35 @@ async def pipeline_simple(): ) self.assertEqual(span.attributes.get("db.redis.pipeline_length"), 3) + def test_pipeline_traced_full_time(self): + """Command should be traced for coroutine execution time, not creation time.""" + coro_created_time = None + finish_time = None + + async def pipeline_simple(): + async with self.redis_client.pipeline( + transaction=False + ) as pipeline: + nonlocal coro_created_time + nonlocal finish_time + pipeline.set("blah", 32) + pipeline.rpush("foo", "éé") + pipeline.hgetall("xxx") + + # delay coroutine creation from coroutine execution + coro = pipeline.execute() + coro_created_time = time_ns() + await coro + finish_time = time_ns() + + async_call(pipeline_simple()) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + span = spans[0] + self.assertTrue(span.start_time > coro_created_time) + self.assertTrue(span.end_time < finish_time) + def test_parent(self): """Ensure OpenTelemetry works with redis.""" ot_tracer = trace.get_tracer("redis_svc") From a45c9c37924d78419d3482781d17086fad5cc3a8 Mon Sep 17 00:00:00 2001 From: Shalev Roda <65566801+shalevr@users.noreply.github.com> Date: Mon, 26 Jun 2023 09:41:27 +0300 Subject: [PATCH 034/200] Update maintainers list (#1874) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09015cdd5f..167a9867d9 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,6 @@ Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telem - [Aaron Abbott](https://github.com/aabmass), Google - [Jeremy Voss](https://github.com/jeremydvoss), Microsoft - [Sanket Mehta](https://github.com/sanketmehta28), Cisco -- [Shalev Roda](https://github.com/shalevr), Cisco Emeritus Approvers: @@ -112,6 +111,7 @@ Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-t - [Diego Hurtado](https://github.com/ocelotl), Lightstep - [Leighton Chen](https://github.com/lzchen), Microsoft +- [Shalev Roda](https://github.com/shalevr), Cisco Emeritus Maintainers: From 2e49ba1af886289f46e57ae9cf0b1a201f4f3e82 Mon Sep 17 00:00:00 2001 From: Rytis Bagdziunas Date: Tue, 27 Jun 2023 10:37:27 +0200 Subject: [PATCH 035/200] Use a weak reference to sqlalchemy Engine to avoid memory leak (#1771) * Use a weak reference to sqlalchemy Engine to avoid memory leak Closes #1761 By using a weak reference to the `Engine` object, we can avoid the memory leak as disposed `Engines` get properly deallocated. Whenever `SQLAlchemy` is uninstrumented, we only trigger a removal for those event listeners which are listening for objects that haven't been garbage-collected yet. * Made a mistake in resolving the weak reference * Fixed formatting issues * Updated changelog * Added unit test to check that engine was garbage collected * Do not save engine in EngineTracer to avoid memory leak * Add an empty line to satisfy black formatter * Fix isort complaints * Fixed the issue when pool name is not set and =None * Fix formatting issue * Rebased after changes in a recent commit * Updated PR number in changelog --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 + .../instrumentation/sqlalchemy/engine.py | 53 ++++++++++++------- .../tests/test_sqlalchemy.py | 23 ++++++++ 3 files changed, 60 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82fd3a23fe..c5dfd9e601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-system-metrics` Add `process.` prefix to `runtime.memory`, `runtime.cpu.time`, and `runtime.gc_count`. Change `runtime.memory` from count to UpDownCounter. ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735)) - Add request and response hooks for GRPC instrumentation (client only) ([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706)) +- Fix memory leak in SQLAlchemy instrumentation where disposed `Engine` does not get garbage collected + ([#1771](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1771) - `opentelemetry-instrumentation-pymemcache` Update instrumentation to support pymemcache >4 ([#1764](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1764)) - `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions of confluent_kafka diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py index 9ff6057728..0e18bc9bed 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py @@ -13,6 +13,7 @@ # limitations under the License. import os import re +import weakref from sqlalchemy.event import ( # pylint: disable=no-name-in-module listen, @@ -99,11 +100,11 @@ def __init__( commenter_options=None, ): self.tracer = tracer - self.engine = engine self.connections_usage = connections_usage self.vendor = _normalize_vendor(engine.name) self.enable_commenter = enable_commenter self.commenter_options = commenter_options if commenter_options else {} + self._engine_attrs = _get_attributes_from_engine(engine) self._leading_comment_remover = re.compile(r"^/\*.*?\*/") self._register_event_listener( @@ -118,23 +119,11 @@ def __init__( self._register_event_listener(engine, "checkin", self._pool_checkin) self._register_event_listener(engine, "checkout", self._pool_checkout) - def _get_connection_string(self): - drivername = self.engine.url.drivername or "" - host = self.engine.url.host or "" - port = self.engine.url.port or "" - database = self.engine.url.database or "" - return f"{drivername}://{host}:{port}/{database}" - - def _get_pool_name(self): - if self.engine.pool.logging_name is not None: - return self.engine.pool.logging_name - return self._get_connection_string() - def _add_idle_to_connection_usage(self, value): self.connections_usage.add( value, attributes={ - "pool.name": self._get_pool_name(), + **self._engine_attrs, "state": "idle", }, ) @@ -143,7 +132,7 @@ def _add_used_to_connection_usage(self, value): self.connections_usage.add( value, attributes={ - "pool.name": self._get_pool_name(), + **self._engine_attrs, "state": "used", }, ) @@ -169,12 +158,21 @@ def _pool_checkout( @classmethod def _register_event_listener(cls, target, identifier, func, *args, **kw): listen(target, identifier, func, *args, **kw) - cls._remove_event_listener_params.append((target, identifier, func)) + cls._remove_event_listener_params.append( + (weakref.ref(target), identifier, func) + ) @classmethod def remove_all_event_listeners(cls): - for remove_params in cls._remove_event_listener_params: - remove(*remove_params) + for ( + weak_ref_target, + identifier, + func, + ) in cls._remove_event_listener_params: + # Remove an event listener only if saved weak reference points to an object + # which has not been garbage collected + if weak_ref_target() is not None: + remove(weak_ref_target(), identifier, func) cls._remove_event_listener_params.clear() def _operation_name(self, db_name, statement): @@ -300,3 +298,22 @@ def _get_attributes_from_cursor(vendor, cursor, attrs): if info.port: attrs[SpanAttributes.NET_PEER_PORT] = int(info.port) return attrs + + +def _get_connection_string(engine): + drivername = engine.url.drivername or "" + host = engine.url.host or "" + port = engine.url.port or "" + database = engine.url.database or "" + return f"{drivername}://{host}:{port}/{database}" + + +def _get_attributes_from_engine(engine): + """Set metadata attributes of the database engine""" + attrs = {} + + attrs["pool.name"] = getattr( + getattr(engine, "pool", None), "logging_name", None + ) or _get_connection_string(engine) + + return attrs diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py index 981da107db..8f706ca8c8 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py @@ -307,3 +307,26 @@ def test_no_op_tracer_provider(self): cnx.execute("SELECT 1 + 1;").fetchall() spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) + + def test_no_memory_leakage_if_engine_diposed(self): + SQLAlchemyInstrumentor().instrument() + import gc + import weakref + + from sqlalchemy import create_engine + + callback = mock.Mock() + + def make_shortlived_engine(): + engine = create_engine("sqlite:///:memory:") + # Callback will be called if engine is deallocated during garbage + # collection + weakref.finalize(engine, callback) + with engine.connect() as conn: + conn.execute("SELECT 1 + 1;").fetchall() + + for _ in range(0, 5): + make_shortlived_engine() + + gc.collect() + assert callback.call_count == 5 From 79d62b3bcd8b203cdeb4ec55fc4cc89824bbc20d Mon Sep 17 00:00:00 2001 From: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Date: Tue, 27 Jun 2023 03:43:35 -0700 Subject: [PATCH 036/200] sqlalchemy wrap_create_engine now accepts sqlcommenter options (#1873) * sqlalchemy wrap_create_engine accepts sqlcommenter options * Changelog * Lint * Fix default val * Add sqlalchemy tests * Change a default in _instrument get * Lint * More lint * Update default Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> * Update args doc * lintttt --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 1 + .../instrumentation/sqlalchemy/__init__.py | 17 +++- .../instrumentation/sqlalchemy/engine.py | 20 +++- .../tests/test_sqlalchemy.py | 97 +++++++++++++++++++ .../tests/test_sqlcommenter.py | 18 ++++ 5 files changed, 146 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5dfd9e601..afa5e795ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1870](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1870)) - Update falcon instrumentation to follow semantic conventions ([#1824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1824)) +- Fix sqlalchemy instrumentation wrap methods to accept sqlcommenter options([#1873](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1873)) ### Added diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py index 77db23b417..84eeb59541 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py @@ -134,6 +134,9 @@ def _instrument(self, **kwargs): ``engine``: a SQLAlchemy engine instance ``engines``: a list of SQLAlchemy engine instances ``tracer_provider``: a TracerProvider, defaults to global + ``meter_provider``: a MeterProvider, defaults to global + ``enable_commenter``: bool to enable sqlcommenter, defaults to False + ``commenter_options``: dict of sqlcommenter config, defaults to None Returns: An instrumented engine if passed in as an argument or list of instrumented engines, None otherwise. @@ -151,16 +154,21 @@ def _instrument(self, **kwargs): ) enable_commenter = kwargs.get("enable_commenter", False) + commenter_options = kwargs.get("commenter_options", {}) _w( "sqlalchemy", "create_engine", - _wrap_create_engine(tracer, connections_usage, enable_commenter), + _wrap_create_engine( + tracer, connections_usage, enable_commenter, commenter_options + ), ) _w( "sqlalchemy.engine", "create_engine", - _wrap_create_engine(tracer, connections_usage, enable_commenter), + _wrap_create_engine( + tracer, connections_usage, enable_commenter, commenter_options + ), ) _w( "sqlalchemy.engine.base", @@ -172,7 +180,10 @@ def _instrument(self, **kwargs): "sqlalchemy.ext.asyncio", "create_async_engine", _wrap_create_async_engine( - tracer, connections_usage, enable_commenter + tracer, + connections_usage, + enable_commenter, + commenter_options, ), ) if kwargs.get("engine") is not None: diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py index 0e18bc9bed..1cf980929b 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py @@ -43,7 +43,7 @@ def _normalize_vendor(vendor): def _wrap_create_async_engine( - tracer, connections_usage, enable_commenter=False + tracer, connections_usage, enable_commenter=False, commenter_options=None ): # pylint: disable=unused-argument def _wrap_create_async_engine_internal(func, module, args, kwargs): @@ -52,20 +52,32 @@ def _wrap_create_async_engine_internal(func, module, args, kwargs): """ engine = func(*args, **kwargs) EngineTracer( - tracer, engine.sync_engine, connections_usage, enable_commenter + tracer, + engine.sync_engine, + connections_usage, + enable_commenter, + commenter_options, ) return engine return _wrap_create_async_engine_internal -def _wrap_create_engine(tracer, connections_usage, enable_commenter=False): +def _wrap_create_engine( + tracer, connections_usage, enable_commenter=False, commenter_options=None +): def _wrap_create_engine_internal(func, _module, args, kwargs): """Trace the SQLAlchemy engine, creating an `EngineTracer` object that will listen to SQLAlchemy events. """ engine = func(*args, **kwargs) - EngineTracer(tracer, engine, connections_usage, enable_commenter) + EngineTracer( + tracer, + engine, + connections_usage, + enable_commenter, + commenter_options, + ) return engine return _wrap_create_engine_internal diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py index 8f706ca8c8..f729fa6d80 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import asyncio +import logging from unittest import mock import pytest @@ -176,6 +177,43 @@ def test_create_engine_wrapper(self): "opentelemetry.instrumentation.sqlalchemy", ) + def test_create_engine_wrapper_enable_commenter(self): + logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO) + SQLAlchemyInstrumentor().instrument( + enable_commenter=True, + commenter_options={"db_framework": False}, + ) + from sqlalchemy import create_engine # pylint: disable-all + + engine = create_engine("sqlite:///:memory:") + cnx = engine.connect() + cnx.execute("SELECT 1;").fetchall() + # sqlcommenter + self.assertRegex( + self.caplog.records[-2].getMessage(), + r"SELECT 1 /\*db_driver='(.*)',traceparent='\d{1,2}-[a-zA-Z0-9_]{32}-[a-zA-Z0-9_]{16}-\d{1,2}'\*/;", + ) + + def test_create_engine_wrapper_enable_commenter_otel_values_false(self): + logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO) + SQLAlchemyInstrumentor().instrument( + enable_commenter=True, + commenter_options={ + "db_framework": False, + "opentelemetry_values": False, + }, + ) + from sqlalchemy import create_engine # pylint: disable-all + + engine = create_engine("sqlite:///:memory:") + cnx = engine.connect() + cnx.execute("SELECT 1;").fetchall() + # sqlcommenter + self.assertRegex( + self.caplog.records[-2].getMessage(), + r"SELECT 1 /\*db_driver='(.*)'\*/;", + ) + def test_custom_tracer_provider(self): provider = TracerProvider( resource=Resource.create( @@ -242,6 +280,65 @@ async def run(): asyncio.get_event_loop().run_until_complete(run()) + @pytest.mark.skipif( + not sqlalchemy.__version__.startswith("1.4"), + reason="only run async tests for 1.4", + ) + def test_create_async_engine_wrapper_enable_commenter(self): + async def run(): + logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO) + SQLAlchemyInstrumentor().instrument( + enable_commenter=True, + commenter_options={ + "db_framework": False, + }, + ) + from sqlalchemy.ext.asyncio import ( # pylint: disable-all + create_async_engine, + ) + + engine = create_async_engine("sqlite+aiosqlite:///:memory:") + async with engine.connect() as cnx: + await cnx.execute(sqlalchemy.text("SELECT 1;")) + # sqlcommenter + self.assertRegex( + self.caplog.records[1].getMessage(), + r"SELECT 1 /\*db_driver='(.*)',traceparent='\d{1,2}-[a-zA-Z0-9_]{32}-[a-zA-Z0-9_]{16}-\d{1,2}'\*/;", + ) + + asyncio.get_event_loop().run_until_complete(run()) + + @pytest.mark.skipif( + not sqlalchemy.__version__.startswith("1.4"), + reason="only run async tests for 1.4", + ) + def test_create_async_engine_wrapper_enable_commenter_otel_values_false( + self, + ): + async def run(): + logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO) + SQLAlchemyInstrumentor().instrument( + enable_commenter=True, + commenter_options={ + "db_framework": False, + "opentelemetry_values": False, + }, + ) + from sqlalchemy.ext.asyncio import ( # pylint: disable-all + create_async_engine, + ) + + engine = create_async_engine("sqlite+aiosqlite:///:memory:") + async with engine.connect() as cnx: + await cnx.execute(sqlalchemy.text("SELECT 1;")) + # sqlcommenter + self.assertRegex( + self.caplog.records[1].getMessage(), + r"SELECT 1 /\*db_driver='(.*)'\*/;", + ) + + asyncio.get_event_loop().run_until_complete(run()) + def test_uninstrument(self): engine = create_engine("sqlite:///:memory:") SQLAlchemyInstrumentor().instrument( diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlcommenter.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlcommenter.py index 5f9e75a1aa..f13c552bf4 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlcommenter.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlcommenter.py @@ -56,6 +56,24 @@ def test_sqlcommenter_enabled(self): r"SELECT 1 /\*db_driver='(.*)',traceparent='\d{1,2}-[a-zA-Z0-9_]{32}-[a-zA-Z0-9_]{16}-\d{1,2}'\*/;", ) + def test_sqlcommenter_enabled_otel_values_false(self): + engine = create_engine("sqlite:///:memory:") + SQLAlchemyInstrumentor().instrument( + engine=engine, + tracer_provider=self.tracer_provider, + enable_commenter=True, + commenter_options={ + "db_framework": False, + "opentelemetry_values": False, + }, + ) + cnx = engine.connect() + cnx.execute("SELECT 1;").fetchall() + self.assertRegex( + self.caplog.records[-2].getMessage(), + r"SELECT 1 /\*db_driver='(.*)'\*/;", + ) + def test_sqlcommenter_flask_integration(self): engine = create_engine("sqlite:///:memory:") SQLAlchemyInstrumentor().instrument( From a1f60446721a924d0c5dff8bc422ce93bb15e69b Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 28 Jun 2023 12:29:01 +0200 Subject: [PATCH 037/200] Add statement of maintainership (#1859) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 167a9867d9..ce1f8f3df4 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ depend on `opentelemetry-sdk` or another package that implements the API. **Please note** that these libraries are currently in _beta_, and shouldn't generally be used in production environments. +Unless explicitly stated otherwise, any instrumentation here for a particular library is not developed or maintained by the authors of such library. + The [`instrumentation/`](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation) directory includes OpenTelemetry instrumentation packages, which can be installed From dadcd01524449ddee07a8d8405890a60caeb8c8e Mon Sep 17 00:00:00 2001 From: Mario Jonke Date: Mon, 3 Jul 2023 23:49:20 +0200 Subject: [PATCH 038/200] urllib3: Add instrumentation support for version 2 (#1879) * urllib3: Add instrumentation support for version 2 * changelog --- CHANGELOG.md | 2 ++ instrumentation/README.md | 2 +- .../pyproject.toml | 2 +- .../opentelemetry/instrumentation/urllib3/package.py | 2 +- .../tests/test_urllib3_integration.py | 4 +++- .../tests/test_urllib3_metrics.py | 2 +- .../opentelemetry/instrumentation/bootstrap_gen.py | 2 +- tox.ini | 12 +++++++----- 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afa5e795ef..a98a9be176 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1833](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1833)) - Fix elasticsearch `Transport.perform_request` instrument wrap for elasticsearch >= 8 ([#1810](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1810)) +- `opentelemetry-instrumentation-urllib3` Add support for urllib3 version 2 + ([#1879](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1879)) ## Version 1.18.0/0.39b0 (2023-05-10) diff --git a/instrumentation/README.md b/instrumentation/README.md index 933e9b763d..940339a1a1 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -41,5 +41,5 @@ | [opentelemetry-instrumentation-tornado](./opentelemetry-instrumentation-tornado) | tornado >= 5.1.1 | Yes | [opentelemetry-instrumentation-tortoiseorm](./opentelemetry-instrumentation-tortoiseorm) | tortoise-orm >= 0.17.0 | No | [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib | Yes -| [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 2.0.0 | Yes +| [opentelemetry-instrumentation-urllib3](./opentelemetry-instrumentation-urllib3) | urllib3 >= 1.0.0, < 3.0.0 | Yes | [opentelemetry-instrumentation-wsgi](./opentelemetry-instrumentation-wsgi) | wsgi | Yes \ No newline at end of file diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index be52c117f1..167931228a 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "urllib3 >= 1.0.0, < 2.0.0", + "urllib3 >= 1.0.0, < 3.0.0", ] test = [ "opentelemetry-instrumentation-urllib3[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/package.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/package.py index 2f5df62de8..9d52db0a1f 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/package.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/package.py @@ -13,6 +13,6 @@ # limitations under the License. -_instruments = ("urllib3 >= 1.0.0, < 2.0.0",) +_instruments = ("urllib3 >= 1.0.0, < 3.0.0",) _supports_metrics = True diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py index 1082776f9a..7ba7e2731b 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py @@ -328,7 +328,9 @@ def response_hook(span, request, response): def test_request_hook_params(self): def request_hook(span, request, headers, body): - span.set_attribute("request_hook_headers", json.dumps(headers)) + span.set_attribute( + "request_hook_headers", json.dumps(dict(headers)) + ) span.set_attribute("request_hook_body", body) URLLib3Instrumentor().uninstrument() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py index 6bf61a9fd8..2fd4cb2c5c 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py @@ -18,7 +18,7 @@ import httpretty import urllib3 import urllib3.exceptions -from urllib3.request import encode_multipart_formdata +from urllib3 import encode_multipart_formdata from opentelemetry.instrumentation.urllib3 import URLLib3Instrumentor from opentelemetry.test.httptest import HttpTestBase diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 1e0b9fd2f5..c67c4642dd 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -161,7 +161,7 @@ "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.40b0.dev", }, "urllib3": { - "library": "urllib3 >= 1.0.0, < 2.0.0", + "library": "urllib3 >= 1.0.0, < 3.0.0", "instrumentation": "opentelemetry-instrumentation-urllib3==0.40b0.dev", }, } diff --git a/tox.ini b/tox.ini index c7d4c56193..b0d33dfebc 100644 --- a/tox.ini +++ b/tox.ini @@ -92,8 +92,8 @@ envlist = pypy3-test-instrumentation-urllib ; opentelemetry-instrumentation-urllib3 - py3{7,8,9,10,11}-test-instrumentation-urllib3 - ;pypy3-test-instrumentation-urllib3 + py3{7,8,9,10,11}-test-instrumentation-urllib3v{1,2} + ;pypy3-test-instrumentation-urllib3v{1,2} ; opentelemetry-instrumentation-requests py3{7,8,9,10,11}-test-instrumentation-requests @@ -280,6 +280,8 @@ deps = httpx18: respx~=0.17.0 httpx21: httpx>=0.19.0 httpx21: respx~=0.20.1 + urllib3v1: urllib3 >=1.0.0,<2.0.0 + urllib3v2: urllib3 >=2.0.0,<3.0.0 ; FIXME: add coverage testing ; FIXME: add mypy testing @@ -310,7 +312,7 @@ changedir = test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests test-instrumentation-flask{213,220}: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests - test-instrumentation-urllib3: instrumentation/opentelemetry-instrumentation-urllib3/tests + test-instrumentation-urllib3v{1,2}: instrumentation/opentelemetry-instrumentation-urllib3/tests test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests test-instrumentation-jinja2: instrumentation/opentelemetry-instrumentation-jinja2/tests test-instrumentation-kafka-python: instrumentation/opentelemetry-instrumentation-kafka-python/tests @@ -369,7 +371,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3,wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] + falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3v{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] wsgi,falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] asgi,django{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] @@ -388,7 +390,7 @@ commands_pre = urllib: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] - urllib3: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] + urllib3v{1,2}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] From db90ce38a2a9f48f225ea63bab1d295deeaff764 Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Tue, 11 Jul 2023 13:26:14 -0700 Subject: [PATCH 039/200] Distro selection (#1823) --- CHANGELOG.md | 6 +- opentelemetry-instrumentation/README.rst | 7 +- .../auto_instrumentation/_load.py | 124 +++++++ .../auto_instrumentation/sitecustomize.py | 93 +----- .../instrumentation/environment_variables.py | 10 + .../tests/auto_instrumentation/test_load.py | 312 ++++++++++++++++++ .../{ => auto_instrumentation}/test_run.py | 0 7 files changed, 461 insertions(+), 91 deletions(-) create mode 100644 opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py create mode 100644 opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py rename opentelemetry-instrumentation/tests/{ => auto_instrumentation}/test_run.py (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a98a9be176..618eb4910f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1810](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1810)) - `opentelemetry-instrumentation-urllib3` Add support for urllib3 version 2 ([#1879](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1879)) +- Add optional distro and configurator selection for auto-instrumentation + ([#1823](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1823)) ## Version 1.18.0/0.39b0 (2023-05-10) @@ -44,7 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add request and response hooks for GRPC instrumentation (client only) ([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706)) - Fix memory leak in SQLAlchemy instrumentation where disposed `Engine` does not get garbage collected - ([#1771](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1771) + ([#1771](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1771)) - `opentelemetry-instrumentation-pymemcache` Update instrumentation to support pymemcache >4 ([#1764](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1764)) - `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions of confluent_kafka @@ -86,7 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update HTTP server/client instrumentation span names to comply with spec - ([#1759](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1759) + ([#1759](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1759)) ## Version 1.17.0/0.38b0 (2023-03-22) diff --git a/opentelemetry-instrumentation/README.rst b/opentelemetry-instrumentation/README.rst index 95b8fe582b..df21ce5b3d 100644 --- a/opentelemetry-instrumentation/README.rst +++ b/opentelemetry-instrumentation/README.rst @@ -18,12 +18,15 @@ This package provides a couple of commands that help automatically instruments a .. note:: You need to install a distro package to get auto instrumentation working. The ``opentelemetry-distro`` - package contains the default distro and automatically configures some of the common options for users. + package contains the default distro and configurator and automatically configures some of the common options for users. For more info about ``opentelemetry-distro`` check `here `__ :: pip install opentelemetry-distro[otlp] + When creating a custom distro and/or configurator, be sure to add entry points for each under `opentelemetry_distro` and `opentelemetry_configurator` respectfully. + If you have entry points for multiple distros or configurators present in your environment, you should specify the entry point name of the distro and configurator you want to be used via the `OTEL_PYTHON_DISTRO` and `OTEL_PYTHON_CONFIGURATOR` environment variables. + opentelemetry-bootstrap ----------------------- @@ -58,6 +61,8 @@ The command supports the following configuration options as CLI arguments and en * ``--traces_exporter`` or ``OTEL_TRACES_EXPORTER`` * ``--metrics_exporter`` or ``OTEL_METRICS_EXPORTER`` +* ``--distro`` or ``OTEL_PYTHON_DISTRO`` +* ``--configurator`` or ``OTEL_PYTHON_CONFIGURATOR`` Used to specify which trace exporter to use. Can be set to one or more of the well-known exporter names (see below). diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py new file mode 100644 index 0000000000..27b57da3ef --- /dev/null +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py @@ -0,0 +1,124 @@ +# 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. + +from logging import getLogger +from os import environ + +from pkg_resources import iter_entry_points + +from opentelemetry.instrumentation.dependencies import ( + get_dist_dependency_conflicts, +) +from opentelemetry.instrumentation.distro import BaseDistro, DefaultDistro +from opentelemetry.instrumentation.environment_variables import ( + OTEL_PYTHON_CONFIGURATOR, + OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, + OTEL_PYTHON_DISTRO, +) +from opentelemetry.instrumentation.version import __version__ + +_logger = getLogger(__name__) + + +def _load_distro() -> BaseDistro: + distro_name = environ.get(OTEL_PYTHON_DISTRO, None) + for entry_point in iter_entry_points("opentelemetry_distro"): + try: + # If no distro is specified, use first to come up. + if distro_name is None or distro_name == entry_point.name: + distro = entry_point.load()() + if not isinstance(distro, BaseDistro): + _logger.debug( + "%s is not an OpenTelemetry Distro. Skipping", + entry_point.name, + ) + continue + _logger.debug( + "Distribution %s will be configured", entry_point.name + ) + return distro + except Exception as exc: # pylint: disable=broad-except + _logger.exception( + "Distribution %s configuration failed", entry_point.name + ) + raise exc + return DefaultDistro() + + +def _load_instrumentors(distro): + package_to_exclude = environ.get(OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, []) + if isinstance(package_to_exclude, str): + package_to_exclude = package_to_exclude.split(",") + # to handle users entering "requests , flask" or "requests, flask" with spaces + package_to_exclude = [x.strip() for x in package_to_exclude] + + for entry_point in iter_entry_points("opentelemetry_pre_instrument"): + entry_point.load()() + + for entry_point in iter_entry_points("opentelemetry_instrumentor"): + if entry_point.name in package_to_exclude: + _logger.debug( + "Instrumentation skipped for library %s", entry_point.name + ) + continue + + try: + conflict = get_dist_dependency_conflicts(entry_point.dist) + if conflict: + _logger.debug( + "Skipping instrumentation %s: %s", + entry_point.name, + conflict, + ) + continue + + # tell instrumentation to not run dep checks again as we already did it above + distro.load_instrumentor(entry_point, skip_dep_check=True) + _logger.debug("Instrumented %s", entry_point.name) + except Exception as exc: # pylint: disable=broad-except + _logger.exception("Instrumenting of %s failed", entry_point.name) + raise exc + + for entry_point in iter_entry_points("opentelemetry_post_instrument"): + entry_point.load()() + + +def _load_configurators(): + configurator_name = environ.get(OTEL_PYTHON_CONFIGURATOR, None) + configured = None + for entry_point in iter_entry_points("opentelemetry_configurator"): + if configured is not None: + _logger.warning( + "Configuration of %s not loaded, %s already loaded", + entry_point.name, + configured, + ) + continue + try: + if ( + configurator_name is None + or configurator_name == entry_point.name + ): + entry_point.load()().configure(auto_instrumentation_version=__version__) # type: ignore + configured = entry_point.name + else: + _logger.warning( + "Configuration of %s not loaded because %s is set by %s", + entry_point.name, + configurator_name, + OTEL_PYTHON_CONFIGURATOR, + ) + except Exception as exc: # pylint: disable=broad-except + _logger.exception("Configuration of %s failed", entry_point.name) + raise exc diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py index 9504e359af..912675f1b7 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py @@ -16,99 +16,16 @@ from os import environ from os.path import abspath, dirname, pathsep -from pkg_resources import iter_entry_points - -from opentelemetry.instrumentation.dependencies import ( - get_dist_dependency_conflicts, -) -from opentelemetry.instrumentation.distro import BaseDistro, DefaultDistro -from opentelemetry.instrumentation.environment_variables import ( - OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, +from opentelemetry.instrumentation.auto_instrumentation._load import ( + _load_configurators, + _load_distro, + _load_instrumentors, ) from opentelemetry.instrumentation.utils import _python_path_without_directory -from opentelemetry.instrumentation.version import __version__ logger = getLogger(__name__) -def _load_distros() -> BaseDistro: - for entry_point in iter_entry_points("opentelemetry_distro"): - try: - distro = entry_point.load()() - if not isinstance(distro, BaseDistro): - logger.debug( - "%s is not an OpenTelemetry Distro. Skipping", - entry_point.name, - ) - continue - logger.debug( - "Distribution %s will be configured", entry_point.name - ) - return distro - except Exception as exc: # pylint: disable=broad-except - logger.exception( - "Distribution %s configuration failed", entry_point.name - ) - raise exc - return DefaultDistro() - - -def _load_instrumentors(distro): - package_to_exclude = environ.get(OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, []) - if isinstance(package_to_exclude, str): - package_to_exclude = package_to_exclude.split(",") - # to handle users entering "requests , flask" or "requests, flask" with spaces - package_to_exclude = [x.strip() for x in package_to_exclude] - - for entry_point in iter_entry_points("opentelemetry_pre_instrument"): - entry_point.load()() - - for entry_point in iter_entry_points("opentelemetry_instrumentor"): - if entry_point.name in package_to_exclude: - logger.debug( - "Instrumentation skipped for library %s", entry_point.name - ) - continue - - try: - conflict = get_dist_dependency_conflicts(entry_point.dist) - if conflict: - logger.debug( - "Skipping instrumentation %s: %s", - entry_point.name, - conflict, - ) - continue - - # tell instrumentation to not run dep checks again as we already did it above - distro.load_instrumentor(entry_point, skip_dep_check=True) - logger.debug("Instrumented %s", entry_point.name) - except Exception as exc: # pylint: disable=broad-except - logger.exception("Instrumenting of %s failed", entry_point.name) - raise exc - - for entry_point in iter_entry_points("opentelemetry_post_instrument"): - entry_point.load()() - - -def _load_configurators(): - configured = None - for entry_point in iter_entry_points("opentelemetry_configurator"): - if configured is not None: - logger.warning( - "Configuration of %s not loaded, %s already loaded", - entry_point.name, - configured, - ) - continue - try: - entry_point.load()().configure(auto_instrumentation_version=__version__) # type: ignore - configured = entry_point.name - except Exception as exc: # pylint: disable=broad-except - logger.exception("Configuration of %s failed", entry_point.name) - raise exc - - def initialize(): # prevents auto-instrumentation of subprocesses if code execs another python process environ["PYTHONPATH"] = _python_path_without_directory( @@ -116,7 +33,7 @@ def initialize(): ) try: - distro = _load_distros() + distro = _load_distro() distro.configure() _load_configurators() _load_instrumentors(distro) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/environment_variables.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/environment_variables.py index ad28f06859..7886779632 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/environment_variables.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/environment_variables.py @@ -16,3 +16,13 @@ """ .. envvar:: OTEL_PYTHON_DISABLED_INSTRUMENTATIONS """ + +OTEL_PYTHON_DISTRO = "OTEL_PYTHON_DISTRO" +""" +.. envvar:: OTEL_PYTHON_DISTRO +""" + +OTEL_PYTHON_CONFIGURATOR = "OTEL_PYTHON_CONFIGURATOR" +""" +.. envvar:: OTEL_PYTHON_CONFIGURATOR +""" diff --git a/opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py b/opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py new file mode 100644 index 0000000000..1e2a851e48 --- /dev/null +++ b/opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py @@ -0,0 +1,312 @@ +# 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. +# type: ignore + +from unittest import TestCase +from unittest.mock import Mock, call, patch + +from opentelemetry.instrumentation.auto_instrumentation import _load +from opentelemetry.instrumentation.environment_variables import ( + OTEL_PYTHON_CONFIGURATOR, + OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, + OTEL_PYTHON_DISTRO, +) +from opentelemetry.instrumentation.version import __version__ + + +class TestLoad(TestCase): + @patch.dict( + "os.environ", {OTEL_PYTHON_CONFIGURATOR: "custom_configurator2"} + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_configurators(self, iter_mock): + # Add multiple entry points but only specify the 2nd in the environment variable. + ep_mock1 = Mock() + ep_mock1.name = "custom_configurator1" + configurator_mock1 = Mock() + ep_mock1.load.return_value = configurator_mock1 + ep_mock2 = Mock() + ep_mock2.name = "custom_configurator2" + configurator_mock2 = Mock() + ep_mock2.load.return_value = configurator_mock2 + ep_mock3 = Mock() + ep_mock3.name = "custom_configurator3" + configurator_mock3 = Mock() + ep_mock3.load.return_value = configurator_mock3 + + iter_mock.return_value = (ep_mock1, ep_mock2, ep_mock3) + _load._load_configurators() + configurator_mock1.assert_not_called() + configurator_mock2().configure.assert_called_once_with( + auto_instrumentation_version=__version__ + ) + configurator_mock3.assert_not_called() + + @patch.dict( + "os.environ", {OTEL_PYTHON_CONFIGURATOR: "custom_configurator2"} + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_configurators_no_ep( + self, + iter_mock, + ): + iter_mock.return_value = () + # Confirm method does not crash if not entry points exist. + _load._load_configurators() + + @patch.dict( + "os.environ", {OTEL_PYTHON_CONFIGURATOR: "custom_configurator2"} + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_configurators_error(self, iter_mock): + # Add multiple entry points but only specify the 2nd in the environment variable. + ep_mock1 = Mock() + ep_mock1.name = "custom_configurator1" + configurator_mock1 = Mock() + ep_mock1.load.return_value = configurator_mock1 + ep_mock2 = Mock() + ep_mock2.name = "custom_configurator2" + configurator_mock2 = Mock() + configurator_mock2().configure.side_effect = Exception() + ep_mock2.load.return_value = configurator_mock2 + ep_mock3 = Mock() + ep_mock3.name = "custom_configurator3" + configurator_mock3 = Mock() + ep_mock3.load.return_value = configurator_mock3 + + iter_mock.return_value = (ep_mock1, ep_mock2, ep_mock3) + # Confirm failed configuration raises exception. + self.assertRaises(Exception, _load._load_configurators) + + @patch.dict("os.environ", {OTEL_PYTHON_DISTRO: "custom_distro2"}) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.isinstance" + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_distro(self, iter_mock, isinstance_mock): + # Add multiple entry points but only specify the 2nd in the environment variable. + ep_mock1 = Mock() + ep_mock1.name = "custom_distro1" + distro_mock1 = Mock() + ep_mock1.load.return_value = distro_mock1 + ep_mock2 = Mock() + ep_mock2.name = "custom_distro2" + distro_mock2 = Mock() + ep_mock2.load.return_value = distro_mock2 + ep_mock3 = Mock() + ep_mock3.name = "custom_distro3" + distro_mock3 = Mock() + ep_mock3.load.return_value = distro_mock3 + + iter_mock.return_value = (ep_mock1, ep_mock2, ep_mock3) + # Mock entry points to be instances of BaseDistro. + isinstance_mock.return_value = True + self.assertEqual( + _load._load_distro(), + distro_mock2(), + ) + + @patch.dict("os.environ", {OTEL_PYTHON_DISTRO: "custom_distro2"}) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.isinstance" + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.DefaultDistro" + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_distro_not_distro( + self, iter_mock, default_distro_mock, isinstance_mock + ): + # Add multiple entry points but only specify the 2nd in the environment variable. + ep_mock1 = Mock() + ep_mock1.name = "custom_distro1" + distro_mock1 = Mock() + ep_mock1.load.return_value = distro_mock1 + ep_mock2 = Mock() + ep_mock2.name = "custom_distro2" + distro_mock2 = Mock() + ep_mock2.load.return_value = distro_mock2 + ep_mock3 = Mock() + ep_mock3.name = "custom_distro3" + distro_mock3 = Mock() + ep_mock3.load.return_value = distro_mock3 + + iter_mock.return_value = (ep_mock1, ep_mock2, ep_mock3) + # Confirm default distro is used if specified entry point is not a BaseDistro + isinstance_mock.return_value = False + self.assertEqual( + _load._load_distro(), + default_distro_mock(), + ) + + @patch.dict("os.environ", {OTEL_PYTHON_DISTRO: "custom_distro2"}) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.DefaultDistro" + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_distro_no_ep(self, iter_mock, default_distro_mock): + iter_mock.return_value = () + # Confirm default distro is used if there are no entry points. + self.assertEqual( + _load._load_distro(), + default_distro_mock(), + ) + + @patch.dict("os.environ", {OTEL_PYTHON_DISTRO: "custom_distro2"}) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.isinstance" + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_distro_error(self, iter_mock, isinstance_mock): + ep_mock1 = Mock() + ep_mock1.name = "custom_distro1" + distro_mock1 = Mock() + ep_mock1.load.return_value = distro_mock1 + ep_mock2 = Mock() + ep_mock2.name = "custom_distro2" + distro_mock2 = Mock() + distro_mock2.side_effect = Exception() + ep_mock2.load.return_value = distro_mock2 + ep_mock3 = Mock() + ep_mock3.name = "custom_distro3" + distro_mock3 = Mock() + ep_mock3.load.return_value = distro_mock3 + + iter_mock.return_value = (ep_mock1, ep_mock2, ep_mock3) + isinstance_mock.return_value = True + # Confirm method raises exception if it fails to load a distro. + self.assertRaises(Exception, _load._load_distro) + + @patch.dict( + "os.environ", + {OTEL_PYTHON_DISABLED_INSTRUMENTATIONS: " instr1 , instr3 "}, + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.get_dist_dependency_conflicts" + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_instrumentors(self, iter_mock, dep_mock): + # Mock opentelemetry_pre_instrument entry points + pre_ep_mock1 = Mock() + pre_ep_mock1.name = "pre1" + pre_mock1 = Mock() + pre_ep_mock1.load.return_value = pre_mock1 + + pre_ep_mock2 = Mock() + pre_ep_mock2.name = "pre2" + pre_mock2 = Mock() + pre_ep_mock2.load.return_value = pre_mock2 + + # Mock opentelemetry_instrumentor entry points + ep_mock1 = Mock() + ep_mock1.name = "instr1" + + ep_mock2 = Mock() + ep_mock2.name = "instr2" + + ep_mock3 = Mock() + ep_mock3.name = "instr3" + + ep_mock4 = Mock() + ep_mock4.name = "instr4" + + # Mock opentelemetry_instrumentor entry points + post_ep_mock1 = Mock() + post_ep_mock1.name = "post1" + post_mock1 = Mock() + post_ep_mock1.load.return_value = post_mock1 + + post_ep_mock2 = Mock() + post_ep_mock2.name = "post2" + post_mock2 = Mock() + post_ep_mock2.load.return_value = post_mock2 + + distro_mock = Mock() + + # Mock entry points in order + iter_mock.side_effect = [ + (pre_ep_mock1, pre_ep_mock2), + (ep_mock1, ep_mock2, ep_mock3, ep_mock4), + (post_ep_mock1, post_ep_mock2), + ] + # No dependency conflict + dep_mock.return_value = None + _load._load_instrumentors(distro_mock) + # All opentelemetry_pre_instrument entry points should be loaded + pre_mock1.assert_called_once() + pre_mock2.assert_called_once() + self.assertEqual(iter_mock.call_count, 3) + # Only non-disabled instrumentations should be loaded + distro_mock.load_instrumentor.assert_has_calls( + [ + call(ep_mock2, skip_dep_check=True), + call(ep_mock4, skip_dep_check=True), + ] + ) + self.assertEqual(distro_mock.load_instrumentor.call_count, 2) + # All opentelemetry_post_instrument entry points should be loaded + post_mock1.assert_called_once() + post_mock2.assert_called_once() + + @patch.dict( + "os.environ", + {OTEL_PYTHON_DISABLED_INSTRUMENTATIONS: " instr1 , instr3 "}, + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.get_dist_dependency_conflicts" + ) + @patch( + "opentelemetry.instrumentation.auto_instrumentation._load.iter_entry_points" + ) + def test_load_instrumentors_dep_conflict(self, iter_mock, dep_mock): + ep_mock1 = Mock() + ep_mock1.name = "instr1" + + ep_mock2 = Mock() + ep_mock2.name = "instr2" + + ep_mock3 = Mock() + ep_mock3.name = "instr3" + + ep_mock4 = Mock() + ep_mock4.name = "instr4" + + distro_mock = Mock() + + iter_mock.return_value = (ep_mock1, ep_mock2, ep_mock3, ep_mock4) + # If a dependency conflict is raised, that instrumentation should not be loaded, but others still should. + dep_mock.side_effect = [None, "DependencyConflict"] + _load._load_instrumentors(distro_mock) + distro_mock.load_instrumentor.assert_has_calls( + [ + call(ep_mock2, skip_dep_check=True), + ] + ) + distro_mock.load_instrumentor.assert_called_once() diff --git a/opentelemetry-instrumentation/tests/test_run.py b/opentelemetry-instrumentation/tests/auto_instrumentation/test_run.py similarity index 100% rename from opentelemetry-instrumentation/tests/test_run.py rename to opentelemetry-instrumentation/tests/auto_instrumentation/test_run.py From acfe932f7d788fa3542ebe5fa09b3a5d002ebe69 Mon Sep 17 00:00:00 2001 From: Marc Dougherty Date: Wed, 12 Jul 2023 11:38:59 -0700 Subject: [PATCH 040/200] fix(django): avoid empty span name on empty path (#1788) Co-authored-by: Srikanth Chekuri Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Diego Hurtado --- CHANGELOG.md | 2 ++ .../django/middleware/otel_middleware.py | 5 ++++- .../tests/test_middleware.py | 17 ++++++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 618eb4910f..3dc96096ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `opentelemetry-instrumentation-django` Fix empty span name when using + `path("", ...)` ([#1788](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1788) - Fix elastic-search instrumentation sanitization to support bulk queries ([#1870](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1870)) - Update falcon instrumentation to follow semantic conventions diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py index 02313a48ee..491e78cab5 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py @@ -172,9 +172,12 @@ def _get_span_name(request): else: match = resolve(request.path) - if hasattr(match, "route"): + if hasattr(match, "route") and match.route: return f"{request.method} {match.route}" + if hasattr(match, "url_name") and match.url_name: + return f"{request.method} {match.url_name}" + return request.method except Resolver404: diff --git a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py index 1f28819df0..d7bb1e544f 100644 --- a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py @@ -74,10 +74,14 @@ DJANGO_3_0 = VERSION >= (3, 0) if DJANGO_2_0: - from django.urls import re_path + from django.urls import path, re_path else: from django.conf.urls import url as re_path + def path(path_argument, *args, **kwargs): + return re_path(rf"^{path_argument}$", *args, **kwargs) + + urlpatterns = [ re_path(r"^traced/", traced), re_path(r"^traced_custom_header/", response_with_custom_header), @@ -87,6 +91,7 @@ re_path(r"^excluded_noarg/", excluded_noarg), re_path(r"^excluded_noarg2/", excluded_noarg2), re_path(r"^span_name/([0-9]{4})/$", route_span_name), + path("", traced, name="empty"), ] _django_instrumentor = DjangoInstrumentor() @@ -205,6 +210,16 @@ def test_not_recording(self): self.assertFalse(mock_span.set_attribute.called) self.assertFalse(mock_span.set_status.called) + def test_empty_path(self): + Client().get("/") + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + + span = spans[0] + + self.assertEqual(span.name, "GET empty") + def test_traced_post(self): Client().post("/traced/") From 09efe708c3c03c7ae80683b53273f4bafa2ff07a Mon Sep 17 00:00:00 2001 From: Alexandre Papin Date: Wed, 12 Jul 2023 21:09:26 +0200 Subject: [PATCH 041/200] Instrument mysqlclient library (#1744) Co-authored-by: Diego Hurtado --- CHANGELOG.md | 17 +- docs-requirements.txt | 1 + .../mysqlclient/mysqlclient.rst | 7 + instrumentation/README.md | 1 + .../LICENSE | 201 ++++++++++++++++++ .../README.rst | 21 ++ .../pyproject.toml | 58 +++++ .../instrumentation/mysqlclient/__init__.py | 117 ++++++++++ .../instrumentation/mysqlclient/package.py | 16 ++ .../instrumentation/mysqlclient/version.py | 15 ++ .../tests/__init__.py | 0 .../tests/test_mysqlclient_integration.py | 118 ++++++++++ .../pyproject.toml | 1 + .../instrumentation/bootstrap_gen.py | 4 + tox.ini | 12 +- 15 files changed, 582 insertions(+), 7 deletions(-) create mode 100644 docs/instrumentation/mysqlclient/mysqlclient.rst create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/LICENSE create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/README.rst create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/package.py create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/tests/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/tests/test_mysqlclient_integration.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dc96096ec..90a093bfd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,16 +17,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1870](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1870)) - Update falcon instrumentation to follow semantic conventions ([#1824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1824)) -- Fix sqlalchemy instrumentation wrap methods to accept sqlcommenter options([#1873](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1873)) +- Fix sqlalchemy instrumentation wrap methods to accept sqlcommenter options + ([#1873](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1873)) ### Added -- Fix async redis clients not being traced correctly ([#1830](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1830)) +- Add instrumentor support for mysqlclient + ([#1744](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1744)) +- Fix async redis clients not being traced correctly + ([#1830](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1830)) - Make Flask request span attributes available for `start_span`. ([#1784](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1784)) - Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR. ([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840)) -- Instrument all httpx versions >= 0.18. ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748)) +- Instrument all httpx versions >= 0.18. + ([#1748](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1748)) - Fix `Invalid type NoneType for attribute X (opentelemetry-instrumentation-aws-lambda)` error when some attributes do not exist ([#1780](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1780)) - Add metric instrumentation for celery @@ -44,7 +49,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Version 1.18.0/0.39b0 (2023-05-10) -- `opentelemetry-instrumentation-system-metrics` Add `process.` prefix to `runtime.memory`, `runtime.cpu.time`, and `runtime.gc_count`. Change `runtime.memory` from count to UpDownCounter. ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735)) +- Update runtime metrics to follow semantic conventions + ([#1735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1735)) - Add request and response hooks for GRPC instrumentation (client only) ([#1706](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1706)) - Fix memory leak in SQLAlchemy instrumentation where disposed `Engine` does not get garbage collected @@ -71,8 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- `opentelemetry-instrumentation-botocore` now uses the AWS X-Ray propagator by - default +- `opentelemetry-instrumentation-botocore` now uses the AWS X-Ray propagator by default ([#1741](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1741)) ### Fixed diff --git a/docs-requirements.txt b/docs-requirements.txt index 4af8839334..b27a477ce0 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -33,6 +33,7 @@ falcon~=2.0 grpcio~=1.27 kafka-python>=2.0,<3.0 mysql-connector-python~=8.0 +mysqlclient~=2.1.1 psutil>=5 pika>=0.12.0 pymongo~=3.1 diff --git a/docs/instrumentation/mysqlclient/mysqlclient.rst b/docs/instrumentation/mysqlclient/mysqlclient.rst new file mode 100644 index 0000000000..d9c9811c31 --- /dev/null +++ b/docs/instrumentation/mysqlclient/mysqlclient.rst @@ -0,0 +1,7 @@ +OpenTelemetry mysqlclient Instrumentation +========================================= + +.. automodule:: opentelemetry.instrumentation.mysqlclient + :members: + :undoc-members: + :show-inheritance: diff --git a/instrumentation/README.md b/instrumentation/README.md index 940339a1a1..4a4e3cc6da 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -24,6 +24,7 @@ | [opentelemetry-instrumentation-kafka-python](./opentelemetry-instrumentation-kafka-python) | kafka-python >= 2.0 | No | [opentelemetry-instrumentation-logging](./opentelemetry-instrumentation-logging) | logging | No | [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python ~= 8.0 | No +| [opentelemetry-instrumentation-mysqlclient](./opentelemetry-instrumentation-mysqlclient) | mysqlclient < 3 | No | [opentelemetry-instrumentation-pika](./opentelemetry-instrumentation-pika) | pika >= 0.12.0 | No | [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 | No | [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache >= 1.3.5, < 5 | No diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/LICENSE b/instrumentation/opentelemetry-instrumentation-mysqlclient/LICENSE new file mode 100644 index 0000000000..1ef7dad2c5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + 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. diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/README.rst b/instrumentation/opentelemetry-instrumentation-mysqlclient/README.rst new file mode 100644 index 0000000000..cce21d8bca --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/README.rst @@ -0,0 +1,21 @@ +OpenTelemetry mysqlclient Instrumentation +========================================= + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-mysqlclient.svg + :target: https://pypi.org/project/opentelemetry-instrumentation-mysqlclient/ + +Installation +------------ + +:: + + pip install opentelemetry-instrumentation-mysqlclient + + +References +---------- +* `OpenTelemetry mysqlclient Instrumentation `_ +* `OpenTelemetry Project `_ +* `OpenTelemetry Python Examples `_ diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml new file mode 100644 index 0000000000..dae540f809 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-instrumentation-mysqlclient" +dynamic = ["version"] +description = "OpenTelemetry mysqlclient instrumentation" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "opentelemetry-api ~= 1.12", + "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation-dbapi == 0.40b0.dev", +] + +[project.optional-dependencies] +instruments = [ + "mysqlclient < 3", +] +test = [ + "opentelemetry-instrumentation-mysqlclient[instruments]", + "opentelemetry-test-utils == 0.40b0.dev", +] + +[project.entry-points.opentelemetry_instrumentor] +mysqlclient = "opentelemetry.instrumentation.mysqlclient:MySQLClientInstrumentor" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-mysqlclient" + +[tool.hatch.version] +path = "src/opentelemetry/instrumentation/mysqlclient/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py new file mode 100644 index 0000000000..85083cff2e --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/__init__.py @@ -0,0 +1,117 @@ +# 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. + +""" +The integration with MySQLClient supports the `MySQLClient`_ library and can be enabled +by using ``MySQLClientInstrumentor``. + +.. _MySQLClient: https://pypi.org/project/MySQLClient/ + +Usage +----- + +.. code:: python + + import MySQLdb + from opentelemetry.instrumentation.mysqlclient import MySQLClientInstrumentor + + + MySQLClientInstrumentor().instrument() + + cnx = MySQLdb.connect(database="MySQL_Database") + cursor = cnx.cursor() + cursor.execute("INSERT INTO test (testField) VALUES (123)" + cnx.commit() + cursor.close() + cnx.close() + +API +--- +""" + +from typing import Collection + +import MySQLdb + +from opentelemetry.instrumentation import dbapi +from opentelemetry.instrumentation.instrumentor import BaseInstrumentor +from opentelemetry.instrumentation.mysqlclient.package import _instruments +from opentelemetry.instrumentation.mysqlclient.version import __version__ + +_CONNECTION_ATTRIBUTES = { + "database": "db", + "port": "port", + "host": "host", + "user": "user", +} +_DATABASE_SYSTEM = "mysql" + + +class MySQLClientInstrumentor(BaseInstrumentor): + def instrumentation_dependencies(self) -> Collection[str]: + return _instruments + + def _instrument(self, **kwargs): + """Integrate with the mysqlclient library. + https://github.com/PyMySQL/mysqlclient/ + """ + tracer_provider = kwargs.get("tracer_provider") + + dbapi.wrap_connect( + __name__, + MySQLdb, + "connect", + _DATABASE_SYSTEM, + _CONNECTION_ATTRIBUTES, + version=__version__, + tracer_provider=tracer_provider, + ) + + def _uninstrument(self, **kwargs): + """ "Disable mysqlclient instrumentation""" + dbapi.unwrap_connect(MySQLdb, "connect") + + @staticmethod + def instrument_connection(connection, tracer_provider=None): + """Enable instrumentation in a mysqlclient connection. + + Args: + connection: The connection to instrument. + tracer_provider: The optional tracer provider to use. If omitted + the current globally configured one is used. + + Returns: + An instrumented connection. + """ + + return dbapi.instrument_connection( + __name__, + connection, + _DATABASE_SYSTEM, + _CONNECTION_ATTRIBUTES, + version=__version__, + tracer_provider=tracer_provider, + ) + + @staticmethod + def uninstrument_connection(connection): + """Disable instrumentation in a mysqlclient connection. + + Args: + connection: The connection to uninstrument. + + Returns: + An uninstrumented connection. + """ + return dbapi.uninstrument_connection(connection) diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/package.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/package.py new file mode 100644 index 0000000000..9469194728 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/package.py @@ -0,0 +1,16 @@ +# 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. + + +_instruments = ("mysqlclient < 3",) diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py new file mode 100644 index 0000000000..87b20fddc3 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py @@ -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.40b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/tests/test_mysqlclient_integration.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/tests/test_mysqlclient_integration.py new file mode 100644 index 0000000000..35fdecc8e1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/tests/test_mysqlclient_integration.py @@ -0,0 +1,118 @@ +# 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. + +from unittest import mock + +import MySQLdb + +import opentelemetry.instrumentation.mysqlclient +from opentelemetry.instrumentation.mysqlclient import MySQLClientInstrumentor +from opentelemetry.sdk import resources +from opentelemetry.test.test_base import TestBase + + +class TestMySQLClientIntegration(TestBase): + def tearDown(self): + super().tearDown() + with self.disable_logging(): + MySQLClientInstrumentor().uninstrument() + + @mock.patch("MySQLdb.connect") + # pylint: disable=unused-argument + def test_instrumentor(self, mock_connect): + MySQLClientInstrumentor().instrument() + + cnx = MySQLdb.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.mysqlclient + ) + + # check that no spans are generated after uninstrument + MySQLClientInstrumentor().uninstrument() + + cnx = MySQLdb.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + @mock.patch("MySQLdb.connect") + # pylint: disable=unused-argument + def test_custom_tracer_provider(self, mock_connect): + resource = resources.Resource.create({}) + result = self.create_tracer_provider(resource=resource) + tracer_provider, exporter = result + + MySQLClientInstrumentor().instrument(tracer_provider=tracer_provider) + + cnx = MySQLdb.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + self.assertIs(span.resource, resource) + + @mock.patch("MySQLdb.connect") + # pylint: disable=unused-argument + def test_instrument_connection(self, mock_connect): + cnx = MySQLdb.connect(database="test") + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 0) + + cnx = MySQLClientInstrumentor().instrument_connection(cnx) + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + @mock.patch("MySQLdb.connect") + # pylint: disable=unused-argument + def test_uninstrument_connection(self, mock_connect): + MySQLClientInstrumentor().instrument() + cnx = MySQLdb.connect(database="test") + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + self.memory_exporter.clear() + + cnx = MySQLClientInstrumentor().uninstrument_connection(cnx) + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 0) diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 5a1aeb84a9..6405486e18 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -52,6 +52,7 @@ dependencies = [ "opentelemetry-instrumentation-kafka-python==0.40b0.dev", "opentelemetry-instrumentation-logging==0.40b0.dev", "opentelemetry-instrumentation-mysql==0.40b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.40b0.dev", "opentelemetry-instrumentation-pika==0.40b0.dev", "opentelemetry-instrumentation-psycopg2==0.40b0.dev", "opentelemetry-instrumentation-pymemcache==0.40b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index c67c4642dd..4d4c9b783b 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -96,6 +96,10 @@ "library": "mysql-connector-python ~= 8.0", "instrumentation": "opentelemetry-instrumentation-mysql==0.40b0.dev", }, + "mysqlclient": { + "library": "mysqlclient < 3", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.40b0.dev", + }, "pika": { "library": "pika >= 0.12.0", "instrumentation": "opentelemetry-instrumentation-pika==0.40b0.dev", diff --git a/tox.ini b/tox.ini index b0d33dfebc..18078536c1 100644 --- a/tox.ini +++ b/tox.ini @@ -121,6 +121,10 @@ envlist = py3{7,8,9,10,11}-test-instrumentation-mysql pypy3-test-instrumentation-mysql + ; opentelemetry-instrumentation-mysqlclient + py3{7,8,9,10,11}-test-instrumentation-mysqlclient + pypy3-test-instrumentation-mysqlclient + ; opentelemetry-instrumentation-psycopg2 py3{7,8,9,10,11}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 @@ -190,7 +194,7 @@ envlist = ; opentelemetry-instrumentation-tornado py3{7,8,9,10,11}-test-instrumentation-tornado - pypy3-test-instrumentation-tornado + pypy3-test-instrumentation-tornado ; opentelemetry-instrumentation-tortoiseorm py3{7,8,9,10,11}-test-instrumentation-tortoiseorm @@ -319,6 +323,7 @@ changedir = test-instrumentation-confluent-kafka: instrumentation/opentelemetry-instrumentation-confluent-kafka/tests test-instrumentation-logging: instrumentation/opentelemetry-instrumentation-logging/tests test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests + test-instrumentation-mysqlclient: instrumentation/opentelemetry-instrumentation-mysqlclient/tests test-instrumentation-pika{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests test-instrumentation-aio-pika{7,8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests @@ -402,6 +407,8 @@ commands_pre = mysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] + mysqlclient: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] + pymemcache{135,200,300,342,400}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] @@ -547,6 +554,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] + python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -587,6 +595,7 @@ deps = pyodbc~=4.0.30 flaky==3.7.0 remoulade>=0.50 + mysqlclient~=2.1.1 changedir = tests/opentelemetry-docker-tests/tests @@ -604,6 +613,7 @@ commands_pre = -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2 \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql \ From cfdd4ae77fda1e631f66b12a70e6a22c6a02010f Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Thu, 13 Jul 2023 07:42:32 -0700 Subject: [PATCH 042/200] Update version to 1.20.0.dev/0.41b0.dev (#1885) Co-authored-by: Diego Hurtado --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + _template/version.py | 2 +- eachdist.ini | 4 +- .../prometheus_remote_write/version.py | 2 +- .../pyproject.toml | 2 +- .../exporter/richconsole/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/aio_pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_client/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/aiopg/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/asgi/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncpg/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aws_lambda/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto3sqs/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/botocore/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/celery/version.py | 2 +- .../confluent_kafka/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/dbapi/version.py | 2 +- .../pyproject.toml | 12 +-- .../instrumentation/django/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/elasticsearch/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/falcon/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/fastapi/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/flask/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/grpc/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/httpx/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/jinja2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/kafka/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/logging/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysql/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysqlclient/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/psycopg2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymemcache/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymongo/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymysql/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/pyramid/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/redis/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/remoulade/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/requests/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sklearn/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlalchemy/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/sqlite3/version.py | 2 +- .../pyproject.toml | 10 +-- .../instrumentation/starlette/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/system_metrics/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/tornado/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/tortoiseorm/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib3/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/wsgi/version.py | 2 +- .../pyproject.toml | 86 +++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 88 +++++++++---------- .../opentelemetry/instrumentation/version.py | 2 +- .../propagators/ot_trace/version.py | 2 +- .../resource/detector/container/version.py | 2 +- .../src/opentelemetry/util/http/version.py | 2 +- 101 files changed, 283 insertions(+), 281 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09897b615f..414b9fe605 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: e9530c5c548d08a6aaa56268d103f9beb00cd002 + CORE_REPO_SHA: c41b6bf29e9486a71ba1c40cd0ea35a03b2f7489 jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index 90a093bfd6..dae24ec918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased + +## Version 1.19.0/0.40b0 (2023-07-13) - `opentelemetry-instrumentation-asgi` Add `http.server.request.size` metric ([#1867](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1867)) diff --git a/_template/version.py b/_template/version.py index 87b20fddc3..7f88144cf6 100644 --- a/_template/version.py +++ b/_template/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/eachdist.ini b/eachdist.ini index 2868d10c8d..ec96078c7a 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.19.0.dev +version=1.20.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.40b0.dev +version=0.41b0.dev packages= all diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py index 87b20fddc3..7f88144cf6 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index 2800ebe61b..73e792d38f 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "rich>=10.0.0", ] diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py index 87b20fddc3..7f88144cf6 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index 4a4f2cb74f..1ea3ec63b8 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aio-pika[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index ea23325caa..16a9c2305e 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py index 36eda362dd..97646888df 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 447b5a1124..a23e8e41a3 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-dbapi == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-dbapi == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,8 +37,8 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index ae73178bf9..33e698ae73 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -27,9 +27,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asgi[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 4125c4e6dc..1897dd7f68 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asyncpg[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index b6b49a1db2..4e488df34f 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -22,15 +22,15 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index c1ac4fcf02..7c68646657 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ test = [ "opentelemetry-instrumentation-boto[instruments]", "markupsafe==2.0.1", "moto~=2.0", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index b08515b259..56aa00cc0c 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-boto3sqs[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 3f2454a742..2010eb25f0 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", ] @@ -39,7 +39,7 @@ test = [ "opentelemetry-instrumentation-botocore[instruments]", "markupsafe==2.0.1", "moto[all] ~= 2.2.6", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index c356932264..d69084efb5 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-celery[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "pytest", ] diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index 9dae88f113..39821f1fee 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py index 1b790cecca..7d47d157b0 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 0254f38997..98e34e0784 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -26,22 +26,22 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-wsgi == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-wsgi == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.40b0.dev", + "opentelemetry-instrumentation-asgi == 0.41b0.dev", ] instruments = [ "django >= 1.10", ] test = [ "opentelemetry-instrumentation-django[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index 2364d652d4..bdd5c10ada 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-elasticsearch[instruments]", "elasticsearch-dsl >= 2.0", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index bb0b67fd08..63761cfe17 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-wsgi == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-wsgi == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", "packaging >= 20.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-falcon[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "parameterized == 0.7.4", ] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 05585f16f9..1a2bb71756 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-asgi == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-asgi == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-fastapi[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 885ca8965a..868d0672f7 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-wsgi == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-wsgi == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", "packaging >= 21.0", ] @@ -40,7 +40,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-flask[instruments]", "markupsafe==2.1.2", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 0f1651a969..3f887a802e 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-grpc[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "protobuf ~= 3.13", ] diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index d079de20b3..10213d2ec4 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-httpx[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index bddacca237..5633daf3db 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-jinja2[instruments]", "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index 2f8ad554e7..471017f3a0 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-kafka-python[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index aa058ac427..c2c05fae44 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,13 +25,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py index 1b790cecca..7d47d157b0 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index f7a3aa8ab3..fc2a81e19f 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-dbapi == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-dbapi == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysql[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index dae540f809..c20e896182 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-dbapi == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-dbapi == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysqlclient[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index b9fe8f3979..9064a6486b 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pika[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index f7a82e4979..38a52ea7ef 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-dbapi == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-dbapi == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-psycopg2[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index 675a7abe4b..c8fa549c1f 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymemcache[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index f2cda30eaa..826d7078f4 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymongo[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 5afdd43998..d579aa1baa 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-dbapi == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-dbapi == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymysql[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 06da79f410..2483d0c953 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-wsgi == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-wsgi == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pyramid[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "werkzeug == 0.16.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index d3b6b6cc61..fb9893ec8c 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "wrapt >= 1.12.1", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-redis[instruments]", "opentelemetry-sdk ~= 1.3", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index e4c1abcc16..546125d0c2 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-remoulade[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "opentelemetry-sdk ~= 1.10" ] diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index 6e82cb96a3..b19a6889cc 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-requests[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index 81ae3a5a5b..975bc7e26c 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-sklearn[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index 36eda362dd..97646888df 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 5c4b142637..3f84d4f5ed 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", "packaging >= 21.0", "wrapt >= 1.11.2", ] diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index 9b6f627a17..50355d49aa 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -26,14 +26,14 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-dbapi == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-dbapi == 0.41b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py index 1b790cecca..7d47d157b0 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index 47398bfbff..3d33b050dd 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-instrumentation-asgi == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation-asgi == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-starlette[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 606d626526..879d60067a 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-system-metrics[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index c0553eb6c0..f9f412ab7a 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tornado[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", "http-server-mock" ] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index f6670ce0c7..6340aa2842 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tortoiseorm[instruments]", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index bdeb974b60..fbee7d1cbb 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -26,16 +26,16 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] instruments = [] test = [ "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py index 1b790cecca..7d47d157b0 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index 167931228a..4c77ef8829 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-urllib3[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 2cf81bb4d8..9ff76df858 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", - "opentelemetry-semantic-conventions == 0.40b0.dev", - "opentelemetry-util-http == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-util-http == 0.41b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.40b0.dev", + "opentelemetry-test-utils == 0.41b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py index 87b20fddc3..7f88144cf6 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 6405486e18..f43c3075bc 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -29,49 +29,49 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.40b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.40b0.dev", - "opentelemetry-instrumentation-aiopg==0.40b0.dev", - "opentelemetry-instrumentation-asgi==0.40b0.dev", - "opentelemetry-instrumentation-asyncpg==0.40b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.40b0.dev", - "opentelemetry-instrumentation-boto==0.40b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.40b0.dev", - "opentelemetry-instrumentation-botocore==0.40b0.dev", - "opentelemetry-instrumentation-celery==0.40b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.40b0.dev", - "opentelemetry-instrumentation-dbapi==0.40b0.dev", - "opentelemetry-instrumentation-django==0.40b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.40b0.dev", - "opentelemetry-instrumentation-falcon==0.40b0.dev", - "opentelemetry-instrumentation-fastapi==0.40b0.dev", - "opentelemetry-instrumentation-flask==0.40b0.dev", - "opentelemetry-instrumentation-grpc==0.40b0.dev", - "opentelemetry-instrumentation-httpx==0.40b0.dev", - "opentelemetry-instrumentation-jinja2==0.40b0.dev", - "opentelemetry-instrumentation-kafka-python==0.40b0.dev", - "opentelemetry-instrumentation-logging==0.40b0.dev", - "opentelemetry-instrumentation-mysql==0.40b0.dev", - "opentelemetry-instrumentation-mysqlclient==0.40b0.dev", - "opentelemetry-instrumentation-pika==0.40b0.dev", - "opentelemetry-instrumentation-psycopg2==0.40b0.dev", - "opentelemetry-instrumentation-pymemcache==0.40b0.dev", - "opentelemetry-instrumentation-pymongo==0.40b0.dev", - "opentelemetry-instrumentation-pymysql==0.40b0.dev", - "opentelemetry-instrumentation-pyramid==0.40b0.dev", - "opentelemetry-instrumentation-redis==0.40b0.dev", - "opentelemetry-instrumentation-remoulade==0.40b0.dev", - "opentelemetry-instrumentation-requests==0.40b0.dev", - "opentelemetry-instrumentation-sklearn==0.40b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.40b0.dev", - "opentelemetry-instrumentation-sqlite3==0.40b0.dev", - "opentelemetry-instrumentation-starlette==0.40b0.dev", - "opentelemetry-instrumentation-system-metrics==0.40b0.dev", - "opentelemetry-instrumentation-tornado==0.40b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.40b0.dev", - "opentelemetry-instrumentation-urllib==0.40b0.dev", - "opentelemetry-instrumentation-urllib3==0.40b0.dev", - "opentelemetry-instrumentation-wsgi==0.40b0.dev", + "opentelemetry-instrumentation-aio-pika==0.41b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.41b0.dev", + "opentelemetry-instrumentation-aiopg==0.41b0.dev", + "opentelemetry-instrumentation-asgi==0.41b0.dev", + "opentelemetry-instrumentation-asyncpg==0.41b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.41b0.dev", + "opentelemetry-instrumentation-boto==0.41b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.41b0.dev", + "opentelemetry-instrumentation-botocore==0.41b0.dev", + "opentelemetry-instrumentation-celery==0.41b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.41b0.dev", + "opentelemetry-instrumentation-dbapi==0.41b0.dev", + "opentelemetry-instrumentation-django==0.41b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.41b0.dev", + "opentelemetry-instrumentation-falcon==0.41b0.dev", + "opentelemetry-instrumentation-fastapi==0.41b0.dev", + "opentelemetry-instrumentation-flask==0.41b0.dev", + "opentelemetry-instrumentation-grpc==0.41b0.dev", + "opentelemetry-instrumentation-httpx==0.41b0.dev", + "opentelemetry-instrumentation-jinja2==0.41b0.dev", + "opentelemetry-instrumentation-kafka-python==0.41b0.dev", + "opentelemetry-instrumentation-logging==0.41b0.dev", + "opentelemetry-instrumentation-mysql==0.41b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.41b0.dev", + "opentelemetry-instrumentation-pika==0.41b0.dev", + "opentelemetry-instrumentation-psycopg2==0.41b0.dev", + "opentelemetry-instrumentation-pymemcache==0.41b0.dev", + "opentelemetry-instrumentation-pymongo==0.41b0.dev", + "opentelemetry-instrumentation-pymysql==0.41b0.dev", + "opentelemetry-instrumentation-pyramid==0.41b0.dev", + "opentelemetry-instrumentation-redis==0.41b0.dev", + "opentelemetry-instrumentation-remoulade==0.41b0.dev", + "opentelemetry-instrumentation-requests==0.41b0.dev", + "opentelemetry-instrumentation-sklearn==0.41b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.41b0.dev", + "opentelemetry-instrumentation-sqlite3==0.41b0.dev", + "opentelemetry-instrumentation-starlette==0.41b0.dev", + "opentelemetry-instrumentation-system-metrics==0.41b0.dev", + "opentelemetry-instrumentation-tornado==0.41b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.41b0.dev", + "opentelemetry-instrumentation-urllib==0.41b0.dev", + "opentelemetry-instrumentation-urllib3==0.41b0.dev", + "opentelemetry-instrumentation-wsgi==0.41b0.dev", ] [project.optional-dependencies] diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py index 87b20fddc3..7f88144cf6 100644 --- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py +++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index f169b0a09a..b51b3661bf 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -24,13 +24,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.40b0.dev", + "opentelemetry-instrumentation == 0.41b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.19.0.dev", + "opentelemetry-exporter-otlp == 1.20.0.dev", ] test = [] diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py index 87b20fddc3..7f88144cf6 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/version.py +++ b/opentelemetry-distro/src/opentelemetry/distro/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 4d4c9b783b..505b16709d 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,162 +18,162 @@ libraries = { "aio_pika": { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.41b0.dev", }, "aiohttp": { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.41b0.dev", }, "aiopg": { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.41b0.dev", }, "asgiref": { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.41b0.dev", }, "asyncpg": { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.41b0.dev", }, "boto": { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.41b0.dev", }, "boto3": { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.41b0.dev", }, "botocore": { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.41b0.dev", }, "celery": { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.41b0.dev", }, "confluent-kafka": { "library": "confluent-kafka >= 1.8.2, <= 2.2.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.41b0.dev", }, "django": { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.41b0.dev", }, "elasticsearch": { "library": "elasticsearch >= 2.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.41b0.dev", }, "falcon": { "library": "falcon >= 1.4.1, < 4.0.0", - "instrumentation": "opentelemetry-instrumentation-falcon==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.41b0.dev", }, "fastapi": { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.41b0.dev", }, "flask": { "library": "flask >= 1.0, < 3.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.41b0.dev", }, "grpcio": { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.41b0.dev", }, "httpx": { "library": "httpx >= 0.18.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.41b0.dev", }, "jinja2": { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.41b0.dev", }, "kafka-python": { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.41b0.dev", }, "mysql-connector-python": { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.41b0.dev", }, "mysqlclient": { "library": "mysqlclient < 3", - "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.41b0.dev", }, "pika": { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.41b0.dev", }, "psycopg2": { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.41b0.dev", }, "pymemcache": { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.41b0.dev", }, "pymongo": { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.41b0.dev", }, "PyMySQL": { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.41b0.dev", }, "pyramid": { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.41b0.dev", }, "redis": { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.41b0.dev", }, "remoulade": { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.41b0.dev", }, "requests": { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.41b0.dev", }, "scikit-learn": { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.41b0.dev", }, "sqlalchemy": { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.41b0.dev", }, "starlette": { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.41b0.dev", }, "psutil": { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.41b0.dev", }, "tornado": { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.41b0.dev", }, "tortoise-orm": { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.41b0.dev", }, "pydantic": { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.41b0.dev", }, "urllib3": { "library": "urllib3 >= 1.0.0, < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.40b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.41b0.dev", }, } default_instrumentations = [ - "opentelemetry-instrumentation-aws-lambda==0.40b0.dev", - "opentelemetry-instrumentation-dbapi==0.40b0.dev", - "opentelemetry-instrumentation-logging==0.40b0.dev", - "opentelemetry-instrumentation-sqlite3==0.40b0.dev", - "opentelemetry-instrumentation-urllib==0.40b0.dev", - "opentelemetry-instrumentation-wsgi==0.40b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.41b0.dev", + "opentelemetry-instrumentation-dbapi==0.41b0.dev", + "opentelemetry-instrumentation-logging==0.41b0.dev", + "opentelemetry-instrumentation-sqlite3==0.41b0.dev", + "opentelemetry-instrumentation-urllib==0.41b0.dev", + "opentelemetry-instrumentation-wsgi==0.41b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index 87b20fddc3..7f88144cf6 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py index 87b20fddc3..7f88144cf6 100644 --- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py +++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py index 8778b43b17..7f88144cf6 100644 --- a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.38b0.dev" +__version__ = "0.41b0.dev" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py index 87b20fddc3..7f88144cf6 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.40b0.dev" +__version__ = "0.41b0.dev" From 74fcbf4a6eff414a9a1d2dbb74ab154483dec422 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 18 Jul 2023 20:49:51 +0200 Subject: [PATCH 043/200] Fix pyyaml version (#1892) --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 18078536c1..b4fe0690a8 100644 --- a/tox.ini +++ b/tox.ini @@ -502,7 +502,7 @@ commands = codespell [testenv:lint] -basepython: python3.10 +basepython: python3.9 recreate = False deps = -c dev-requirements.txt @@ -596,6 +596,7 @@ deps = flaky==3.7.0 remoulade>=0.50 mysqlclient~=2.1.1 + pyyaml==5.3.1 changedir = tests/opentelemetry-docker-tests/tests From 7603a1fc69474398289c2944796249e70bba0c82 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Tue, 18 Jul 2023 14:03:59 -0600 Subject: [PATCH 044/200] update awslambda to use _X_AMZN_TRACE_ID as a Span Link (#1657) Co-authored-by: Ron Yishai Co-authored-by: Srikanth Chekuri Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> Co-authored-by: Diego Hurtado --- CHANGELOG.md | 3 + .../instrumentation/aws_lambda/__init__.py | 80 +++++------ .../test_aws_lambda_instrumentation_manual.py | 133 +++++++++--------- tox.ini | 2 +- 4 files changed, 104 insertions(+), 114 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dae24ec918..909eea507d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,6 +150,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1592](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1592)) - `opentelemetry-instrumentation-django` Allow explicit `excluded_urls` configuration through `instrument()` ([#1618](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1618)) +- `opentelemetry-instrumentation-aws-lambda` Use env var `_X_AMZN_TRACE_ID` as a + Span Link instead of parent + ([#1657](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1657)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index 799becbdcc..bd19871140 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -71,7 +71,7 @@ def custom_event_context_extractor(lambda_event): import os import time from importlib import import_module -from typing import Any, Callable, Collection +from typing import Any, Callable, Collection, Optional, Sequence from urllib.parse import urlencode from wrapt import wrap_function_wrapper @@ -90,6 +90,7 @@ def custom_event_context_extractor(lambda_event): from opentelemetry.semconv.resource import ResourceAttributes from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace import ( + Link, Span, SpanKind, TracerProvider, @@ -106,9 +107,6 @@ def custom_event_context_extractor(lambda_event): OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT = ( "OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT" ) -OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION = ( - "OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION" -) def _default_event_context_extractor(lambda_event: Any) -> Context: @@ -142,14 +140,12 @@ def _default_event_context_extractor(lambda_event: Any) -> Context: def _determine_parent_context( - lambda_event: Any, - event_context_extractor: Callable[[Any], Context], - disable_aws_context_propagation: bool = False, + lambda_event: Any, event_context_extractor: Callable[[Any], Context] ) -> Context: """Determine the parent context for the current Lambda invocation. See more: - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md#determining-the-parent-of-a-span + https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md Args: lambda_event: user-defined, so it could be anything, but this @@ -158,30 +154,11 @@ def _determine_parent_context( Event as input and extracts an OTel Context from it. By default, the context is extracted from the HTTP headers of an API Gateway request. - disable_aws_context_propagation: By default, this instrumentation - will try to read the context from the `_X_AMZN_TRACE_ID` environment - variable set by Lambda, set this to `True` to disable this behavior. Returns: A Context with configuration found in the carrier. """ parent_context = None - if not disable_aws_context_propagation: - xray_env_var = os.environ.get(_X_AMZN_TRACE_ID) - - if xray_env_var: - parent_context = AwsXRayPropagator().extract( - {TRACE_HEADER_KEY: xray_env_var} - ) - - if ( - parent_context - and get_current_span(parent_context) - .get_span_context() - .trace_flags.sampled - ): - return parent_context - if event_context_extractor: parent_context = event_context_extractor(lambda_event) else: @@ -190,6 +167,33 @@ def _determine_parent_context( return parent_context +def _determine_links() -> Optional[Sequence[Link]]: + """Determine if a Link should be added to the Span based on the + environment variable `_X_AMZN_TRACE_ID`. + + + See more: + https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md#aws-x-ray-environment-span-link + + Returns: + A Link or None + """ + links = None + + xray_env_var = os.environ.get(_X_AMZN_TRACE_ID) + + if xray_env_var: + env_context = AwsXRayPropagator().extract( + {TRACE_HEADER_KEY: xray_env_var} + ) + + span_context = get_current_span(env_context).get_span_context() + if span_context.is_valid: + links = [Link(span_context, {"source": "x-ray-env"})] + + return links + + def _set_api_gateway_v1_proxy_attributes( lambda_event: Any, span: Span ) -> Span: @@ -284,7 +288,6 @@ def _instrument( flush_timeout, event_context_extractor: Callable[[Any], Context], tracer_provider: TracerProvider = None, - disable_aws_context_propagation: bool = False, meter_provider: MeterProvider = None, ): def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches @@ -297,11 +300,11 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches lambda_event = args[0] parent_context = _determine_parent_context( - lambda_event, - event_context_extractor, - disable_aws_context_propagation, + lambda_event, event_context_extractor ) + links = _determine_links() + span_kind = None try: if lambda_event["Records"][0]["eventSource"] in { @@ -327,6 +330,7 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches name=orig_handler_name, context=parent_context, kind=span_kind, + links=links, ) as span: if span.is_recording(): lambda_context = args[1] @@ -420,9 +424,6 @@ def _instrument(self, **kwargs): Event as input and extracts an OTel Context from it. By default, the context is extracted from the HTTP headers of an API Gateway request. - ``disable_aws_context_propagation``: By default, this instrumentation - will try to read the context from the `_X_AMZN_TRACE_ID` environment - variable set by Lambda, set this to `True` to disable this behavior. """ lambda_handler = os.environ.get(ORIG_HANDLER, os.environ.get(_HANDLER)) # pylint: disable=attribute-defined-outside-init @@ -444,16 +445,6 @@ def _instrument(self, **kwargs): flush_timeout_env, ) - disable_aws_context_propagation = kwargs.get( - "disable_aws_context_propagation", False - ) or os.getenv( - OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION, "False" - ).strip().lower() in ( - "true", - "1", - "t", - ) - _instrument( self._wrapped_module_name, self._wrapped_function_name, @@ -462,7 +453,6 @@ def _instrument(self, **kwargs): "event_context_extractor", _default_event_context_extractor ), tracer_provider=kwargs.get("tracer_provider"), - disable_aws_context_propagation=disable_aws_context_propagation, meter_provider=kwargs.get("meter_provider"), ) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py index 1df7499d31..544022086c 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py @@ -27,7 +27,6 @@ _HANDLER, _X_AMZN_TRACE_ID, OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT, - OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION, AwsLambdaInstrumentor, ) from opentelemetry.propagate import get_global_textmap @@ -138,7 +137,9 @@ def test_active_tracing(self): self.assertEqual(len(spans), 1) span = spans[0] self.assertEqual(span.name, os.environ[_HANDLER]) - self.assertEqual(span.get_span_context().trace_id, MOCK_XRAY_TRACE_ID) + self.assertNotEqual( + span.get_span_context().trace_id, MOCK_XRAY_TRACE_ID + ) self.assertEqual(span.kind, SpanKind.SERVER) self.assertSpanHasAttributes( span, @@ -149,11 +150,7 @@ def test_active_tracing(self): ) parent_context = span.parent - self.assertEqual( - parent_context.trace_id, span.get_span_context().trace_id - ) - self.assertEqual(parent_context.span_id, MOCK_XRAY_PARENT_SPAN_ID) - self.assertTrue(parent_context.is_remote) + self.assertEqual(None, parent_context) test_env_patch.stop() @@ -165,11 +162,8 @@ class TestCase: context: Dict expected_traceid: int expected_parentid: int - xray_traceid: str expected_state_value: str = None expected_trace_state_len: int = 0 - disable_aws_context_propagation: bool = False - disable_aws_context_propagation_envvar: str = "" def custom_event_context_extractor(lambda_event): return get_global_textmap().extract(lambda_event["foo"]["headers"]) @@ -188,42 +182,9 @@ def custom_event_context_extractor(lambda_event): expected_parentid=MOCK_W3C_PARENT_SPAN_ID, expected_trace_state_len=3, expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, - xray_traceid=MOCK_XRAY_TRACE_CONTEXT_NOT_SAMPLED, - ), - TestCase( - name="custom_extractor_not_sampled_xray", - custom_extractor=custom_event_context_extractor, - context={ - "foo": { - "headers": { - TraceContextTextMapPropagator._TRACEPARENT_HEADER_NAME: MOCK_W3C_TRACE_CONTEXT_SAMPLED, - TraceContextTextMapPropagator._TRACESTATE_HEADER_NAME: f"{MOCK_W3C_TRACE_STATE_KEY}={MOCK_W3C_TRACE_STATE_VALUE},foo=1,bar=2", - } - } - }, - expected_traceid=MOCK_W3C_TRACE_ID, - expected_parentid=MOCK_W3C_PARENT_SPAN_ID, - expected_trace_state_len=3, - expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, - xray_traceid=MOCK_XRAY_TRACE_CONTEXT_NOT_SAMPLED, - ), - TestCase( - name="custom_extractor_sampled_xray", - custom_extractor=custom_event_context_extractor, - context={ - "foo": { - "headers": { - TraceContextTextMapPropagator._TRACEPARENT_HEADER_NAME: MOCK_W3C_TRACE_CONTEXT_SAMPLED, - TraceContextTextMapPropagator._TRACESTATE_HEADER_NAME: f"{MOCK_W3C_TRACE_STATE_KEY}={MOCK_W3C_TRACE_STATE_VALUE},foo=1,bar=2", - } - } - }, - expected_traceid=MOCK_XRAY_TRACE_ID, - expected_parentid=MOCK_XRAY_PARENT_SPAN_ID, - xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, ), TestCase( - name="custom_extractor_sampled_xray_disable_aws_propagation", + name="custom_extractor", custom_extractor=custom_event_context_extractor, context={ "foo": { @@ -233,29 +194,10 @@ def custom_event_context_extractor(lambda_event): } } }, - disable_aws_context_propagation=True, expected_traceid=MOCK_W3C_TRACE_ID, expected_parentid=MOCK_W3C_PARENT_SPAN_ID, expected_trace_state_len=3, expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, - xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, - ), - TestCase( - name="no_custom_extractor_xray_disable_aws_propagation_via_env_var", - custom_extractor=None, - context={ - "headers": { - TraceContextTextMapPropagator._TRACEPARENT_HEADER_NAME: MOCK_W3C_TRACE_CONTEXT_SAMPLED, - TraceContextTextMapPropagator._TRACESTATE_HEADER_NAME: f"{MOCK_W3C_TRACE_STATE_KEY}={MOCK_W3C_TRACE_STATE_VALUE},foo=1,bar=2", - } - }, - disable_aws_context_propagation=False, - disable_aws_context_propagation_envvar="true", - expected_traceid=MOCK_W3C_TRACE_ID, - expected_parentid=MOCK_W3C_PARENT_SPAN_ID, - expected_trace_state_len=3, - expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, - xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, ), ] for test in tests: @@ -263,17 +205,13 @@ def custom_event_context_extractor(lambda_event): "os.environ", { **os.environ, - # NOT Active Tracing - _X_AMZN_TRACE_ID: test.xray_traceid, - OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION: test.disable_aws_context_propagation_envvar, # NOT using the X-Ray Propagator OTEL_PROPAGATORS: "tracecontext", }, ) test_env_patch.start() AwsLambdaInstrumentor().instrument( - event_context_extractor=test.custom_extractor, - disable_aws_context_propagation=test.disable_aws_context_propagation, + event_context_extractor=test.custom_extractor ) mock_execute_lambda(test.context) spans = self.memory_exporter.get_finished_spans() @@ -301,6 +239,65 @@ def custom_event_context_extractor(lambda_event): AwsLambdaInstrumentor().uninstrument() test_env_patch.stop() + def test_links_from_lambda_event(self): + @dataclass + class TestCase: + name: str + context: Dict + expected_link_trace_id: int + expected_link_attributes: dict + xray_traceid: str + + tests = [ + TestCase( + name="valid_xray_trace", + context={}, + expected_link_trace_id=MOCK_XRAY_TRACE_ID, + expected_link_attributes={"source": "x-ray-env"}, + xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, + ), + TestCase( + name="invalid_xray_trace", + context={}, + expected_link_trace_id=None, + expected_link_attributes={}, + xray_traceid="0", + ), + ] + for test in tests: + test_env_patch = mock.patch.dict( + "os.environ", + { + **os.environ, + # NOT Active Tracing + _X_AMZN_TRACE_ID: test.xray_traceid, + # NOT using the X-Ray Propagator + OTEL_PROPAGATORS: "tracecontext", + }, + ) + test_env_patch.start() + AwsLambdaInstrumentor().instrument() + mock_execute_lambda(test.context) + spans = self.memory_exporter.get_finished_spans() + assert spans + self.assertEqual(len(spans), 1) + span = spans[0] + + if test.expected_link_trace_id is None: + self.assertEqual(0, len(span.links)) + else: + link = span.links[0] + self.assertEqual( + link.context.trace_id, test.expected_link_trace_id + ) + self.assertEqual( + link.attributes, test.expected_link_attributes + ) + + self.memory_exporter.clear() + AwsLambdaInstrumentor().uninstrument() + test_env_patch.stop() + def test_lambda_no_error_with_invalid_flush_timeout(self): test_env_patch = mock.patch.dict( "os.environ", diff --git a/tox.ini b/tox.ini index b4fe0690a8..2c48dfd1bb 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ envlist = ; instrumentation-aiopg intentionally excluded from pypy3 ; opentelemetry-instrumentation-aws-lambda - py3{7,8,9}-test-instrumentation-aws-lambda + py3{7,8,9,10,11}-test-instrumentation-aws-lambda ; opentelemetry-instrumentation-botocore py3{7,8,9,10,11}-test-instrumentation-botocore From 1beab8238b15b2377183c8ea9b74fc1a61332b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=89VEIL?= Date: Mon, 7 Aug 2023 15:17:20 +0200 Subject: [PATCH 045/200] Fix UnboundLocalError local variable 'start' referenced before assignment (#1889) Co-authored-by: Pablo Collins --- CHANGELOG.md | 5 +++ .../instrumentation/asgi/__init__.py | 2 +- .../tests/test_asgi_middleware.py | 34 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 909eea507d..6c22afff6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- `opentelemetry-instrumentation-asgi` Fix UnboundLocalError local variable 'start' referenced before assignment + ([#1889](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1889)) + ## Version 1.19.0/0.40b0 (2023-07-13) - `opentelemetry-instrumentation-asgi` Add `http.server.request.size` metric ([#1867](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1867)) diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index a1fa1f8e31..c0dcd39fd2 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -538,6 +538,7 @@ async def __call__(self, scope, receive, send): receive: An awaitable callable yielding dictionaries send: An awaitable callable taking a single dictionary as argument. """ + start = default_timer() if scope["type"] not in ("http", "websocket"): return await self.app(scope, receive, send) @@ -591,7 +592,6 @@ async def __call__(self, scope, receive, send): send, duration_attrs, ) - start = default_timer() await self.app(scope, otel_receive, otel_send) finally: diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 8ca82d0226..cb22174482 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -14,6 +14,7 @@ # pylint: disable=too-many-lines +import asyncio import sys import unittest from timeit import default_timer @@ -796,5 +797,38 @@ async def wrapped_app(scope, receive, send): ) +class TestAsgiApplicationRaisingError(AsgiTestBase): + def tearDown(self): + pass + + @mock.patch( + "opentelemetry.instrumentation.asgi.collect_custom_request_headers_attributes", + side_effect=ValueError("whatever"), + ) + def test_asgi_issue_1883( + self, mock_collect_custom_request_headers_attributes + ): + """ + Test that exception UnboundLocalError local variable 'start' referenced before assignment is not raised + See https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1883 + """ + app = otel_asgi.OpenTelemetryMiddleware(simple_asgi) + self.seed_app(app) + self.send_default_request() + try: + asyncio.get_event_loop().run_until_complete( + self.communicator.stop() + ) + except ValueError as exc_info: + self.assertEqual(exc_info.args[0], "whatever") + except Exception as exc_info: # pylint: disable=W0703 + self.fail( + "expecting ValueError('whatever'), received instead: " + + str(exc_info) + ) + else: + self.fail("expecting ValueError('whatever')") + + if __name__ == "__main__": unittest.main() From 6007e0c013071e7f8b9612d3bc68aeb9d600d74e Mon Sep 17 00:00:00 2001 From: Jakub Warczarek Date: Tue, 15 Aug 2023 22:17:14 +0200 Subject: [PATCH 046/200] Merge pull request from GHSA-5rv5-6h4r-h22v * Fix unbound cardinality for label http_method in wsgi based middlewares * cr: rename file * cr: change label UNKNOWN to NONSTANDARD * Update instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py --------- Co-authored-by: Diego Hurtado --- .../tests/test_programmatic.py | 94 +++++++++++++++---- .../instrumentation/wsgi/__init__.py | 11 ++- .../tests/test_wsgi_middleware.py | 19 ++++ .../src/opentelemetry/util/http/__init__.py | 13 +++ .../tests/test_sanitize_method.py | 44 +++++++++ 5 files changed, 162 insertions(+), 19 deletions(-) create mode 100644 util/opentelemetry-util-http/tests/test_sanitize_method.py diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py index 6393b927b8..bf641aaed4 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py @@ -40,6 +40,8 @@ OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS, OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST, OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE, + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE, + OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS, get_excluded_urls, ) @@ -326,6 +328,25 @@ def test_flask_metric_values(self): if isinstance(point, NumberDataPoint): self.assertEqual(point.value, 0) + def _assert_basic_metric(self, expected_duration_attributes, expected_requests_count_attributes): + metrics_list = self.memory_metrics_reader.get_metrics_data() + for resource_metric in metrics_list.resource_metrics: + for scope_metrics in resource_metric.scope_metrics: + for metric in scope_metrics.metrics: + for point in list(metric.data.data_points): + if isinstance(point, HistogramDataPoint): + self.assertDictEqual( + expected_duration_attributes, + dict(point.attributes), + ) + self.assertEqual(point.count, 1) + elif isinstance(point, NumberDataPoint): + self.assertDictEqual( + expected_requests_count_attributes, + dict(point.attributes), + ) + self.assertEqual(point.value, 0) + def test_basic_metric_success(self): self.client.get("/hello/756") expected_duration_attributes = { @@ -344,23 +365,62 @@ def test_basic_metric_success(self): "http.flavor": "1.1", "http.server_name": "localhost", } - metrics_list = self.memory_metrics_reader.get_metrics_data() - for resource_metric in metrics_list.resource_metrics: - for scope_metrics in resource_metric.scope_metrics: - for metric in scope_metrics.metrics: - for point in list(metric.data.data_points): - if isinstance(point, HistogramDataPoint): - self.assertDictEqual( - expected_duration_attributes, - dict(point.attributes), - ) - self.assertEqual(point.count, 1) - elif isinstance(point, NumberDataPoint): - self.assertDictEqual( - expected_requests_count_attributes, - dict(point.attributes), - ) - self.assertEqual(point.value, 0) + self._assert_basic_metric( + expected_duration_attributes, + expected_requests_count_attributes, + ) + + def test_basic_metric_nonstandard_http_method_success(self): + self.client.open("/hello/756", method="NONSTANDARD") + expected_duration_attributes = { + "http.method": "UNKNOWN", + "http.host": "localhost", + "http.scheme": "http", + "http.flavor": "1.1", + "http.server_name": "localhost", + "net.host.port": 80, + "http.status_code": 405, + } + expected_requests_count_attributes = { + "http.method": "UNKNOWN", + "http.host": "localhost", + "http.scheme": "http", + "http.flavor": "1.1", + "http.server_name": "localhost", + } + self._assert_basic_metric( + expected_duration_attributes, + expected_requests_count_attributes, + ) + + @patch.dict( + "os.environ", + { + OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS: "1", + }, + ) + def test_basic_metric_nonstandard_http_method_allowed_success(self): + self.client.open("/hello/756", method="NONSTANDARD") + expected_duration_attributes = { + "http.method": "NONSTANDARD", + "http.host": "localhost", + "http.scheme": "http", + "http.flavor": "1.1", + "http.server_name": "localhost", + "net.host.port": 80, + "http.status_code": 405, + } + expected_requests_count_attributes = { + "http.method": "NONSTANDARD", + "http.host": "localhost", + "http.scheme": "http", + "http.flavor": "1.1", + "http.server_name": "localhost", + } + self._assert_basic_metric( + expected_duration_attributes, + expected_requests_count_attributes, + ) def test_metric_uninstrument(self): self.client.delete("/hello/756") diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py index f4012d7904..35e217264d 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -197,6 +197,12 @@ def response_hook(span: Span, environ: WSGIEnvironment, status: str, response_he Note: The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change. +Sanitizing methods +****************** +In order to prevent unbound cardinality for HTTP methods by default nonstandard ones are labeled as ``NONSTANDARD``. +To record all of the names set the environment variable ``OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS`` +to a value that evaluates to true, e.g. ``1``. + API --- """ @@ -226,6 +232,7 @@ def response_hook(span: Span, environ: WSGIEnvironment, status: str, response_he normalise_request_header_name, normalise_response_header_name, remove_url_credentials, + sanitize_method, ) _HTTP_VERSION_PREFIX = "HTTP/" @@ -295,7 +302,7 @@ def collect_request_attributes(environ): """ result = { - SpanAttributes.HTTP_METHOD: environ.get("REQUEST_METHOD"), + SpanAttributes.HTTP_METHOD: sanitize_method(environ.get("REQUEST_METHOD")), SpanAttributes.HTTP_SERVER_NAME: environ.get("SERVER_NAME"), SpanAttributes.HTTP_SCHEME: environ.get("wsgi.url_scheme"), } @@ -450,7 +457,7 @@ def get_default_span_name(environ): Returns: The span name. """ - method = environ.get("REQUEST_METHOD", "").strip() + method = sanitize_method(environ.get("REQUEST_METHOD", "").strip()) path = environ.get("PATH_INFO", "").strip() if method and path: return f"{method} {path}" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index c2aaf3820d..6df302d67d 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -33,6 +33,7 @@ OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS, OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST, OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE, + OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS, ) @@ -284,6 +285,24 @@ def test_wsgi_metrics(self): ) self.assertTrue(number_data_point_seen and histogram_data_point_seen) + def test_nonstandard_http_method(self): + self.environ["REQUEST_METHOD"]= "NONSTANDARD" + app = otel_wsgi.OpenTelemetryMiddleware(simple_wsgi) + response = app(self.environ, self.start_response) + self.validate_response(response, span_name="HTTP UNKNOWN", http_method="UNKNOWN") + + @mock.patch.dict( + "os.environ", + { + OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS: "1", + }, + ) + def test_nonstandard_http_method_allowed(self): + self.environ["REQUEST_METHOD"]= "NONSTANDARD" + app = otel_wsgi.OpenTelemetryMiddleware(simple_wsgi) + response = app(self.environ, self.start_response) + self.validate_response(response, span_name="HTTP NONSTANDARD", http_method="NONSTANDARD") + def test_default_span_name_missing_path_info(self): """Test that default span_names with missing path info.""" self.environ.pop("PATH_INFO") diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py index f3d39ab02f..f7236b0740 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py @@ -31,6 +31,10 @@ "OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE" ) +OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS = ( + "OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS" +) + # List of recommended metrics attributes _duration_attrs = { SpanAttributes.HTTP_METHOD, @@ -186,6 +190,15 @@ def normalise_response_header_name(header: str) -> str: key = header.lower().replace("-", "_") return f"http.response.header.{key}" +def sanitize_method(method: str | None) -> str | None: + if method is None: + return None + method = method.upper() + if (environ.get(OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS) or + # Based on https://www.rfc-editor.org/rfc/rfc7231#section-4.1 and https://www.rfc-editor.org/rfc/rfc5789#section-2. + method in ["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]): + return method + return "NONSTANDARD" def get_custom_headers(env_var: str) -> List[str]: custom_headers = environ.get(env_var, []) diff --git a/util/opentelemetry-util-http/tests/test_sanitize_method.py b/util/opentelemetry-util-http/tests/test_sanitize_method.py new file mode 100644 index 0000000000..a488ef589e --- /dev/null +++ b/util/opentelemetry-util-http/tests/test_sanitize_method.py @@ -0,0 +1,44 @@ +# 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. + +import unittest +from unittest.mock import patch + +from opentelemetry.util.http import ( + OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS, + sanitize_method, +) + +class TestSanitizeMethod(unittest.TestCase): + def test_standard_method_uppercase(self): + method = sanitize_method("GET") + self.assertEqual(method, "GET") + + def test_standard_method_lowercase(self): + method = sanitize_method("get") + self.assertEqual(method, "GET") + + def test_nonstandard_method(self): + method = sanitize_method("UNKNOWN") + self.assertEqual(method, "NONSTANDARD") + + @patch.dict( + "os.environ", + { + OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS: "1", + }, + ) + def test_nonstandard_method_allowed(self): + method = sanitize_method("UNKNOWN") + self.assertEqual(method, "NONSTANDARD") From 9cd9de7f01fc51f68f196ab9d97ea32488747efb Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 16 Aug 2023 13:25:50 -0700 Subject: [PATCH 047/200] Fix errors introduced in regression (#1913) --- .github/component_owners.yml | 1 + CHANGELOG.md | 4 +++- .../tests/test_wsgi_middleware.py | 4 ++-- .../src/opentelemetry/util/http/__init__.py | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/component_owners.yml b/.github/component_owners.yml index 7f5b6b1c44..ebb9650a21 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -3,6 +3,7 @@ components: docs/instrumentation: - nemoshlag + instrumentation/opentelemetry-instrumentation-aio-pika: - ofek1weiss diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c22afff6b..39289b84c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `opentelemetry-instrumentation-asgi` Fix UnboundLocalError local variable 'start' referenced before assignment +- `opentelemetry-instrumentation-asgi` Fix UnboundLocalError local variable 'start' referenced before assignment ([#1889](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1889)) +- Fixed union typing error not compatible with Python 3.7 introduced in `opentelemetry-util-http`, fix tests introduced by patch related to sanitize method for wsgi + ([#1913](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1913)) ## Version 1.19.0/0.40b0 (2023-07-13) - `opentelemetry-instrumentation-asgi` Add `http.server.request.size` metric diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index 6df302d67d..6aef096218 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -289,7 +289,7 @@ def test_nonstandard_http_method(self): self.environ["REQUEST_METHOD"]= "NONSTANDARD" app = otel_wsgi.OpenTelemetryMiddleware(simple_wsgi) response = app(self.environ, self.start_response) - self.validate_response(response, span_name="HTTP UNKNOWN", http_method="UNKNOWN") + self.validate_response(response, span_name="UNKNOWN /", http_method="UNKNOWN") @mock.patch.dict( "os.environ", @@ -301,7 +301,7 @@ def test_nonstandard_http_method_allowed(self): self.environ["REQUEST_METHOD"]= "NONSTANDARD" app = otel_wsgi.OpenTelemetryMiddleware(simple_wsgi) response = app(self.environ, self.start_response) - self.validate_response(response, span_name="HTTP NONSTANDARD", http_method="NONSTANDARD") + self.validate_response(response, span_name="NONSTANDARD /", http_method="NONSTANDARD") def test_default_span_name_missing_path_info(self): """Test that default span_names with missing path info.""" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py index f7236b0740..4f4a5d0353 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py @@ -16,7 +16,7 @@ from re import IGNORECASE as RE_IGNORECASE from re import compile as re_compile from re import search -from typing import Iterable, List +from typing import Iterable, List, Optional from urllib.parse import urlparse, urlunparse from opentelemetry.semconv.trace import SpanAttributes @@ -190,7 +190,7 @@ def normalise_response_header_name(header: str) -> str: key = header.lower().replace("-", "_") return f"http.response.header.{key}" -def sanitize_method(method: str | None) -> str | None: +def sanitize_method(method: Optional[str]) -> Optional[str]: if method is None: return None method = method.upper() @@ -198,7 +198,7 @@ def sanitize_method(method: str | None) -> str | None: # Based on https://www.rfc-editor.org/rfc/rfc7231#section-4.1 and https://www.rfc-editor.org/rfc/rfc5789#section-2. method in ["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]): return method - return "NONSTANDARD" + return "UNKNOWN" def get_custom_headers(env_var: str) -> List[str]: custom_headers = environ.get(env_var, []) From 9627f74a7360cafe7e6789d56b63798c0f29fe15 Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Thu, 17 Aug 2023 13:21:59 -0700 Subject: [PATCH 048/200] Azure resource detectors (#1901) --- CHANGELOG.md | 5 + .../LICENSE | 201 +++++++++ .../MANIFEST.rst} | 0 .../README.rst | 82 ++++ .../pyproject.toml | 51 +++ .../resource/detector/azure/app_service.py | 75 ++++ .../resource/detector/azure/version.py | 15 + .../resource/detector/azure/vm.py | 97 +++++ .../tests/__init__.py | 13 + .../tests/test_app_service.py | 116 ++++++ .../tests/test_vm.py | 382 ++++++++++++++++++ .../MANIFEST.rst | 9 + 12 files changed, 1046 insertions(+) create mode 100644 resource/opentelemetry-resource-detector-azure/LICENSE rename resource/{opentelemetry-resource-detector-container/MANITEST.rst => opentelemetry-resource-detector-azure/MANIFEST.rst} (100%) create mode 100644 resource/opentelemetry-resource-detector-azure/README.rst create mode 100644 resource/opentelemetry-resource-detector-azure/pyproject.toml create mode 100644 resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py create mode 100644 resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py create mode 100644 resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py create mode 100644 resource/opentelemetry-resource-detector-azure/tests/__init__.py create mode 100644 resource/opentelemetry-resource-detector-azure/tests/test_app_service.py create mode 100644 resource/opentelemetry-resource-detector-azure/tests/test_vm.py create mode 100644 resource/opentelemetry-resource-detector-container/MANIFEST.rst diff --git a/CHANGELOG.md b/CHANGELOG.md index 39289b84c5..4bb0bb80b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed union typing error not compatible with Python 3.7 introduced in `opentelemetry-util-http`, fix tests introduced by patch related to sanitize method for wsgi ([#1913](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1913)) +### Added + +- `opentelemetry-resource-detector-azure` Add resource detectors for Azure App Service and VM + ([#1901](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1901)) + ## Version 1.19.0/0.40b0 (2023-07-13) - `opentelemetry-instrumentation-asgi` Add `http.server.request.size` metric ([#1867](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1867)) diff --git a/resource/opentelemetry-resource-detector-azure/LICENSE b/resource/opentelemetry-resource-detector-azure/LICENSE new file mode 100644 index 0000000000..1ef7dad2c5 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + 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. diff --git a/resource/opentelemetry-resource-detector-container/MANITEST.rst b/resource/opentelemetry-resource-detector-azure/MANIFEST.rst similarity index 100% rename from resource/opentelemetry-resource-detector-container/MANITEST.rst rename to resource/opentelemetry-resource-detector-azure/MANIFEST.rst diff --git a/resource/opentelemetry-resource-detector-azure/README.rst b/resource/opentelemetry-resource-detector-azure/README.rst new file mode 100644 index 0000000000..6a376534ad --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/README.rst @@ -0,0 +1,82 @@ +OpenTelemetry Resource detectors for Azure +========================================== + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-resource-detector-azure.svg + :target: https://pypi.org/project/opentelemetry-resource-detector-azure/ + +This library contains OpenTelemetry `Resource Detectors `_ for the following Azure resources: + * `Azure App Service `_ + * `Azure Virtual Machines `_ + +Installation +------------ + +:: + + pip install opentelemetry-resource-detector-azure + +--------------------------- + +Usage example for ``opentelemetry-resource-detector-azure`` + +.. code-block:: python + + from opentelemetry import trace + from opentelemetry.sdk.trace import TracerProvider + from opentelemetry.resource.detector.azure.app_service import ( + AzureAppServiceResourceDetector, + AzureVMResourceDetector, + ) + from opentelemetry.resource.detector.azure.vm import ( + AzureVMResourceDetector, + ) + from opentelemetry.sdk.resources import get_aggregated_resources + + + trace.set_tracer_provider( + TracerProvider( + resource=get_aggregated_resources( + [ + AzureAppServiceResourceDetector(), + AzureVMResourceDetector(), + ] + ), + ) + ) + +Mappings +-------- + +The Azure App Service Resource Detector sets the following Resource Attributes: + * ``service.name`` set to the value of the ``WEBSITE_SITE_NAME`` environment variable. + * ``cloud.platform`` set to ``azure_app_service``. + * ``cloud.provider`` set to ``azure``. + * ``cloud.resource_id`` set using the ``WEBSITE_RESOURCE_GROUP``, ``WEBSITE_OWNER_NAME``, and ``WEBSITE_SITE_NAME`` environment variables. + * ``cloud.region`` set to the value of the ``REGION_NAME`` environment variable. + * ``deployment.environment`` set to the value of the ``WEBSITE_SLOT_NAME`` environment variable. + * ``host.id`` set to the value of the ``WEBSITE_HOSTNAME`` environment variable. + * ``service.instance.id`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable. + * ``azure.app.service.stamp`` set to the value of the ``WEBSITE_HOME_STAMPNAME`` environment variable. + +The Azure VM Resource Detector sets the following Resource Attributes according to the response from the `Azure Metadata Service `_: + * ``azure.vm.scaleset.name`` set to the value of the ``vmScaleSetName`` field. + * ``azure.vm.sku`` set to the value of the ``sku`` field. + * ``cloud.platform`` set to the value of the ``azure_vm``. + * ``cloud.provider`` set to the value of the ``azure``. + * ``cloud.region`` set to the value of the ``location`` field. + * ``cloud.resource_id`` set to the value of the ``resourceId`` field. + * ``host.id`` set to the value of the ``vmId`` field. + * ``host.name`` set to the value of the ``name`` field. + * ``host.type`` set to the value of the ``vmSize`` field. + * ``os.type`` set to the value of the ``osType`` field. + * ``os.version`` set to the value of the ``version`` field. + * ``service.instance.id`` set to the value of the ``vmId`` field. + +For more information, see the `Semantic Conventions for Cloud Resource Attributes `_. + +References +---------- + +* `OpenTelemetry Project `_ \ No newline at end of file diff --git a/resource/opentelemetry-resource-detector-azure/pyproject.toml b/resource/opentelemetry-resource-detector-azure/pyproject.toml new file mode 100644 index 0000000000..db892a86bf --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/pyproject.toml @@ -0,0 +1,51 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-resource-detector-container" +dynamic = ["version"] +description = "Container Resource Detector for OpenTelemetry" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "opentelemetry-sdk ~= 1.19", +] + +[project.optional-dependencies] +test = [] + +[project.entry-points.opentelemetry_resource_detector] +azure_app_service = "opentelemetry.resource.detector.azure.app_service:AzureAppServiceResourceDetector" +azure_vm = "opentelemetry.resource.detector.azure.vm:AzureVMResourceDetector" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/resource/opentelemetry-resource-detector-azure" + +[tool.hatch.version] +path = "src/opentelemetry/resource/detector/azure/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py new file mode 100644 index 0000000000..ea0959cb93 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py @@ -0,0 +1,75 @@ +# 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. + +from os import environ + +from opentelemetry.sdk.resources import ResourceDetector, Resource +from opentelemetry.semconv.resource import ResourceAttributes, CloudPlatformValues, CloudProviderValues + +_AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE = "azure.app.service.stamp" +# TODO: Remove once this resource attribute is no longer missing from SDK +_CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = "cloud.resource_id" +_REGION_NAME = "REGION_NAME" +_WEBSITE_HOME_STAMPNAME = "WEBSITE_HOME_STAMPNAME" +_WEBSITE_HOSTNAME = "WEBSITE_HOSTNAME" +_WEBSITE_INSTANCE_ID = "WEBSITE_INSTANCE_ID" +_WEBSITE_OWNER_NAME = "WEBSITE_OWNER_NAME" +_WEBSITE_RESOURCE_GROUP = "WEBSITE_RESOURCE_GROUP" +_WEBSITE_SITE_NAME = "WEBSITE_SITE_NAME" +_WEBSITE_SLOT_NAME = "WEBSITE_SLOT_NAME" + + +_APP_SERVICE_ATTRIBUTE_ENV_VARS = { + ResourceAttributes.CLOUD_REGION: _REGION_NAME, + ResourceAttributes.DEPLOYMENT_ENVIRONMENT: _WEBSITE_SLOT_NAME, + ResourceAttributes.HOST_ID: _WEBSITE_HOSTNAME, + ResourceAttributes.SERVICE_INSTANCE_ID: _WEBSITE_INSTANCE_ID, + _AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE: _WEBSITE_HOME_STAMPNAME, +} + +class AzureAppServiceResourceDetector(ResourceDetector): + def detect(self) -> Resource: + attributes = {} + website_site_name = environ.get(_WEBSITE_SITE_NAME) + if website_site_name: + attributes[ResourceAttributes.SERVICE_NAME] = website_site_name + attributes[ResourceAttributes.CLOUD_PROVIDER] = CloudProviderValues.AZURE.value + attributes[ResourceAttributes.CLOUD_PLATFORM] = CloudPlatformValues.AZURE_APP_SERVICE.value + + azure_resource_uri = _get_azure_resource_uri(website_site_name) + if azure_resource_uri: + attributes[_CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE] = azure_resource_uri + for (key, env_var) in _APP_SERVICE_ATTRIBUTE_ENV_VARS.items(): + value = environ.get(env_var) + if value: + attributes[key] = value + + return Resource(attributes) + +def _get_azure_resource_uri(website_site_name): + website_resource_group = environ.get(_WEBSITE_RESOURCE_GROUP) + website_owner_name = environ.get(_WEBSITE_OWNER_NAME) + + subscription_id = website_owner_name + if website_owner_name and '+' in website_owner_name: + subscription_id = website_owner_name[0:website_owner_name.index('+')] + + if not (website_resource_group and subscription_id): + return None + + return "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/sites/%s" % ( + subscription_id, + website_resource_group, + website_site_name, + ) diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py new file mode 100644 index 0000000000..7f88144cf6 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py @@ -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.41b0.dev" diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py new file mode 100644 index 0000000000..02f8ea537f --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -0,0 +1,97 @@ +# 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. + +from json import loads +from logging import getLogger +from os import environ +from urllib.request import Request, urlopen +from urllib.error import URLError + +from opentelemetry.sdk.resources import ResourceDetector, Resource +from opentelemetry.semconv.resource import ResourceAttributes, CloudPlatformValues, CloudProviderValues + + +# TODO: Remove when cloud resource id is no longer missing in Resource Attributes +_CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = "cloud.resource_id" +_AZURE_VM_METADATA_ENDPOINT = "http://169.254.169.254/metadata/instance/compute?api-version=2021-12-13&format=json" +_AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = "azure.vm.scaleset.name" +_AZURE_VM_SKU_ATTRIBUTE = "azure.vm.sku" +_logger = getLogger(__name__) + +EXPECTED_AZURE_AMS_ATTRIBUTES = [ + _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE, + _AZURE_VM_SKU_ATTRIBUTE, + ResourceAttributes.CLOUD_PLATFORM, + ResourceAttributes.CLOUD_PROVIDER, + ResourceAttributes.CLOUD_REGION, + _CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE, + ResourceAttributes.HOST_ID, + ResourceAttributes.HOST_NAME, + ResourceAttributes.HOST_TYPE, + ResourceAttributes.OS_TYPE, + ResourceAttributes.OS_VERSION, + ResourceAttributes.SERVICE_INSTANCE_ID, +] + +class AzureVMResourceDetector(ResourceDetector): + # pylint: disable=no-self-use + def detect(self) -> "Resource": + attributes = {} + metadata_json = _AzureVMMetadataServiceRequestor().get_azure_vm_metadata() + if not metadata_json: + return Resource(attributes) + for attribute_key in EXPECTED_AZURE_AMS_ATTRIBUTES: + attributes[attribute_key] = _AzureVMMetadataServiceRequestor().get_attribute_from_metadata(metadata_json, attribute_key) + return Resource(attributes) + +class _AzureVMMetadataServiceRequestor: + def get_azure_vm_metadata(self): + request = Request(_AZURE_VM_METADATA_ENDPOINT) + request.add_header("Metadata", "True") + try: + response = urlopen(request).read() + return loads(response) + except URLError: + # Not on Azure VM + return None + except Exception as e: + _logger.exception("Failed to receive Azure VM metadata: %s", e) + return None + + def get_attribute_from_metadata(self, metadata_json, attribute_key): + ams_value = "" + if attribute_key == _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE: + ams_value = metadata_json["vmScaleSetName"] + elif attribute_key == _AZURE_VM_SKU_ATTRIBUTE: + ams_value = metadata_json["sku"] + elif attribute_key == ResourceAttributes.CLOUD_PLATFORM: + ams_value = CloudPlatformValues.AZURE_VM.value + elif attribute_key == ResourceAttributes.CLOUD_PROVIDER: + ams_value = CloudProviderValues.AZURE.value + elif attribute_key == ResourceAttributes.CLOUD_REGION: + ams_value = metadata_json["location"] + elif attribute_key == _CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE: + ams_value = metadata_json["resourceId"] + elif attribute_key == ResourceAttributes.HOST_ID or \ + attribute_key == ResourceAttributes.SERVICE_INSTANCE_ID: + ams_value = metadata_json["vmId"] + elif attribute_key == ResourceAttributes.HOST_NAME: + ams_value = metadata_json["name"] + elif attribute_key == ResourceAttributes.HOST_TYPE: + ams_value = metadata_json["vmSize"] + elif attribute_key == ResourceAttributes.OS_TYPE: + ams_value = metadata_json["osType"] + elif attribute_key == ResourceAttributes.OS_VERSION: + ams_value = metadata_json["version"] + return ams_value diff --git a/resource/opentelemetry-resource-detector-azure/tests/__init__.py b/resource/opentelemetry-resource-detector-azure/tests/__init__.py new file mode 100644 index 0000000000..b0a6f42841 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/tests/__init__.py @@ -0,0 +1,13 @@ +# 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. diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py new file mode 100644 index 0000000000..f5d6a0dd3d --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py @@ -0,0 +1,116 @@ +# 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. +import unittest +from unittest.mock import patch + +from opentelemetry.resource.detector.azure.app_service import ( + AzureAppServiceResourceDetector, +) + +TEST_WEBSITE_SITE_NAME = "TEST_WEBSITE_SITE_NAME" +TEST_REGION_NAME = "TEST_REGION_NAME" +TEST_WEBSITE_SLOT_NAME = "TEST_WEBSITE_SLOT_NAME" +TEST_WEBSITE_HOSTNAME = "TEST_WEBSITE_HOSTNAME" +TEST_WEBSITE_INSTANCE_ID = "TEST_WEBSITE_INSTANCE_ID" +TEST_WEBSITE_HOME_STAMPNAME = "TEST_WEBSITE_HOME_STAMPNAME" + +TEST_WEBSITE_RESOURCE_GROUP = "TEST_WEBSITE_RESOURCE_GROUP" +TEST_WEBSITE_OWNER_NAME = "TEST_WEBSITE_OWNER_NAME" + +class TestAzureAppServiceResourceDetector(unittest.TestCase): + @patch.dict("os.environ", { + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_RESOURCE_GROUP": TEST_WEBSITE_RESOURCE_GROUP, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, clear=True) + def test_on_app_service(self): + resource = AzureAppServiceResourceDetector().detect() + attributes = resource.attributes + self.assertEqual(attributes["service.name"], TEST_WEBSITE_SITE_NAME) + self.assertEqual(attributes["cloud.provider"], "azure") + self.assertEqual(attributes["cloud.platform"], "azure_app_service") + + self.assertEqual(attributes["cloud.resource_id"], \ + f"/subscriptions/{TEST_WEBSITE_OWNER_NAME}/resourceGroups/{TEST_WEBSITE_RESOURCE_GROUP}/providers/Microsoft.Web/sites/{TEST_WEBSITE_SITE_NAME}") + + self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) + self.assertEqual(attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME) + self.assertEqual(attributes["host.id"], TEST_WEBSITE_HOSTNAME) + self.assertEqual(attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID) + self.assertEqual(attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME) + + @patch.dict("os.environ", { + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, clear=True) + def test_on_app_service_no_resource_group(self): + resource = AzureAppServiceResourceDetector().detect() + attributes = resource.attributes + self.assertEqual(attributes["service.name"], TEST_WEBSITE_SITE_NAME) + self.assertEqual(attributes["cloud.provider"], "azure") + self.assertEqual(attributes["cloud.platform"], "azure_app_service") + + self.assertTrue("cloud.resource_id" not in attributes) + + self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) + self.assertEqual(attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME) + self.assertEqual(attributes["host.id"], TEST_WEBSITE_HOSTNAME) + self.assertEqual(attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID) + self.assertEqual(attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME) + + @patch.dict("os.environ", { + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, clear=True) + def test_on_app_service_no_owner(self): + resource = AzureAppServiceResourceDetector().detect() + attributes = resource.attributes + self.assertEqual(attributes["service.name"], TEST_WEBSITE_SITE_NAME) + self.assertEqual(attributes["cloud.provider"], "azure") + self.assertEqual(attributes["cloud.platform"], "azure_app_service") + + self.assertTrue("cloud.resource_id" not in attributes) + + self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) + self.assertEqual(attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME) + self.assertEqual(attributes["host.id"], TEST_WEBSITE_HOSTNAME) + self.assertEqual(attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID) + self.assertEqual(attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME) + + @patch.dict("os.environ", { + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, clear=True) + def test_off_app_service(self): + resource = AzureAppServiceResourceDetector().detect() + self.assertEqual(resource.attributes, {}) diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py new file mode 100644 index 0000000000..0531fa02b1 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py @@ -0,0 +1,382 @@ +# 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. +import unittest +from unittest.mock import patch, Mock + +from opentelemetry.semconv.resource import ResourceAttributes +from opentelemetry.resource.detector.azure.vm import ( + AzureVMResourceDetector, +) + +LINUX_JSON = """ +{ + "additionalCapabilities": { + "hibernationEnabled": "false" + }, + "azEnvironment": "AzurePublicCloud", + "customData": "", + "evictionPolicy": "", + "extendedLocation": { + "name": "", + "type": "" + }, + "host": { + "id": "" + }, + "hostGroup": { + "id": "" + }, + "isHostCompatibilityLayerVm": "true", + "licenseType": "", + "location": "westus", + "name": "examplevmname", + "offer": "0001-com-ubuntu-server-focal", + "osProfile": { + "adminUsername": "azureuser", + "computerName": "examplevmname", + "disablePasswordAuthentication": "true" + }, + "osType": "Linux", + "placementGroupId": "", + "plan": { + "name": "", + "product": "", + "publisher": "" + }, + "platformFaultDomain": "0", + "platformSubFaultDomain": "", + "platformUpdateDomain": "0", + "priority": "", + "provider": "Microsoft.Compute", + "publicKeys": [ + { + "keyData": "ssh-rsa 0", + "path": "/home/user/.ssh/authorized_keys0" + }, + { + "keyData": "ssh-rsa 1", + "path": "/home/user/.ssh/authorized_keys1" + } + ], + "publisher": "canonical", + "resourceGroupName": "macikgo-test-may-23", + "resourceId": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/virtualMachines/examplevmname", + "securityProfile": { + "encryptionAtHost": "false", + "secureBootEnabled": "true", + "securityType": "TrustedLaunch", + "virtualTpmEnabled": "true" + }, + "sku": "20_04-lts-gen2", + "storageProfile": { + "dataDisks": [ + { + "bytesPerSecondThrottle": "979202048", + "caching": "None", + "createOption": "Empty", + "diskCapacityBytes": "274877906944", + "diskSizeGB": "1024", + "image": { + "uri": "" + }, + "isSharedDisk": "false", + "isUltraDisk": "true", + "lun": "0", + "managedDisk": { + "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/disks/exampledatadiskname", + "storageAccountType": "StandardSSD_LRS" + }, + "name": "exampledatadiskname", + "opsPerSecondThrottle": "65280", + "vhd": { + "uri": "" + }, + "writeAcceleratorEnabled": "false" + } + ], + "imageReference": { + "id": "", + "offer": "0001-com-ubuntu-server-focal", + "publisher": "canonical", + "sku": "20_04-lts-gen2", + "version": "latest" + }, + "osDisk": { + "caching": "ReadWrite", + "createOption": "FromImage", + "diffDiskSettings": { + "option": "" + }, + "diskSizeGB": "30", + "encryptionSettings": { + "enabled": "false", + "diskEncryptionKey": { + "sourceVault": { + "id": "/subscriptions/test-source-guid/resourceGroups/testrg/providers/Microsoft.KeyVault/vaults/test-kv" + }, + "secretUrl": "https://test-disk.vault.azure.net/secrets/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" + }, + "keyEncryptionKey": { + "sourceVault": { + "id": "/subscriptions/test-key-guid/resourceGroups/testrg/providers/Microsoft.KeyVault/vaults/test-kv" + }, + "keyUrl": "https://test-key.vault.azure.net/secrets/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" + } + }, + "image": { + "uri": "" + }, + "managedDisk": { + "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/disks/exampleosdiskname", + "storageAccountType": "StandardSSD_LRS" + }, + "name": "exampledatadiskname", + "osType": "Linux", + "vhd": { + "uri": "" + }, + "writeAcceleratorEnabled": "false" + }, + "resourceDisk": { + "size": "16384" + } + }, + "subscriptionId": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", + "tags": "azsecpack:nonprod;platformsettings.host_environment.service.platform_optedin_for_rootcerts:true", + "tagsList": [ + { + "name": "azsecpack", + "value": "nonprod" + }, + { + "name": "platformsettings.host_environment.service.platform_optedin_for_rootcerts", + "value": "true" + } + ], + "userData": "", + "version": "20.04.202307240", + "virtualMachineScaleSet": { + "id": "/subscriptions/xxxxxxxx-xxxxx-xxx-xxx-xxxx/resourceGroups/resource-group-name/providers/Microsoft.Compute/virtualMachineScaleSets/virtual-machine-scale-set-name" + }, + "vmId": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", + "vmScaleSetName": "crpteste9vflji9", + "vmSize": "Standard_A3", + "zone": "1" +} +""" +WINDOWS_JSON =""" +{ + "additionalCapabilities": { + "hibernationEnabled": "false" + }, + "azEnvironment": "AzurePublicCloud", + "customData": "", + "evictionPolicy": "", + "extendedLocation": { + "name": "", + "type": "" + }, + "host": { + "id": "" + }, + "hostGroup": { + "id": "" + }, + "isHostCompatibilityLayerVm": "true", + "licenseType": "Windows_Client", + "location": "westus", + "name": "examplevmname", + "offer": "WindowsServer", + "osProfile": { + "adminUsername": "azureuser", + "computerName": "examplevmname", + "disablePasswordAuthentication": "true" + }, + "osType": "Windows", + "placementGroupId": "", + "plan": { + "name": "", + "product": "", + "publisher": "" + }, + "platformFaultDomain": "0", + "platformSubFaultDomain": "", + "platformUpdateDomain": "0", + "priority": "", + "provider": "Microsoft.Compute", + "publicKeys": [ + { + "keyData": "ssh-rsa 0", + "path": "/home/user/.ssh/authorized_keys0" + }, + { + "keyData": "ssh-rsa 1", + "path": "/home/user/.ssh/authorized_keys1" + } + ], + "publisher": "RDFE-Test-Microsoft-Windows-Server-Group", + "resourceGroupName": "macikgo-test-may-23", + "resourceId": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/virtualMachines/examplevmname", + "securityProfile": { + "encryptionAtHost": "false", + "secureBootEnabled": "true", + "securityType": "TrustedLaunch", + "virtualTpmEnabled": "true" + }, + "sku": "2019-Datacenter", + "storageProfile": { + "dataDisks": [ + { + "bytesPerSecondThrottle": "979202048", + "caching": "None", + "createOption": "Empty", + "diskCapacityBytes": "274877906944", + "diskSizeGB": "1024", + "image": { + "uri": "" + }, + "isSharedDisk": "false", + "isUltraDisk": "true", + "lun": "0", + "managedDisk": { + "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/disks/exampledatadiskname", + "storageAccountType": "StandardSSD_LRS" + }, + "name": "exampledatadiskname", + "opsPerSecondThrottle": "65280", + "vhd": { + "uri": "" + }, + "writeAcceleratorEnabled": "false" + } + ], + "imageReference": { + "id": "", + "offer": "WindowsServer", + "publisher": "MicrosoftWindowsServer", + "sku": "2019-Datacenter", + "version": "latest" + }, + "osDisk": { + "caching": "ReadWrite", + "createOption": "FromImage", + "diffDiskSettings": { + "option": "" + }, + "diskSizeGB": "30", + "encryptionSettings": { + "enabled": "false", + "diskEncryptionKey": { + "sourceVault": { + "id": "/subscriptions/test-source-guid/resourceGroups/testrg/providers/Microsoft.KeyVault/vaults/test-kv" + }, + "secretUrl": "https://test-disk.vault.azure.net/secrets/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" + }, + "keyEncryptionKey": { + "sourceVault": { + "id": "/subscriptions/test-key-guid/resourceGroups/testrg/providers/Microsoft.KeyVault/vaults/test-kv" + }, + "keyUrl": "https://test-key.vault.azure.net/secrets/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" + } + }, + "image": { + "uri": "" + }, + "managedDisk": { + "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/disks/exampleosdiskname", + "storageAccountType": "StandardSSD_LRS" + }, + "name": "exampledatadiskname", + "osType": "Windows", + "vhd": { + "uri": "" + }, + "writeAcceleratorEnabled": "false" + }, + "resourceDisk": { + "size": "16384" + } + }, + "subscriptionId": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", + "tags": "azsecpack:nonprod;platformsettings.host_environment.service.platform_optedin_for_rootcerts:true", + "userData": "Zm9vYmFy", + "tagsList": [ + { + "name": "azsecpack", + "value": "nonprod" + }, + { + "name": "platformsettings.host_environment.service.platform_optedin_for_rootcerts", + "value": "true" + } + ], + "userData": "", + "version": "20.04.202307240", + "virtualMachineScaleSet": { + "id": "/subscriptions/xxxxxxxx-xxxxx-xxx-xxx-xxxx/resourceGroups/resource-group-name/providers/Microsoft.Compute/virtualMachineScaleSets/virtual-machine-scale-set-name" + }, + "vmId": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", + "vmScaleSetName": "crpteste9vflji9", + "vmSize": "Standard_A3", + "zone": "1" +} +""" +LINUX_ATTRIBUTES = { + "azure.vm.scaleset.name": "crpteste9vflji9", + "azure.vm.sku": "20_04-lts-gen2", + "cloud.platform": "azure_vm", + "cloud.provider": "azure", + "cloud.region": "westus", + "cloud.resource_id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/virtualMachines/examplevmname", + "host.id": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", + "host.name": "examplevmname", + "host.type": "Standard_A3", + "os.type": "Linux", + "os.version": "20.04.202307240", + "service.instance.id": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", +} +WINDOWS_ATTRIBUTES = { + "azure.vm.scaleset.name": "crpteste9vflji9", + "azure.vm.sku": "2019-Datacenter", + "cloud.platform": "azure_vm", + "cloud.provider": "azure", + "cloud.region": "westus", + "cloud.resource_id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/resourceGroups/macikgo-test-may-23/providers/Microsoft.Compute/virtualMachines/examplevmname", + "host.id": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", + "host.name": "examplevmname", + "host.type": "Standard_A3", + "os.type": "Windows", + "os.version": "20.04.202307240", + "service.instance.id": "02aab8a4-74ef-476e-8182-f6d2ba4166a6", +} + + +class TestAzureVMResourceDetector(unittest.TestCase): + @patch("opentelemetry.resource.detector.azure.vm.urlopen") + def test_linux(self, mock_urlopen): + mock_open = Mock() + mock_urlopen.return_value = mock_open + mock_open.read.return_value = LINUX_JSON + attributes = AzureVMResourceDetector().detect().attributes + for attribute_key in LINUX_ATTRIBUTES: + self.assertEqual(attributes[attribute_key], LINUX_ATTRIBUTES[attribute_key]) + + @patch("opentelemetry.resource.detector.azure.vm.urlopen") + def test_windows(self, mock_urlopen): + mock_open = Mock() + mock_urlopen.return_value = mock_open + mock_open.read.return_value = WINDOWS_JSON + attributes = AzureVMResourceDetector().detect().attributes + for attribute_key in WINDOWS_ATTRIBUTES: + self.assertEqual(attributes[attribute_key], WINDOWS_ATTRIBUTES[attribute_key]) diff --git a/resource/opentelemetry-resource-detector-container/MANIFEST.rst b/resource/opentelemetry-resource-detector-container/MANIFEST.rst new file mode 100644 index 0000000000..2906eeef0f --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/MANIFEST.rst @@ -0,0 +1,9 @@ +graft src +graft tests +global-exclude *.pyc +global-exclude *.pyo +global-exclude __pycache__/* +include CHANGELOG.md +include MANIFEST.in +include README.rst +include LICENSE \ No newline at end of file From 0871dd455c0adfa125a2f258a0b55c47a5da5227 Mon Sep 17 00:00:00 2001 From: Raphael Philipe Mendes da Silva Date: Mon, 21 Aug 2023 09:42:12 -0700 Subject: [PATCH 049/200] Revert "update awslambda to use _X_AMZN_TRACE_ID as a Span Link" (#1911) Co-authored-by: Diego Hurtado --- CHANGELOG.md | 3 - .../instrumentation/aws_lambda/__init__.py | 80 ++++++----- .../test_aws_lambda_instrumentation_manual.py | 133 +++++++++--------- tox.ini | 2 +- 4 files changed, 114 insertions(+), 104 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bb0bb80b2..7d56bcc43b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -162,9 +162,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1592](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1592)) - `opentelemetry-instrumentation-django` Allow explicit `excluded_urls` configuration through `instrument()` ([#1618](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1618)) -- `opentelemetry-instrumentation-aws-lambda` Use env var `_X_AMZN_TRACE_ID` as a - Span Link instead of parent - ([#1657](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1657)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index bd19871140..799becbdcc 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -71,7 +71,7 @@ def custom_event_context_extractor(lambda_event): import os import time from importlib import import_module -from typing import Any, Callable, Collection, Optional, Sequence +from typing import Any, Callable, Collection from urllib.parse import urlencode from wrapt import wrap_function_wrapper @@ -90,7 +90,6 @@ def custom_event_context_extractor(lambda_event): from opentelemetry.semconv.resource import ResourceAttributes from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace import ( - Link, Span, SpanKind, TracerProvider, @@ -107,6 +106,9 @@ def custom_event_context_extractor(lambda_event): OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT = ( "OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT" ) +OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION = ( + "OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION" +) def _default_event_context_extractor(lambda_event: Any) -> Context: @@ -140,12 +142,14 @@ def _default_event_context_extractor(lambda_event: Any) -> Context: def _determine_parent_context( - lambda_event: Any, event_context_extractor: Callable[[Any], Context] + lambda_event: Any, + event_context_extractor: Callable[[Any], Context], + disable_aws_context_propagation: bool = False, ) -> Context: """Determine the parent context for the current Lambda invocation. See more: - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md + https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md#determining-the-parent-of-a-span Args: lambda_event: user-defined, so it could be anything, but this @@ -154,11 +158,30 @@ def _determine_parent_context( Event as input and extracts an OTel Context from it. By default, the context is extracted from the HTTP headers of an API Gateway request. + disable_aws_context_propagation: By default, this instrumentation + will try to read the context from the `_X_AMZN_TRACE_ID` environment + variable set by Lambda, set this to `True` to disable this behavior. Returns: A Context with configuration found in the carrier. """ parent_context = None + if not disable_aws_context_propagation: + xray_env_var = os.environ.get(_X_AMZN_TRACE_ID) + + if xray_env_var: + parent_context = AwsXRayPropagator().extract( + {TRACE_HEADER_KEY: xray_env_var} + ) + + if ( + parent_context + and get_current_span(parent_context) + .get_span_context() + .trace_flags.sampled + ): + return parent_context + if event_context_extractor: parent_context = event_context_extractor(lambda_event) else: @@ -167,33 +190,6 @@ def _determine_parent_context( return parent_context -def _determine_links() -> Optional[Sequence[Link]]: - """Determine if a Link should be added to the Span based on the - environment variable `_X_AMZN_TRACE_ID`. - - - See more: - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md#aws-x-ray-environment-span-link - - Returns: - A Link or None - """ - links = None - - xray_env_var = os.environ.get(_X_AMZN_TRACE_ID) - - if xray_env_var: - env_context = AwsXRayPropagator().extract( - {TRACE_HEADER_KEY: xray_env_var} - ) - - span_context = get_current_span(env_context).get_span_context() - if span_context.is_valid: - links = [Link(span_context, {"source": "x-ray-env"})] - - return links - - def _set_api_gateway_v1_proxy_attributes( lambda_event: Any, span: Span ) -> Span: @@ -288,6 +284,7 @@ def _instrument( flush_timeout, event_context_extractor: Callable[[Any], Context], tracer_provider: TracerProvider = None, + disable_aws_context_propagation: bool = False, meter_provider: MeterProvider = None, ): def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches @@ -300,11 +297,11 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches lambda_event = args[0] parent_context = _determine_parent_context( - lambda_event, event_context_extractor + lambda_event, + event_context_extractor, + disable_aws_context_propagation, ) - links = _determine_links() - span_kind = None try: if lambda_event["Records"][0]["eventSource"] in { @@ -330,7 +327,6 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches name=orig_handler_name, context=parent_context, kind=span_kind, - links=links, ) as span: if span.is_recording(): lambda_context = args[1] @@ -424,6 +420,9 @@ def _instrument(self, **kwargs): Event as input and extracts an OTel Context from it. By default, the context is extracted from the HTTP headers of an API Gateway request. + ``disable_aws_context_propagation``: By default, this instrumentation + will try to read the context from the `_X_AMZN_TRACE_ID` environment + variable set by Lambda, set this to `True` to disable this behavior. """ lambda_handler = os.environ.get(ORIG_HANDLER, os.environ.get(_HANDLER)) # pylint: disable=attribute-defined-outside-init @@ -445,6 +444,16 @@ def _instrument(self, **kwargs): flush_timeout_env, ) + disable_aws_context_propagation = kwargs.get( + "disable_aws_context_propagation", False + ) or os.getenv( + OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION, "False" + ).strip().lower() in ( + "true", + "1", + "t", + ) + _instrument( self._wrapped_module_name, self._wrapped_function_name, @@ -453,6 +462,7 @@ def _instrument(self, **kwargs): "event_context_extractor", _default_event_context_extractor ), tracer_provider=kwargs.get("tracer_provider"), + disable_aws_context_propagation=disable_aws_context_propagation, meter_provider=kwargs.get("meter_provider"), ) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py index 544022086c..1df7499d31 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py @@ -27,6 +27,7 @@ _HANDLER, _X_AMZN_TRACE_ID, OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT, + OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION, AwsLambdaInstrumentor, ) from opentelemetry.propagate import get_global_textmap @@ -137,9 +138,7 @@ def test_active_tracing(self): self.assertEqual(len(spans), 1) span = spans[0] self.assertEqual(span.name, os.environ[_HANDLER]) - self.assertNotEqual( - span.get_span_context().trace_id, MOCK_XRAY_TRACE_ID - ) + self.assertEqual(span.get_span_context().trace_id, MOCK_XRAY_TRACE_ID) self.assertEqual(span.kind, SpanKind.SERVER) self.assertSpanHasAttributes( span, @@ -150,7 +149,11 @@ def test_active_tracing(self): ) parent_context = span.parent - self.assertEqual(None, parent_context) + self.assertEqual( + parent_context.trace_id, span.get_span_context().trace_id + ) + self.assertEqual(parent_context.span_id, MOCK_XRAY_PARENT_SPAN_ID) + self.assertTrue(parent_context.is_remote) test_env_patch.stop() @@ -162,8 +165,11 @@ class TestCase: context: Dict expected_traceid: int expected_parentid: int + xray_traceid: str expected_state_value: str = None expected_trace_state_len: int = 0 + disable_aws_context_propagation: bool = False + disable_aws_context_propagation_envvar: str = "" def custom_event_context_extractor(lambda_event): return get_global_textmap().extract(lambda_event["foo"]["headers"]) @@ -182,9 +188,42 @@ def custom_event_context_extractor(lambda_event): expected_parentid=MOCK_W3C_PARENT_SPAN_ID, expected_trace_state_len=3, expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, + xray_traceid=MOCK_XRAY_TRACE_CONTEXT_NOT_SAMPLED, + ), + TestCase( + name="custom_extractor_not_sampled_xray", + custom_extractor=custom_event_context_extractor, + context={ + "foo": { + "headers": { + TraceContextTextMapPropagator._TRACEPARENT_HEADER_NAME: MOCK_W3C_TRACE_CONTEXT_SAMPLED, + TraceContextTextMapPropagator._TRACESTATE_HEADER_NAME: f"{MOCK_W3C_TRACE_STATE_KEY}={MOCK_W3C_TRACE_STATE_VALUE},foo=1,bar=2", + } + } + }, + expected_traceid=MOCK_W3C_TRACE_ID, + expected_parentid=MOCK_W3C_PARENT_SPAN_ID, + expected_trace_state_len=3, + expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, + xray_traceid=MOCK_XRAY_TRACE_CONTEXT_NOT_SAMPLED, + ), + TestCase( + name="custom_extractor_sampled_xray", + custom_extractor=custom_event_context_extractor, + context={ + "foo": { + "headers": { + TraceContextTextMapPropagator._TRACEPARENT_HEADER_NAME: MOCK_W3C_TRACE_CONTEXT_SAMPLED, + TraceContextTextMapPropagator._TRACESTATE_HEADER_NAME: f"{MOCK_W3C_TRACE_STATE_KEY}={MOCK_W3C_TRACE_STATE_VALUE},foo=1,bar=2", + } + } + }, + expected_traceid=MOCK_XRAY_TRACE_ID, + expected_parentid=MOCK_XRAY_PARENT_SPAN_ID, + xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, ), TestCase( - name="custom_extractor", + name="custom_extractor_sampled_xray_disable_aws_propagation", custom_extractor=custom_event_context_extractor, context={ "foo": { @@ -194,10 +233,29 @@ def custom_event_context_extractor(lambda_event): } } }, + disable_aws_context_propagation=True, expected_traceid=MOCK_W3C_TRACE_ID, expected_parentid=MOCK_W3C_PARENT_SPAN_ID, expected_trace_state_len=3, expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, + xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, + ), + TestCase( + name="no_custom_extractor_xray_disable_aws_propagation_via_env_var", + custom_extractor=None, + context={ + "headers": { + TraceContextTextMapPropagator._TRACEPARENT_HEADER_NAME: MOCK_W3C_TRACE_CONTEXT_SAMPLED, + TraceContextTextMapPropagator._TRACESTATE_HEADER_NAME: f"{MOCK_W3C_TRACE_STATE_KEY}={MOCK_W3C_TRACE_STATE_VALUE},foo=1,bar=2", + } + }, + disable_aws_context_propagation=False, + disable_aws_context_propagation_envvar="true", + expected_traceid=MOCK_W3C_TRACE_ID, + expected_parentid=MOCK_W3C_PARENT_SPAN_ID, + expected_trace_state_len=3, + expected_state_value=MOCK_W3C_TRACE_STATE_VALUE, + xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, ), ] for test in tests: @@ -205,13 +263,17 @@ def custom_event_context_extractor(lambda_event): "os.environ", { **os.environ, + # NOT Active Tracing + _X_AMZN_TRACE_ID: test.xray_traceid, + OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION: test.disable_aws_context_propagation_envvar, # NOT using the X-Ray Propagator OTEL_PROPAGATORS: "tracecontext", }, ) test_env_patch.start() AwsLambdaInstrumentor().instrument( - event_context_extractor=test.custom_extractor + event_context_extractor=test.custom_extractor, + disable_aws_context_propagation=test.disable_aws_context_propagation, ) mock_execute_lambda(test.context) spans = self.memory_exporter.get_finished_spans() @@ -239,65 +301,6 @@ def custom_event_context_extractor(lambda_event): AwsLambdaInstrumentor().uninstrument() test_env_patch.stop() - def test_links_from_lambda_event(self): - @dataclass - class TestCase: - name: str - context: Dict - expected_link_trace_id: int - expected_link_attributes: dict - xray_traceid: str - - tests = [ - TestCase( - name="valid_xray_trace", - context={}, - expected_link_trace_id=MOCK_XRAY_TRACE_ID, - expected_link_attributes={"source": "x-ray-env"}, - xray_traceid=MOCK_XRAY_TRACE_CONTEXT_SAMPLED, - ), - TestCase( - name="invalid_xray_trace", - context={}, - expected_link_trace_id=None, - expected_link_attributes={}, - xray_traceid="0", - ), - ] - for test in tests: - test_env_patch = mock.patch.dict( - "os.environ", - { - **os.environ, - # NOT Active Tracing - _X_AMZN_TRACE_ID: test.xray_traceid, - # NOT using the X-Ray Propagator - OTEL_PROPAGATORS: "tracecontext", - }, - ) - test_env_patch.start() - AwsLambdaInstrumentor().instrument() - mock_execute_lambda(test.context) - spans = self.memory_exporter.get_finished_spans() - assert spans - self.assertEqual(len(spans), 1) - span = spans[0] - - if test.expected_link_trace_id is None: - self.assertEqual(0, len(span.links)) - else: - link = span.links[0] - self.assertEqual( - link.context.trace_id, test.expected_link_trace_id - ) - self.assertEqual( - link.attributes, test.expected_link_attributes - ) - - self.memory_exporter.clear() - AwsLambdaInstrumentor().uninstrument() - test_env_patch.stop() - def test_lambda_no_error_with_invalid_flush_timeout(self): test_env_patch = mock.patch.dict( "os.environ", diff --git a/tox.ini b/tox.ini index 2c48dfd1bb..b4fe0690a8 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ envlist = ; instrumentation-aiopg intentionally excluded from pypy3 ; opentelemetry-instrumentation-aws-lambda - py3{7,8,9,10,11}-test-instrumentation-aws-lambda + py3{7,8,9}-test-instrumentation-aws-lambda ; opentelemetry-instrumentation-botocore py3{7,8,9,10,11}-test-instrumentation-botocore From d854c52d23802ac7b0d7bd5e89e28bcae923d41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Fern=C3=A1ndez=20Rodr=C3=ADguez?= Date: Wed, 30 Aug 2023 17:03:05 +0200 Subject: [PATCH 050/200] feat(confluent-kafka): Add instrumentation to consume method (#1786) Co-authored-by: Diego Hurtado --- CHANGELOG.md | 4 + .../confluent_kafka/__init__.py | 73 ++++++--- .../instrumentation/confluent_kafka/utils.py | 34 +++- .../tests/test_instrumentation.py | 146 +++++++++++++++++- .../tests/utils.py | 39 +++++ 5 files changed, 271 insertions(+), 25 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d56bcc43b..147202d211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add optional distro and configurator selection for auto-instrumentation ([#1823](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1823)) +### Added +- `opentelemetry-instrumentation-kafka-python` Add instrumentation to `consume` method + ([#1786](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1786)) + ## Version 1.18.0/0.39b0 (2023-05-10) - Update runtime metrics to follow semantic conventions diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py index 12cb363219..c4e68b33b4 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py @@ -112,6 +112,8 @@ def instrument_consumer(consumer: Consumer, tracer_provider=None) from .package import _instruments from .utils import ( KafkaPropertiesExtractor, + _end_current_consume_span, + _create_new_consume_span, _enrich_span, _get_span_name, _kafka_getter, @@ -137,6 +139,12 @@ def __init__(self, config): def poll(self, timeout=-1): # pylint: disable=useless-super-delegation return super().poll(timeout) + # This method is deliberately implemented in order to allow wrapt to wrap this function + def consume( + self, *args, **kwargs + ): # pylint: disable=useless-super-delegation + return super().consume(*args, **kwargs) + class ProxiedProducer(Producer): def __init__(self, producer: Producer, tracer: Tracer): @@ -177,10 +185,14 @@ def committed(self, partitions, timeout=-1): def commit(self, *args, **kwargs): return self._consumer.commit(*args, **kwargs) - def consume( - self, num_messages=1, *args, **kwargs - ): # pylint: disable=keyword-arg-before-vararg - return self._consumer.consume(num_messages, *args, **kwargs) + def consume(self, *args, **kwargs): + return ConfluentKafkaInstrumentor.wrap_consume( + self._consumer.consume, + self, + self._tracer, + args, + kwargs, + ) def get_watermark_offsets( self, partition, timeout=-1, *args, **kwargs @@ -275,6 +287,11 @@ def _inner_wrap_poll(func, instance, args, kwargs): func, instance, self._tracer, args, kwargs ) + def _inner_wrap_consume(func, instance, args, kwargs): + return ConfluentKafkaInstrumentor.wrap_consume( + func, instance, self._tracer, args, kwargs + ) + wrapt.wrap_function_wrapper( AutoInstrumentedProducer, "produce", @@ -287,6 +304,12 @@ def _inner_wrap_poll(func, instance, args, kwargs): _inner_wrap_poll, ) + wrapt.wrap_function_wrapper( + AutoInstrumentedConsumer, + "consume", + _inner_wrap_consume, + ) + def _uninstrument(self, **kwargs): confluent_kafka.Producer = self._original_kafka_producer confluent_kafka.Consumer = self._original_kafka_consumer @@ -326,29 +349,14 @@ def wrap_produce(func, instance, tracer, args, kwargs): @staticmethod def wrap_poll(func, instance, tracer, args, kwargs): if instance._current_consume_span: - context.detach(instance._current_context_token) - instance._current_context_token = None - instance._current_consume_span.end() - instance._current_consume_span = None + _end_current_consume_span(instance) with tracer.start_as_current_span( "recv", end_on_exit=True, kind=trace.SpanKind.CONSUMER ): record = func(*args, **kwargs) if record: - links = [] - ctx = propagate.extract(record.headers(), getter=_kafka_getter) - if ctx: - for item in ctx.values(): - if hasattr(item, "get_span_context"): - links.append(Link(context=item.get_span_context())) - - instance._current_consume_span = tracer.start_span( - name=f"{record.topic()} process", - links=links, - kind=SpanKind.CONSUMER, - ) - + _create_new_consume_span(instance, tracer, [record]) _enrich_span( instance._current_consume_span, record.topic(), @@ -361,3 +369,26 @@ def wrap_poll(func, instance, tracer, args, kwargs): ) return record + + @staticmethod + def wrap_consume(func, instance, tracer, args, kwargs): + if instance._current_consume_span: + _end_current_consume_span(instance) + + with tracer.start_as_current_span( + "recv", end_on_exit=True, kind=trace.SpanKind.CONSUMER + ): + records = func(*args, **kwargs) + if len(records) > 0: + _create_new_consume_span(instance, tracer, records) + _enrich_span( + instance._current_consume_span, + records[0].topic(), + operation=MessagingOperationValues.PROCESS, + ) + + instance._current_context_token = context.attach( + trace.set_span_in_context(instance._current_consume_span) + ) + + return records diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py index 77fce03cd8..2029960703 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py @@ -1,6 +1,8 @@ from logging import getLogger from typing import List, Optional +from opentelemetry import context, propagate +from opentelemetry.trace import SpanKind, Link from opentelemetry.propagators import textmap from opentelemetry.semconv.trace import ( MessagingDestinationKindValues, @@ -81,6 +83,34 @@ def set(self, carrier: textmap.CarrierT, key: str, value: str) -> None: _kafka_getter = KafkaContextGetter() +def _end_current_consume_span(instance): + context.detach(instance._current_context_token) + instance._current_context_token = None + instance._current_consume_span.end() + instance._current_consume_span = None + + +def _create_new_consume_span(instance, tracer, records): + links = _get_links_from_records(records) + instance._current_consume_span = tracer.start_span( + name=f"{records[0].topic()} process", + links=links, + kind=SpanKind.CONSUMER, + ) + + +def _get_links_from_records(records): + links = [] + for record in records: + ctx = propagate.extract(record.headers(), getter=_kafka_getter) + if ctx: + for item in ctx.values(): + if hasattr(item, "get_span_context"): + links.append(Link(context=item.get_span_context())) + + return links + + def _enrich_span( span, topic, @@ -94,7 +124,7 @@ def _enrich_span( span.set_attribute(SpanAttributes.MESSAGING_SYSTEM, "kafka") span.set_attribute(SpanAttributes.MESSAGING_DESTINATION, topic) - if partition: + if partition is not None: span.set_attribute(SpanAttributes.MESSAGING_KAFKA_PARTITION, partition) span.set_attribute( @@ -109,7 +139,7 @@ def _enrich_span( # https://stackoverflow.com/questions/65935155/identify-and-find-specific-message-in-kafka-topic # A message within Kafka is uniquely defined by its topic name, topic partition and offset. - if partition and offset and topic: + if partition is not None and offset is not None and topic: span.set_attribute( SpanAttributes.MESSAGING_MESSAGE_ID, f"{topic}.{partition}.{offset}", diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py index 1e3f304188..d7ac343dbf 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py @@ -14,7 +14,12 @@ # pylint: disable=no-name-in-module -from unittest import TestCase +from opentelemetry.semconv.trace import ( + SpanAttributes, + MessagingDestinationKindValues, +) +from opentelemetry.test.test_base import TestBase +from .utils import MockConsumer, MockedMessage from confluent_kafka import Consumer, Producer @@ -29,7 +34,7 @@ ) -class TestConfluentKafka(TestCase): +class TestConfluentKafka(TestBase): def test_instrument_api(self) -> None: instrumentation = ConfluentKafkaInstrumentor() @@ -104,3 +109,140 @@ def test_context_getter(self) -> None: context_setter.set(carrier_list, "key1", "val1") self.assertEqual(context_getter.get(carrier_list, "key1"), ["val1"]) self.assertEqual(["key1"], context_getter.keys(carrier_list)) + + def test_poll(self) -> None: + instrumentation = ConfluentKafkaInstrumentor() + mocked_messages = [ + MockedMessage("topic-10", 0, 0, []), + MockedMessage("topic-20", 2, 4, []), + MockedMessage("topic-30", 1, 3, []), + ] + expected_spans = [ + {"name": "recv", "attributes": {}}, + { + "name": "topic-10 process", + "attributes": { + SpanAttributes.MESSAGING_OPERATION: "process", + SpanAttributes.MESSAGING_KAFKA_PARTITION: 0, + SpanAttributes.MESSAGING_SYSTEM: "kafka", + SpanAttributes.MESSAGING_DESTINATION: "topic-10", + SpanAttributes.MESSAGING_DESTINATION_KIND: MessagingDestinationKindValues.QUEUE.value, + SpanAttributes.MESSAGING_MESSAGE_ID: "topic-10.0.0", + }, + }, + {"name": "recv", "attributes": {}}, + { + "name": "topic-20 process", + "attributes": { + SpanAttributes.MESSAGING_OPERATION: "process", + SpanAttributes.MESSAGING_KAFKA_PARTITION: 2, + SpanAttributes.MESSAGING_SYSTEM: "kafka", + SpanAttributes.MESSAGING_DESTINATION: "topic-20", + SpanAttributes.MESSAGING_DESTINATION_KIND: MessagingDestinationKindValues.QUEUE.value, + SpanAttributes.MESSAGING_MESSAGE_ID: "topic-20.2.4", + }, + }, + {"name": "recv", "attributes": {}}, + { + "name": "topic-30 process", + "attributes": { + SpanAttributes.MESSAGING_OPERATION: "process", + SpanAttributes.MESSAGING_KAFKA_PARTITION: 1, + SpanAttributes.MESSAGING_SYSTEM: "kafka", + SpanAttributes.MESSAGING_DESTINATION: "topic-30", + SpanAttributes.MESSAGING_DESTINATION_KIND: MessagingDestinationKindValues.QUEUE.value, + SpanAttributes.MESSAGING_MESSAGE_ID: "topic-30.1.3", + }, + }, + {"name": "recv", "attributes": {}}, + ] + + consumer = MockConsumer( + mocked_messages, + { + "bootstrap.servers": "localhost:29092", + "group.id": "mygroup", + "auto.offset.reset": "earliest", + }, + ) + self.memory_exporter.clear() + consumer = instrumentation.instrument_consumer(consumer) + consumer.poll() + consumer.poll() + consumer.poll() + consumer.poll() + + span_list = self.memory_exporter.get_finished_spans() + self._compare_spans(span_list, expected_spans) + + def test_consume(self) -> None: + instrumentation = ConfluentKafkaInstrumentor() + mocked_messages = [ + MockedMessage("topic-1", 0, 0, []), + MockedMessage("topic-1", 2, 1, []), + MockedMessage("topic-1", 3, 2, []), + MockedMessage("topic-2", 0, 0, []), + MockedMessage("topic-3", 0, 3, []), + MockedMessage("topic-2", 0, 1, []), + ] + expected_spans = [ + {"name": "recv", "attributes": {}}, + { + "name": "topic-1 process", + "attributes": { + SpanAttributes.MESSAGING_OPERATION: "process", + SpanAttributes.MESSAGING_SYSTEM: "kafka", + SpanAttributes.MESSAGING_DESTINATION: "topic-1", + SpanAttributes.MESSAGING_DESTINATION_KIND: MessagingDestinationKindValues.QUEUE.value, + }, + }, + {"name": "recv", "attributes": {}}, + { + "name": "topic-2 process", + "attributes": { + SpanAttributes.MESSAGING_OPERATION: "process", + SpanAttributes.MESSAGING_SYSTEM: "kafka", + SpanAttributes.MESSAGING_DESTINATION: "topic-2", + SpanAttributes.MESSAGING_DESTINATION_KIND: MessagingDestinationKindValues.QUEUE.value, + }, + }, + {"name": "recv", "attributes": {}}, + { + "name": "topic-3 process", + "attributes": { + SpanAttributes.MESSAGING_OPERATION: "process", + SpanAttributes.MESSAGING_SYSTEM: "kafka", + SpanAttributes.MESSAGING_DESTINATION: "topic-3", + SpanAttributes.MESSAGING_DESTINATION_KIND: MessagingDestinationKindValues.QUEUE.value, + }, + }, + {"name": "recv", "attributes": {}}, + ] + + consumer = MockConsumer( + mocked_messages, + { + "bootstrap.servers": "localhost:29092", + "group.id": "mygroup", + "auto.offset.reset": "earliest", + }, + ) + + self.memory_exporter.clear() + consumer = instrumentation.instrument_consumer(consumer) + consumer.consume(3) + consumer.consume(1) + consumer.consume(2) + consumer.consume(1) + span_list = self.memory_exporter.get_finished_spans() + self._compare_spans(span_list, expected_spans) + + def _compare_spans(self, spans, expected_spans): + for span, expected_span in zip(spans, expected_spans): + self.assertEqual(expected_span["name"], span.name) + for attribute_key, expected_attribute_value in expected_span[ + "attributes" + ].items(): + self.assertEqual( + expected_attribute_value, span.attributes[attribute_key] + ) diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py new file mode 100644 index 0000000000..798daaeff4 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py @@ -0,0 +1,39 @@ +from confluent_kafka import Consumer + + +class MockConsumer(Consumer): + def __init__(self, queue, config): + self._queue = queue + super().__init__(config) + + def consume( + self, num_messages=1, *args, **kwargs + ): # pylint: disable=keyword-arg-before-vararg + messages = self._queue[:num_messages] + self._queue = self._queue[num_messages:] + return messages + + def poll(self, timeout=None): + if len(self._queue) > 0: + return self._queue.pop(0) + return None + + +class MockedMessage: + def __init__(self, topic: str, partition: int, offset: int, headers): + self._topic = topic + self._partition = partition + self._offset = offset + self._headers = headers + + def topic(self): + return self._topic + + def partition(self): + return self._partition + + def offset(self): + return self._offset + + def headers(self): + return self._headers From a02d98cb3873da44d781c195125352d9fd4f034b Mon Sep 17 00:00:00 2001 From: mattcontinisio Date: Wed, 30 Aug 2023 11:40:14 -0400 Subject: [PATCH 051/200] Add Cassandra instrumentation (#1902) --- .github/component_owners.yml | 3 + CHANGELOG.md | 2 + docs-requirements.txt | 1 + docs/instrumentation/cassandra/cassandra.rst | 7 + instrumentation/README.md | 1 + .../LICENSE | 201 ++++++++++++++++++ .../README.rst | 25 +++ .../pyproject.toml | 60 ++++++ .../instrumentation/cassandra/__init__.py | 91 ++++++++ .../instrumentation/cassandra/package.py | 16 ++ .../instrumentation/cassandra/version.py | 15 ++ .../tests/__init__.py | 0 .../tests/test_cassandra_integration.py | 121 +++++++++++ .../pyproject.toml | 1 + .../instrumentation/bootstrap_gen.py | 8 + tox.ini | 8 + 16 files changed, 560 insertions(+) create mode 100644 docs/instrumentation/cassandra/cassandra.rst create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/LICENSE create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/README.rst create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/package.py create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/tests/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py diff --git a/.github/component_owners.yml b/.github/component_owners.yml index ebb9650a21..e31fde9b48 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -64,3 +64,6 @@ components: instrumentation/opentelemetry-instrumentation-requests: - ocelotl + + instrumentation/opentelemetry-instrumentation-cassandra: + - mattcontinisio diff --git a/CHANGELOG.md b/CHANGELOG.md index 147202d211..5f80b18eaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Add instrumentor support for cassandra and scylla + ([#1902](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1902)) - Add instrumentor support for mysqlclient ([#1744](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1744)) - Fix async redis clients not being traced correctly diff --git a/docs-requirements.txt b/docs-requirements.txt index b27a477ce0..32f4a406aa 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -25,6 +25,7 @@ asyncpg>=0.12.0 boto~=2.0 botocore~=1.0 boto3~=1.0 +cassandra-driver~=3.25 celery>=4.0 confluent-kafka>= 1.8.2,<= 2.2.0 elasticsearch>=2.0,<9.0 diff --git a/docs/instrumentation/cassandra/cassandra.rst b/docs/instrumentation/cassandra/cassandra.rst new file mode 100644 index 0000000000..2f2ab8b9f8 --- /dev/null +++ b/docs/instrumentation/cassandra/cassandra.rst @@ -0,0 +1,7 @@ +OpenTelemetry Cassandra Instrumentation +======================================= + +.. automodule:: opentelemetry.instrumentation.cassandra + :members: + :undoc-members: + :show-inheritance: diff --git a/instrumentation/README.md b/instrumentation/README.md index 4a4e3cc6da..12b8ada105 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -10,6 +10,7 @@ | [opentelemetry-instrumentation-boto](./opentelemetry-instrumentation-boto) | boto~=2.0 | No | [opentelemetry-instrumentation-boto3sqs](./opentelemetry-instrumentation-boto3sqs) | boto3 ~= 1.0 | No | [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 | No +| [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No | [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No | [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.2.0 | No | [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/LICENSE b/instrumentation/opentelemetry-instrumentation-cassandra/LICENSE new file mode 100644 index 0000000000..1ef7dad2c5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + 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. diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/README.rst b/instrumentation/opentelemetry-instrumentation-cassandra/README.rst new file mode 100644 index 0000000000..36e7d6202e --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/README.rst @@ -0,0 +1,25 @@ +OpenTelemetry Cassandra Instrumentation +=================================== + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-cassandra.svg + :target: https://pypi.org/project/opentelemetry-instrumentation-cassandra/ + +Instrumentation for Cassandra (cassandra-driver and scylla-driver libraries). + + +Installation +------------ + +:: + + pip install opentelemetry-instrumentation-cassandra + + +References +---------- +* `OpenTelemetry Cassandra Instrumentation `_ +* `OpenTelemetry Project `_ +* `OpenTelemetry Python Examples `_ + diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml new file mode 100644 index 0000000000..7a204f64e4 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-instrumentation-cassandra" +dynamic = ["version"] +description = "OpenTelemetry Cassandra instrumentation" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "opentelemetry-api ~= 1.12", + "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.41b0.dev", + "wrapt >= 1.0.0, < 2.0.0", +] + +[project.optional-dependencies] +instruments = [ + "cassandra-driver ~= 3.25", + "scylla-driver ~= 3.25", +] +test = [ + "opentelemetry-instrumentation-cassandra[instruments]", + "opentelemetry-test-utils == 0.41b0.dev", +] + +[project.entry-points.opentelemetry_instrumentor] +cassandra = "opentelemetry.instrumentation.cassandra:CassandraInstrumentor" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-cassandra" + +[tool.hatch.version] +path = "src/opentelemetry/instrumentation/cassandra/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py new file mode 100644 index 0000000000..6a4ee7edc5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py @@ -0,0 +1,91 @@ +# 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. + +""" +Cassandra instrumentation supporting `cassandra-driver`_ and `scylla-driver`_, it can be enabled by +using ``CassandraInstrumentor``. + +.. _cassandra-driver: https://pypi.org/project/cassandra-driver/ +.. _scylla-driver: https://pypi.org/project/scylla-driver/ + +Usage +----- + +.. code:: python + + import cassandra.cluster + from opentelemetry.instrumentation.cassandra import CassandraInstrumentor + + CassandraInstrumentor().instrument() + + cluster = cassandra.cluster.Cluster() + session = cluster.connect() + rows = session.execute("SELECT * FROM test") + +API +--- +""" + +from typing import Collection + +import cassandra.cluster +from wrapt import wrap_function_wrapper + +from opentelemetry import trace +from opentelemetry.instrumentation.instrumentor import BaseInstrumentor +from opentelemetry.instrumentation.cassandra.package import _instruments +from opentelemetry.instrumentation.cassandra.version import __version__ +from opentelemetry.instrumentation.utils import unwrap +from opentelemetry.semconv.trace import SpanAttributes + + +def _instrument(tracer_provider, include_db_statement=False): + """Instruments the cassandra-driver/scylla-driver module + + Wraps cassandra.cluster.Session.execute_async(). + """ + tracer = trace.get_tracer(__name__, __version__, tracer_provider) + name = "Cassandra" + + def _traced_execute_async(func, instance, args, kwargs): + with tracer.start_as_current_span( + name, kind=trace.SpanKind.CLIENT + ) as span: + if span.is_recording(): + span.set_attribute(SpanAttributes.DB_NAME, instance.keyspace) + span.set_attribute(SpanAttributes.DB_SYSTEM, "cassandra") + span.set_attribute(SpanAttributes.NET_PEER_NAME, instance.cluster.contact_points) + + if include_db_statement: + query = args[0] + span.set_attribute(SpanAttributes.DB_STATEMENT, str(query)) + + response = func(*args, **kwargs) + return response + + wrap_function_wrapper("cassandra.cluster", "Session.execute_async", _traced_execute_async) + + +class CassandraInstrumentor(BaseInstrumentor): + def instrumentation_dependencies(self) -> Collection[str]: + return _instruments + + def _instrument(self, **kwargs): + _instrument( + tracer_provider=kwargs.get("tracer_provider"), + include_db_statement=kwargs.get("include_db_statement"), + ) + + def _uninstrument(self, **kwargs): + unwrap(cassandra.cluster.Session, "execute_async") diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/package.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/package.py new file mode 100644 index 0000000000..d10a3cb5ba --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/package.py @@ -0,0 +1,16 @@ +# 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. + + +_instruments = ("cassandra-driver ~= 3.25", "scylla-driver ~= 3.25") diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py new file mode 100644 index 0000000000..7f88144cf6 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py @@ -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.41b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-cassandra/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py b/instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py new file mode 100644 index 0000000000..6977e1b2a2 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py @@ -0,0 +1,121 @@ +# 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. + +from unittest import mock + +import cassandra.cluster +from wrapt import BoundFunctionWrapper + +import opentelemetry.instrumentation.cassandra +from opentelemetry import trace as trace_api +from opentelemetry.instrumentation.cassandra import CassandraInstrumentor +from opentelemetry.sdk import resources +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import SpanKind + + +def connect_and_execute_query(): + cluster = cassandra.cluster.Cluster() + cluster._is_setup = True + session = cluster.connect() + session.cluster = cluster + session.keyspace = "test" + session._request_init_callbacks = [] + query = "SELECT * FROM test" + session.execute(query) + return cluster, session, query + + +class TestCassandraIntegration(TestBase): + def tearDown(self): + super().tearDown() + with self.disable_logging(): + CassandraInstrumentor().uninstrument() + + def test_instrument_uninstrument(self): + instrumentation = CassandraInstrumentor() + instrumentation.instrument() + self.assertTrue(isinstance(cassandra.cluster.Session.execute_async, BoundFunctionWrapper)) + + instrumentation.uninstrument() + self.assertFalse(isinstance(cassandra.cluster.Session.execute_async, BoundFunctionWrapper)) + + @mock.patch("cassandra.cluster.Cluster.connect") + @mock.patch("cassandra.cluster.Session.__init__") + @mock.patch("cassandra.cluster.Session._create_response_future") + def test_instrumentor(self, mock_create_response_future, mock_session_init, mock_connect): + mock_create_response_future.return_value = mock.Mock() + mock_session_init.return_value = None + mock_connect.return_value = cassandra.cluster.Session() + + CassandraInstrumentor().instrument() + + connect_and_execute_query() + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.cassandra + ) + self.assertEqual(span.name, "Cassandra") + self.assertEqual(span.kind, SpanKind.CLIENT) + + # check that no spans are generated after uninstrument + CassandraInstrumentor().uninstrument() + + connect_and_execute_query() + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + @mock.patch("cassandra.cluster.Cluster.connect") + @mock.patch("cassandra.cluster.Session.__init__") + @mock.patch("cassandra.cluster.Session._create_response_future") + def test_custom_tracer_provider(self, mock_create_response_future, mock_session_init, mock_connect): + mock_create_response_future.return_value = mock.Mock() + mock_session_init.return_value = None + mock_connect.return_value = cassandra.cluster.Session() + + resource = resources.Resource.create({}) + result = self.create_tracer_provider(resource=resource) + tracer_provider, exporter = result + + CassandraInstrumentor().instrument(tracer_provider=tracer_provider) + + connect_and_execute_query() + + span_list = exporter.get_finished_spans() + self.assertEqual(len(span_list), 1) + span = span_list[0] + + self.assertIs(span.resource, resource) + + @mock.patch("cassandra.cluster.Cluster.connect") + @mock.patch("cassandra.cluster.Session.__init__") + @mock.patch("cassandra.cluster.Session._create_response_future") + def test_instrument_connection_no_op_tracer_provider(self, mock_create_response_future, mock_session_init, mock_connect): + mock_create_response_future.return_value = mock.Mock() + mock_session_init.return_value = None + mock_connect.return_value = cassandra.cluster.Session() + + tracer_provider = trace_api.NoOpTracerProvider() + CassandraInstrumentor().instrument(tracer_provider=tracer_provider) + + connect_and_execute_query() + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 0) diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index f43c3075bc..b24384ee7a 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -38,6 +38,7 @@ dependencies = [ "opentelemetry-instrumentation-boto==0.41b0.dev", "opentelemetry-instrumentation-boto3sqs==0.41b0.dev", "opentelemetry-instrumentation-botocore==0.41b0.dev", + "opentelemetry-instrumentation-cassandra==0.41b0.dev", "opentelemetry-instrumentation-celery==0.41b0.dev", "opentelemetry-instrumentation-confluent-kafka==0.41b0.dev", "opentelemetry-instrumentation-dbapi==0.41b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 505b16709d..d742cfee7d 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -48,6 +48,14 @@ "library": "botocore ~= 1.0", "instrumentation": "opentelemetry-instrumentation-botocore==0.41b0.dev", }, + "cassandra-driver": { + "library": "cassandra-driver ~= 3.25", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.41b0.dev", + }, + "scylla-driver": { + "library": "scylla-driver ~= 3.25", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.41b0.dev", + }, "celery": { "library": "celery >= 4.0, < 6.0", "instrumentation": "opentelemetry-instrumentation-celery==0.41b0.dev", diff --git a/tox.ini b/tox.ini index b4fe0690a8..aea0b49d4a 100644 --- a/tox.ini +++ b/tox.ini @@ -232,6 +232,10 @@ envlist = ; // FIXME: Enable support for python 3.11 when https://github.com/confluentinc/confluent-kafka-python/issues/1452 is fixed py3{7,8,9,10}-test-instrumentation-confluent-kafka + ; opentelemetry-instrumentation-cassandra + py3{7,8,9,10,11}-test-instrumentation-cassandra + pypy3-test-instrumentation-cassandra + lint spellcheck docker-tests @@ -308,6 +312,7 @@ changedir = test-instrumentation-boto: instrumentation/opentelemetry-instrumentation-boto/tests test-instrumentation-botocore: instrumentation/opentelemetry-instrumentation-botocore/tests test-instrumentation-boto3sqs: instrumentation/opentelemetry-instrumentation-boto3sqs/tests + test-instrumentation-cassandra: instrumentation/opentelemetry-instrumentation-cassandra/tests test-instrumentation-celery: instrumentation/opentelemetry-instrumentation-celery/tests test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests test-instrumentation-django{1,2,3,4}: instrumentation/opentelemetry-instrumentation-django/tests @@ -399,6 +404,8 @@ commands_pre = botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] + cassandra: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] + dbapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] django{1,2,3,4}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] @@ -533,6 +540,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] + python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] From 6f3aead436911d84c59fc822cbe2fcae32002316 Mon Sep 17 00:00:00 2001 From: Noemi <45180344+unflxw@users.noreply.github.com> Date: Sun, 3 Sep 2023 12:56:33 +0200 Subject: [PATCH 052/200] Unwrap Celery's `ExceptionInfo` (#1863) * Unwrap `ExceptionInfo` and `ExceptionWithTraceback` Instead of reporting the `ExceptionInfo` and `ExceptionWithTraceback` wrappers raised by Celery, report the exceptions that they wrap. This ensures that the exception in the OpenTelemetry span has a type and traceback that are meaningful and relevant to the developer. * Fix typo The exception is expected, not excepted. Well, I guess it is also excepted, because it's an exception, but you get what I mean. * Reformat file with `black` Reformat the `__init__.py` file in the Celery instrumentation using `black`, fixing a CI linter error. * Address review feedback Use the VERSION attribute exposed by Billiard to decide whether to import ExceptionWithTraceback. Add a test for a failing task and check that the exceptions' type and message are preserved. * Amend ExceptionWithTraceback import --- CHANGELOG.md | 1 + .../instrumentation/celery/__init__.py | 20 ++++++ .../instrumentation/celery/utils.py | 1 + .../tests/celery_test_tasks.py | 9 +++ .../tests/test_tasks.py | 72 ++++++++++++++++++- .../tests/celery/test_celery_functional.py | 4 +- 6 files changed, 103 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f80b18eaa..423c191b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1889](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1889)) - Fixed union typing error not compatible with Python 3.7 introduced in `opentelemetry-util-http`, fix tests introduced by patch related to sanitize method for wsgi ([#1913](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1913)) +- `opentelemetry-instrumentation-celery` Unwrap Celery's `ExceptionInfo` errors and report the actual exception that was raised. ([#1863](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1863)) ### Added diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py index a216765fb0..bb83a5c192 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py @@ -63,6 +63,7 @@ def add(x, y): from timeit import default_timer from typing import Collection, Iterable +from billiard.einfo import ExceptionInfo from celery import signals # pylint: disable=no-name-in-module from opentelemetry import trace @@ -75,6 +76,13 @@ def add(x, y): from opentelemetry.propagators.textmap import Getter from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace.status import Status, StatusCode +from billiard import VERSION + + +if VERSION >= (4, 0, 1): + from billiard.einfo import ExceptionWithTraceback +else: + ExceptionWithTraceback = None logger = logging.getLogger(__name__) @@ -271,6 +279,18 @@ def _trace_failure(*args, **kwargs): return if ex is not None: + # Unwrap the actual exception wrapped by billiard's + # `ExceptionInfo` and `ExceptionWithTraceback`. + if isinstance(ex, ExceptionInfo) and ex.exception is not None: + ex = ex.exception + + if ( + ExceptionWithTraceback is not None + and isinstance(ex, ExceptionWithTraceback) + and ex.exc is not None + ): + ex = ex.exc + status_kwargs["description"] = str(ex) span.record_exception(ex) span.set_status(Status(**status_kwargs)) diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py index 6f4f9cbc3a..f92c5e03c8 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py @@ -15,6 +15,7 @@ import logging from celery import registry # pylint: disable=no-name-in-module +from billiard import VERSION from opentelemetry.semconv.trace import SpanAttributes diff --git a/instrumentation/opentelemetry-instrumentation-celery/tests/celery_test_tasks.py b/instrumentation/opentelemetry-instrumentation-celery/tests/celery_test_tasks.py index d9660412f0..9ac78f6d8b 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/tests/celery_test_tasks.py +++ b/instrumentation/opentelemetry-instrumentation-celery/tests/celery_test_tasks.py @@ -24,6 +24,15 @@ class Config: app.config_from_object(Config) +class CustomError(Exception): + pass + + @app.task def task_add(num_a, num_b): return num_a + num_b + + +@app.task +def task_raises(): + raise CustomError("The task failed!") diff --git a/instrumentation/opentelemetry-instrumentation-celery/tests/test_tasks.py b/instrumentation/opentelemetry-instrumentation-celery/tests/test_tasks.py index 47f79d7e1c..ed4dbb5b1d 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/tests/test_tasks.py +++ b/instrumentation/opentelemetry-instrumentation-celery/tests/test_tasks.py @@ -18,9 +18,9 @@ from opentelemetry.instrumentation.celery import CeleryInstrumentor from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase -from opentelemetry.trace import SpanKind +from opentelemetry.trace import SpanKind, StatusCode -from .celery_test_tasks import app, task_add +from .celery_test_tasks import app, task_add, task_raises class TestCeleryInstrumentation(TestBase): @@ -66,6 +66,10 @@ def test_task(self): }, ) + self.assertEqual(consumer.status.status_code, StatusCode.UNSET) + + self.assertEqual(0, len(consumer.events)) + self.assertEqual( producer.name, "apply_async/tests.celery_test_tasks.task_add" ) @@ -84,6 +88,70 @@ def test_task(self): self.assertEqual(consumer.parent.span_id, producer.context.span_id) self.assertEqual(consumer.context.trace_id, producer.context.trace_id) + def test_task_raises(self): + CeleryInstrumentor().instrument() + + result = task_raises.delay() + + timeout = time.time() + 60 * 1 # 1 minutes from now + while not result.ready(): + if time.time() > timeout: + break + time.sleep(0.05) + + spans = self.sorted_spans(self.memory_exporter.get_finished_spans()) + self.assertEqual(len(spans), 2) + + consumer, producer = spans + + self.assertEqual( + consumer.name, "run/tests.celery_test_tasks.task_raises" + ) + self.assertEqual(consumer.kind, SpanKind.CONSUMER) + self.assertSpanHasAttributes( + consumer, + { + "celery.action": "run", + "celery.state": "FAILURE", + SpanAttributes.MESSAGING_DESTINATION: "celery", + "celery.task_name": "tests.celery_test_tasks.task_raises", + }, + ) + + self.assertEqual(consumer.status.status_code, StatusCode.ERROR) + + self.assertEqual(1, len(consumer.events)) + event = consumer.events[0] + + self.assertIn(SpanAttributes.EXCEPTION_STACKTRACE, event.attributes) + + self.assertEqual( + event.attributes[SpanAttributes.EXCEPTION_TYPE], "CustomError" + ) + + self.assertEqual( + event.attributes[SpanAttributes.EXCEPTION_MESSAGE], + "The task failed!", + ) + + self.assertEqual( + producer.name, "apply_async/tests.celery_test_tasks.task_raises" + ) + self.assertEqual(producer.kind, SpanKind.PRODUCER) + self.assertSpanHasAttributes( + producer, + { + "celery.action": "apply_async", + "celery.task_name": "tests.celery_test_tasks.task_raises", + SpanAttributes.MESSAGING_DESTINATION_KIND: "queue", + SpanAttributes.MESSAGING_DESTINATION: "celery", + }, + ) + + self.assertNotEqual(consumer.parent, producer.context) + self.assertEqual(consumer.parent.span_id, producer.context.span_id) + self.assertEqual(consumer.context.trace_id, producer.context.trace_id) + def test_uninstrument(self): CeleryInstrumentor().instrument() CeleryInstrumentor().uninstrument() diff --git a/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py b/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py index f284272c5d..0b9cb3dac5 100644 --- a/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py +++ b/tests/opentelemetry-docker-tests/tests/celery/test_celery_functional.py @@ -279,7 +279,7 @@ def fn_exception(): assert len(span.events) == 1 event = span.events[0] assert event.name == "exception" - assert event.attributes[SpanAttributes.EXCEPTION_TYPE] == "ExceptionInfo" + assert event.attributes[SpanAttributes.EXCEPTION_TYPE] == "Exception" assert SpanAttributes.EXCEPTION_MESSAGE in event.attributes assert ( span.attributes.get(SpanAttributes.MESSAGING_MESSAGE_ID) @@ -420,7 +420,7 @@ def run(self): assert "Task class is failing" in span.status.description -def test_class_task_exception_excepted(celery_app, memory_exporter): +def test_class_task_exception_expected(celery_app, memory_exporter): class BaseTask(celery_app.Task): throws = (MyException,) From fb9eb32fac33073f37f6f6076f6e7e95e0b21467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Thallis?= Date: Sun, 3 Sep 2023 08:23:21 -0300 Subject: [PATCH 053/200] doc: fix `commenter_options` type (#1926) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- .../src/opentelemetry/instrumentation/sqlalchemy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py index 84eeb59541..e14ac9600c 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py @@ -136,7 +136,7 @@ def _instrument(self, **kwargs): ``tracer_provider``: a TracerProvider, defaults to global ``meter_provider``: a MeterProvider, defaults to global ``enable_commenter``: bool to enable sqlcommenter, defaults to False - ``commenter_options``: dict of sqlcommenter config, defaults to None + ``commenter_options``: dict of sqlcommenter config, defaults to {} Returns: An instrumented engine if passed in as an argument or list of instrumented engines, None otherwise. From 54be1603dc40bba54572dd630efdb7f164a0c99e Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:56:57 -0700 Subject: [PATCH 054/200] Update version to 1.21.0.dev/0.42b0.dev (#1930) Co-authored-by: Diego Hurtado --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + _template/version.py | 2 +- eachdist.ini | 4 +- .../prometheus_remote_write/version.py | 2 +- .../pyproject.toml | 2 +- .../exporter/richconsole/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/aio_pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_client/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/aiopg/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/asgi/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncpg/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aws_lambda/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto3sqs/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/botocore/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/cassandra/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/celery/version.py | 2 +- .../confluent_kafka/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/dbapi/version.py | 2 +- .../pyproject.toml | 12 +-- .../instrumentation/django/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/elasticsearch/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/falcon/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/fastapi/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/flask/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/grpc/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/httpx/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/jinja2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/kafka/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/logging/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysql/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysqlclient/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/psycopg2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymemcache/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymongo/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymysql/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/pyramid/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/redis/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/remoulade/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/requests/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sklearn/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlalchemy/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/sqlite3/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/starlette/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/system_metrics/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/tornado/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/tortoiseorm/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib3/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/wsgi/version.py | 2 +- .../pyproject.toml | 88 +++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 92 +++++++++---------- .../opentelemetry/instrumentation/version.py | 2 +- .../propagators/ot_trace/version.py | 2 +- .../resource/detector/azure/version.py | 2 +- .../resource/detector/container/version.py | 2 +- .../src/opentelemetry/util/http/version.py | 2 +- 104 files changed, 291 insertions(+), 289 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 414b9fe605..8decdb1a42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: c41b6bf29e9486a71ba1c40cd0ea35a03b2f7489 + CORE_REPO_SHA: 0ef76a5cc39626f783416ca75e43556e2bb2739d jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index 423c191b48..1206844e55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## Version 1.20.0/0.41b0 (2023-09-01) + ### Fixed - `opentelemetry-instrumentation-asgi` Fix UnboundLocalError local variable 'start' referenced before assignment diff --git a/_template/version.py b/_template/version.py index 7f88144cf6..c2996671d6 100644 --- a/_template/version.py +++ b/_template/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/eachdist.ini b/eachdist.ini index ec96078c7a..b9cb1e40fa 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.20.0.dev +version=1.21.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.41b0.dev +version=0.42b0.dev packages= all diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py index 7f88144cf6..c2996671d6 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index 73e792d38f..202dda7a51 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "rich>=10.0.0", ] diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py index 7f88144cf6..c2996671d6 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index 1ea3ec63b8..af57ebe6e7 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aio-pika[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index 16a9c2305e..c466977377 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py index 97646888df..e9ca2a1777 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index a23e8e41a3..024f707d89 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-dbapi == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-dbapi == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,8 +37,8 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index 33e698ae73..60f15e9ba7 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -27,9 +27,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asgi[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 1897dd7f68..41a7e3ef3c 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asyncpg[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 4e488df34f..b632297922 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -22,15 +22,15 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 7c68646657..125f311045 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ test = [ "opentelemetry-instrumentation-boto[instruments]", "markupsafe==2.0.1", "moto~=2.0", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 56aa00cc0c..5a91c1d206 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-boto3sqs[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 2010eb25f0..d78756778d 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", ] @@ -39,7 +39,7 @@ test = [ "opentelemetry-instrumentation-botocore[instruments]", "markupsafe==2.0.1", "moto[all] ~= 2.2.6", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index 7a204f64e4..9abb17598f 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-cassandra[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index d69084efb5..2c0de681e1 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-celery[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "pytest", ] diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index 39821f1fee..5f9df3983e 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py index 7d47d157b0..084725a38e 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 98e34e0784..e235d6e6a9 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -26,22 +26,22 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-wsgi == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-wsgi == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.41b0.dev", + "opentelemetry-instrumentation-asgi == 0.42b0.dev", ] instruments = [ "django >= 1.10", ] test = [ "opentelemetry-instrumentation-django[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index bdd5c10ada..bee1d44d2a 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-elasticsearch[instruments]", "elasticsearch-dsl >= 2.0", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 63761cfe17..b6c482ed1f 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-wsgi == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-wsgi == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", "packaging >= 20.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-falcon[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "parameterized == 0.7.4", ] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 1a2bb71756..4938baaffb 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-asgi == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-asgi == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-fastapi[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 868d0672f7..62115c83d1 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-wsgi == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-wsgi == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", "packaging >= 21.0", ] @@ -40,7 +40,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-flask[instruments]", "markupsafe==2.1.2", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 3f887a802e..37023eae4d 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-grpc[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "protobuf ~= 3.13", ] diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index 10213d2ec4..a50b2f4754 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-httpx[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index 5633daf3db..c0f0c51d37 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-jinja2[instruments]", "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index 471017f3a0..9fbde3057d 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-kafka-python[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index c2c05fae44..76bde24c55 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,13 +25,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py index 7d47d157b0..084725a38e 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index fc2a81e19f..e155147d5c 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-dbapi == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-dbapi == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysql[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index c20e896182..72d4bc67cc 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-dbapi == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-dbapi == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysqlclient[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index 9064a6486b..8ee033e58d 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pika[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index 38a52ea7ef..d709c2bad1 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-dbapi == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-dbapi == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-psycopg2[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index c8fa549c1f..f6b61bd4d0 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymemcache[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index 826d7078f4..2c40ed26bb 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymongo[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index d579aa1baa..62404ed4f1 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-dbapi == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-dbapi == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymysql[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 2483d0c953..59483c972b 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-wsgi == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-wsgi == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pyramid[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "werkzeug == 0.16.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index fb9893ec8c..3ae0609147 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "wrapt >= 1.12.1", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-redis[instruments]", "opentelemetry-sdk ~= 1.3", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index 546125d0c2..2a3a596700 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-remoulade[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "opentelemetry-sdk ~= 1.10" ] diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index b19a6889cc..184bd1ca7e 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-requests[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index 975bc7e26c..85a145f662 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-sklearn[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index 97646888df..e9ca2a1777 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 3f84d4f5ed..3b96607b41 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", "packaging >= 21.0", "wrapt >= 1.11.2", ] diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index 50355d49aa..d7f6d6aae9 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -26,14 +26,14 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-dbapi == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-dbapi == 0.42b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py index 7d47d157b0..084725a38e 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index 3d33b050dd..4c884bcc5e 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-instrumentation-asgi == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation-asgi == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-starlette[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 879d60067a..3c9f363a4c 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-system-metrics[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index f9f412ab7a..1a286e5114 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tornado[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", "http-server-mock" ] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 6340aa2842..42e3573806 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tortoiseorm[instruments]", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index fbee7d1cbb..56bfb5e869 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -26,16 +26,16 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] instruments = [] test = [ "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py index 7d47d157b0..084725a38e 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index 4c77ef8829..db4d485d8e 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-urllib3[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 9ff76df858..50860fb0d6 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", - "opentelemetry-semantic-conventions == 0.41b0.dev", - "opentelemetry-util-http == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.41b0.dev", + "opentelemetry-test-utils == 0.42b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py index 7f88144cf6..c2996671d6 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index b24384ee7a..feb229e384 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -29,50 +29,50 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.41b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.41b0.dev", - "opentelemetry-instrumentation-aiopg==0.41b0.dev", - "opentelemetry-instrumentation-asgi==0.41b0.dev", - "opentelemetry-instrumentation-asyncpg==0.41b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.41b0.dev", - "opentelemetry-instrumentation-boto==0.41b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.41b0.dev", - "opentelemetry-instrumentation-botocore==0.41b0.dev", - "opentelemetry-instrumentation-cassandra==0.41b0.dev", - "opentelemetry-instrumentation-celery==0.41b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.41b0.dev", - "opentelemetry-instrumentation-dbapi==0.41b0.dev", - "opentelemetry-instrumentation-django==0.41b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.41b0.dev", - "opentelemetry-instrumentation-falcon==0.41b0.dev", - "opentelemetry-instrumentation-fastapi==0.41b0.dev", - "opentelemetry-instrumentation-flask==0.41b0.dev", - "opentelemetry-instrumentation-grpc==0.41b0.dev", - "opentelemetry-instrumentation-httpx==0.41b0.dev", - "opentelemetry-instrumentation-jinja2==0.41b0.dev", - "opentelemetry-instrumentation-kafka-python==0.41b0.dev", - "opentelemetry-instrumentation-logging==0.41b0.dev", - "opentelemetry-instrumentation-mysql==0.41b0.dev", - "opentelemetry-instrumentation-mysqlclient==0.41b0.dev", - "opentelemetry-instrumentation-pika==0.41b0.dev", - "opentelemetry-instrumentation-psycopg2==0.41b0.dev", - "opentelemetry-instrumentation-pymemcache==0.41b0.dev", - "opentelemetry-instrumentation-pymongo==0.41b0.dev", - "opentelemetry-instrumentation-pymysql==0.41b0.dev", - "opentelemetry-instrumentation-pyramid==0.41b0.dev", - "opentelemetry-instrumentation-redis==0.41b0.dev", - "opentelemetry-instrumentation-remoulade==0.41b0.dev", - "opentelemetry-instrumentation-requests==0.41b0.dev", - "opentelemetry-instrumentation-sklearn==0.41b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.41b0.dev", - "opentelemetry-instrumentation-sqlite3==0.41b0.dev", - "opentelemetry-instrumentation-starlette==0.41b0.dev", - "opentelemetry-instrumentation-system-metrics==0.41b0.dev", - "opentelemetry-instrumentation-tornado==0.41b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.41b0.dev", - "opentelemetry-instrumentation-urllib==0.41b0.dev", - "opentelemetry-instrumentation-urllib3==0.41b0.dev", - "opentelemetry-instrumentation-wsgi==0.41b0.dev", + "opentelemetry-instrumentation-aio-pika==0.42b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.42b0.dev", + "opentelemetry-instrumentation-aiopg==0.42b0.dev", + "opentelemetry-instrumentation-asgi==0.42b0.dev", + "opentelemetry-instrumentation-asyncpg==0.42b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.42b0.dev", + "opentelemetry-instrumentation-boto==0.42b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.42b0.dev", + "opentelemetry-instrumentation-botocore==0.42b0.dev", + "opentelemetry-instrumentation-cassandra==0.42b0.dev", + "opentelemetry-instrumentation-celery==0.42b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.42b0.dev", + "opentelemetry-instrumentation-dbapi==0.42b0.dev", + "opentelemetry-instrumentation-django==0.42b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.42b0.dev", + "opentelemetry-instrumentation-falcon==0.42b0.dev", + "opentelemetry-instrumentation-fastapi==0.42b0.dev", + "opentelemetry-instrumentation-flask==0.42b0.dev", + "opentelemetry-instrumentation-grpc==0.42b0.dev", + "opentelemetry-instrumentation-httpx==0.42b0.dev", + "opentelemetry-instrumentation-jinja2==0.42b0.dev", + "opentelemetry-instrumentation-kafka-python==0.42b0.dev", + "opentelemetry-instrumentation-logging==0.42b0.dev", + "opentelemetry-instrumentation-mysql==0.42b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.42b0.dev", + "opentelemetry-instrumentation-pika==0.42b0.dev", + "opentelemetry-instrumentation-psycopg2==0.42b0.dev", + "opentelemetry-instrumentation-pymemcache==0.42b0.dev", + "opentelemetry-instrumentation-pymongo==0.42b0.dev", + "opentelemetry-instrumentation-pymysql==0.42b0.dev", + "opentelemetry-instrumentation-pyramid==0.42b0.dev", + "opentelemetry-instrumentation-redis==0.42b0.dev", + "opentelemetry-instrumentation-remoulade==0.42b0.dev", + "opentelemetry-instrumentation-requests==0.42b0.dev", + "opentelemetry-instrumentation-sklearn==0.42b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.42b0.dev", + "opentelemetry-instrumentation-sqlite3==0.42b0.dev", + "opentelemetry-instrumentation-starlette==0.42b0.dev", + "opentelemetry-instrumentation-system-metrics==0.42b0.dev", + "opentelemetry-instrumentation-tornado==0.42b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.42b0.dev", + "opentelemetry-instrumentation-urllib==0.42b0.dev", + "opentelemetry-instrumentation-urllib3==0.42b0.dev", + "opentelemetry-instrumentation-wsgi==0.42b0.dev", ] [project.optional-dependencies] diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py index 7f88144cf6..c2996671d6 100644 --- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py +++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index b51b3661bf..9898884319 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -24,13 +24,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0.dev", + "opentelemetry-instrumentation == 0.42b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.20.0.dev", + "opentelemetry-exporter-otlp == 1.21.0.dev", ] test = [] diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py index 7f88144cf6..c2996671d6 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/version.py +++ b/opentelemetry-distro/src/opentelemetry/distro/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index d742cfee7d..8d856abf65 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,170 +18,170 @@ libraries = { "aio_pika": { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.42b0.dev", }, "aiohttp": { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.42b0.dev", }, "aiopg": { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.42b0.dev", }, "asgiref": { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.42b0.dev", }, "asyncpg": { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.42b0.dev", }, "boto": { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.42b0.dev", }, "boto3": { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.42b0.dev", }, "botocore": { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.42b0.dev", }, "cassandra-driver": { "library": "cassandra-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.42b0.dev", }, "scylla-driver": { "library": "scylla-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.42b0.dev", }, "celery": { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.42b0.dev", }, "confluent-kafka": { "library": "confluent-kafka >= 1.8.2, <= 2.2.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.42b0.dev", }, "django": { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.42b0.dev", }, "elasticsearch": { "library": "elasticsearch >= 2.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.42b0.dev", }, "falcon": { "library": "falcon >= 1.4.1, < 4.0.0", - "instrumentation": "opentelemetry-instrumentation-falcon==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.42b0.dev", }, "fastapi": { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.42b0.dev", }, "flask": { "library": "flask >= 1.0, < 3.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.42b0.dev", }, "grpcio": { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.42b0.dev", }, "httpx": { "library": "httpx >= 0.18.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.42b0.dev", }, "jinja2": { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.42b0.dev", }, "kafka-python": { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.42b0.dev", }, "mysql-connector-python": { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.42b0.dev", }, "mysqlclient": { "library": "mysqlclient < 3", - "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.42b0.dev", }, "pika": { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.42b0.dev", }, "psycopg2": { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.42b0.dev", }, "pymemcache": { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.42b0.dev", }, "pymongo": { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.42b0.dev", }, "PyMySQL": { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.42b0.dev", }, "pyramid": { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.42b0.dev", }, "redis": { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.42b0.dev", }, "remoulade": { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.42b0.dev", }, "requests": { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.42b0.dev", }, "scikit-learn": { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.42b0.dev", }, "sqlalchemy": { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.42b0.dev", }, "starlette": { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.42b0.dev", }, "psutil": { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.42b0.dev", }, "tornado": { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.42b0.dev", }, "tortoise-orm": { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.42b0.dev", }, "pydantic": { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.42b0.dev", }, "urllib3": { "library": "urllib3 >= 1.0.0, < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.41b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.42b0.dev", }, } default_instrumentations = [ - "opentelemetry-instrumentation-aws-lambda==0.41b0.dev", - "opentelemetry-instrumentation-dbapi==0.41b0.dev", - "opentelemetry-instrumentation-logging==0.41b0.dev", - "opentelemetry-instrumentation-sqlite3==0.41b0.dev", - "opentelemetry-instrumentation-urllib==0.41b0.dev", - "opentelemetry-instrumentation-wsgi==0.41b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.42b0.dev", + "opentelemetry-instrumentation-dbapi==0.42b0.dev", + "opentelemetry-instrumentation-logging==0.42b0.dev", + "opentelemetry-instrumentation-sqlite3==0.42b0.dev", + "opentelemetry-instrumentation-urllib==0.42b0.dev", + "opentelemetry-instrumentation-wsgi==0.42b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index 7f88144cf6..c2996671d6 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py index 7f88144cf6..c2996671d6 100644 --- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py +++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py index 7f88144cf6..c2996671d6 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py index 7f88144cf6..c2996671d6 100644 --- a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py index 7f88144cf6..c2996671d6 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.41b0.dev" +__version__ = "0.42b0.dev" From 4abb0e32161f7be6f5c414d59d0e58aca6b9be96 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Tue, 12 Sep 2023 13:33:39 -0700 Subject: [PATCH 055/200] Modify eachdist and build script for container packages (#1949) --- eachdist.ini | 2 ++ .../src/opentelemetry/resource/detector/azure/version.py | 2 +- scripts/build.sh | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eachdist.ini b/eachdist.ini index b9cb1e40fa..dacd4fc42f 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -43,9 +43,11 @@ packages= opentelemetry-instrumentation opentelemetry-contrib-instrumentations opentelemetry-distro + opentelemetry-resource-detector-container [exclude_release] packages= + opentelemetry-resource-detector-azure opentelemetry-sdk-extension-aws opentelemetry-propagator-aws-xray diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py index c2996671d6..5fd301e2e6 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.1.0" diff --git a/scripts/build.sh b/scripts/build.sh index 56b350257a..dc3e237946 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,7 +16,7 @@ DISTDIR=dist mkdir -p $DISTDIR rm -rf $DISTDIR/* - for d in exporter/*/ opentelemetry-instrumentation/ opentelemetry-contrib-instrumentations/ opentelemetry-distro/ instrumentation/*/ propagator/*/ sdk-extension/*/ util/*/ ; do + for d in exporter/*/ opentelemetry-instrumentation/ opentelemetry-contrib-instrumentations/ opentelemetry-distro/ instrumentation/*/ propagator/*/ resource/*/ sdk-extension/*/ util/*/ ; do ( echo "building $d" cd "$d" From e318c947a23152c8ff1700f0aad44261be0588cd Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Tue, 12 Sep 2023 14:47:30 -0700 Subject: [PATCH 056/200] Update pyproject.toml (#1950) --- resource/opentelemetry-resource-detector-azure/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/opentelemetry-resource-detector-azure/pyproject.toml b/resource/opentelemetry-resource-detector-azure/pyproject.toml index db892a86bf..c4ae6fc191 100644 --- a/resource/opentelemetry-resource-detector-azure/pyproject.toml +++ b/resource/opentelemetry-resource-detector-azure/pyproject.toml @@ -3,9 +3,9 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "opentelemetry-resource-detector-container" +name = "opentelemetry-resource-detector-azure" dynamic = ["version"] -description = "Container Resource Detector for OpenTelemetry" +description = "Azure Resource Detector for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" requires-python = ">=3.7" From 7ac674430d479538d4adfe45dcb004d0b5e2c398 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 4 Oct 2023 22:20:39 +0200 Subject: [PATCH 057/200] Fix version of Flask dependency werkzeug (#1980) --- CHANGELOG.md | 7 ++++++- .../pyproject.toml | 1 + .../opentelemetry/instrumentation/sklearn/__init__.py | 4 ++-- .../opentelemetry/instrumentation/bootstrap_gen.py | 4 ++++ .../src/opentelemetry/instrumentation/propagators.py | 11 ++++++----- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1206844e55..6f672d7652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- Fix version of Flask dependency `werkzeug` + ([#1980](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980)) + ## Version 1.20.0/0.41b0 (2023-09-01) ### Fixed @@ -352,7 +357,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation-sqlalchemy` Added span for the connection phase ([#1133](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1133)) - Add metric instrumentation in asgi ([#1197](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1197)) -- Add metric instumentation for flask +- Add metric instrumentation for flask ([#1186](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1186)) - Add a test for asgi using NoOpTracerProvider ([#1367](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1367)) diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 62115c83d1..e6c7851f7e 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -36,6 +36,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ "flask >= 1.0, < 3.0", + "werkzeug < 3.0.0" ] test = [ "opentelemetry-instrumentation-flask[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py index 26f7315d05..08abeb1d0e 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py @@ -35,7 +35,7 @@ ).instrument() -Model intrumentation example: +Model instrumentation example: .. code-block:: python @@ -291,7 +291,7 @@ class descendent) is being instrumented with opentelemetry. Within a SklearnInstrumentor(packages=packages).instrument() - Model intrumentation example: + Model instrumentation example: .. code-block:: python diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 8d856abf65..49b044a2a3 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -84,6 +84,10 @@ "library": "flask >= 1.0, < 3.0", "instrumentation": "opentelemetry-instrumentation-flask==0.42b0.dev", }, + "werkzeug": { + "library": "werkzeug < 3.0.0", + "instrumentation": "opentelemetry-instrumentation-flask==0.42b0.dev", + }, "grpcio": { "library": "grpcio ~= 1.27", "instrumentation": "opentelemetry-instrumentation-grpc==0.42b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/propagators.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/propagators.py index bc40f7742c..018595996f 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/propagators.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/propagators.py @@ -59,12 +59,13 @@ def set(self, carrier, key, value): # pylint: disable=no-self-use class FuncSetter(Setter): - """FuncSetter coverts a function into a valid Setter. Any function that can - set values in a carrier can be converted into a Setter by using FuncSetter. - This is useful when injecting trace context into non-dict objects such - HTTP Response objects for different framework. + """FuncSetter converts a function into a valid Setter. Any function that + can set values in a carrier can be converted into a Setter by using + FuncSetter. This is useful when injecting trace context into non-dict + objects such HTTP Response objects for different framework. - For example, it can be used to create a setter for Falcon response object as: + For example, it can be used to create a setter for Falcon response object + as: setter = FuncSetter(falcon.api.Response.append_header) From bb42e0417b9a92612954f342630b5c0cc660d89e Mon Sep 17 00:00:00 2001 From: Allen Kim Date: Tue, 10 Oct 2023 02:34:02 +0900 Subject: [PATCH 058/200] Feature/add new process metrics (#1948) --- CHANGELOG.md | 6 ++ .../system_metrics/__init__.py | 65 +++++++++++++++++++ .../tests/test_system_metrics.py | 60 ++++++++++++++--- 3 files changed, 123 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f672d7652..d671707c12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased + +### Added +- `opentelemetry-instrumentation-system-metrics` Add support for collecting process metrics + ([#1948](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1948)) + ### Fixed - Fix version of Flask dependency `werkzeug` ([#1980](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980)) + ## Version 1.20.0/0.41b0 (2023-09-01) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py index b7bd38907e..3d6a0c6775 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py @@ -36,6 +36,10 @@ "system.thread_count": None "process.runtime.memory": ["rss", "vms"], "process.runtime.cpu.time": ["user", "system"], + "process.runtime.gc_count": None, + "process.runtime.thread_count": None, + "process.runtime.cpu.utilization": None, + "process.runtime.context_switches": ["involuntary", "voluntary"], } Usage @@ -63,6 +67,7 @@ "system.network.io": ["transmit", "receive"], "process.runtime.memory": ["rss", "vms"], "process.runtime.cpu.time": ["user", "system"], + "process.runtime.context_switches": ["involuntary", "voluntary"], } SystemMetricsInstrumentor(config=configuration).instrument() @@ -105,6 +110,9 @@ "process.runtime.memory": ["rss", "vms"], "process.runtime.cpu.time": ["user", "system"], "process.runtime.gc_count": None, + "process.runtime.thread_count": None, + "process.runtime.cpu.utilization": None, + "process.runtime.context_switches": ["involuntary", "voluntary"], } @@ -150,6 +158,9 @@ def __init__( self._runtime_memory_labels = self._labels.copy() self._runtime_cpu_time_labels = self._labels.copy() self._runtime_gc_count_labels = self._labels.copy() + self._runtime_thread_count_labels = self._labels.copy() + self._runtime_cpu_utilization_labels = self._labels.copy() + self._runtime_context_switches_labels = self._labels.copy() def instrumentation_dependencies(self) -> Collection[str]: return _instruments @@ -347,6 +358,29 @@ def _instrument(self, **kwargs): unit="bytes", ) + if "process.runtime.thread_count" in self._config: + self._meter.create_observable_up_down_counter( + name=f"process.runtime.{self._python_implementation}.thread_count", + callbacks=[self._get_runtime_thread_count], + description="Runtime active threads count", + ) + + if "process.runtime.cpu.utilization" in self._config: + self._meter.create_observable_gauge( + name=f"process.runtime.{self._python_implementation}.cpu.utilization", + callbacks=[self._get_runtime_cpu_utilization], + description="Runtime CPU utilization", + unit="1", + ) + + if "process.runtime.context_switches" in self._config: + self._meter.create_observable_counter( + name=f"process.runtime.{self._python_implementation}.context_switches", + callbacks=[self._get_runtime_context_switches], + description="Runtime context switches", + unit="switches", + ) + def _uninstrument(self, **__): pass @@ -646,3 +680,34 @@ def _get_runtime_gc_count( for index, count in enumerate(gc.get_count()): self._runtime_gc_count_labels["count"] = str(index) yield Observation(count, self._runtime_gc_count_labels.copy()) + + def _get_runtime_thread_count( + self, options: CallbackOptions + ) -> Iterable[Observation]: + """Observer callback for runtime active thread count""" + yield Observation( + self._proc.num_threads(), self._runtime_thread_count_labels.copy() + ) + + def _get_runtime_cpu_utilization( + self, options: CallbackOptions + ) -> Iterable[Observation]: + """Observer callback for runtime CPU utilization""" + proc_cpu_percent = self._proc.cpu_percent() + yield Observation( + proc_cpu_percent, + self._runtime_cpu_utilization_labels.copy(), + ) + + def _get_runtime_context_switches( + self, options: CallbackOptions + ) -> Iterable[Observation]: + """Observer callback for runtime context switches""" + ctx_switches = self._proc.num_ctx_switches() + for metric in self._config["process.runtime.context_switches"]: + if hasattr(ctx_switches, metric): + self._runtime_context_switches_labels["type"] = metric + yield Observation( + getattr(ctx_switches, metric), + self._runtime_context_switches_labels.copy(), + ) diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py b/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py index f6dbd6c9a1..e28c437009 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py @@ -18,13 +18,14 @@ from platform import python_implementation from unittest import mock -from opentelemetry.instrumentation.system_metrics import ( - SystemMetricsInstrumentor, -) from opentelemetry.sdk.metrics import MeterProvider from opentelemetry.sdk.metrics.export import InMemoryMetricReader from opentelemetry.test.test_base import TestBase +from opentelemetry.instrumentation.system_metrics import ( + SystemMetricsInstrumentor, +) + def _mock_netconnection(): NetConnection = namedtuple( @@ -96,7 +97,7 @@ def test_system_metrics_instrument(self): for scope_metrics in resource_metrics.scope_metrics: for metric in scope_metrics.metrics: metric_names.append(metric.name) - self.assertEqual(len(metric_names), 18) + self.assertEqual(len(metric_names), 21) observer_names = [ "system.cpu.time", @@ -117,6 +118,9 @@ def test_system_metrics_instrument(self): f"process.runtime.{self.implementation}.memory", f"process.runtime.{self.implementation}.cpu_time", f"process.runtime.{self.implementation}.gc_count", + f"process.runtime.{self.implementation}.thread_count", + f"process.runtime.{self.implementation}.context_switches", + f"process.runtime.{self.implementation}.cpu.utilization", ] for observer in metric_names: @@ -128,6 +132,9 @@ def test_runtime_metrics_instrument(self): "process.runtime.memory": ["rss", "vms"], "process.runtime.cpu.time": ["user", "system"], "process.runtime.gc_count": None, + "process.runtime.thread_count": None, + "process.runtime.cpu.utilization": None, + "process.runtime.context_switches": ["involuntary", "voluntary"], } reader = InMemoryMetricReader() @@ -140,12 +147,15 @@ def test_runtime_metrics_instrument(self): for scope_metrics in resource_metrics.scope_metrics: for metric in scope_metrics.metrics: metric_names.append(metric.name) - self.assertEqual(len(metric_names), 3) + self.assertEqual(len(metric_names), 6) observer_names = [ f"process.runtime.{self.implementation}.memory", f"process.runtime.{self.implementation}.cpu_time", f"process.runtime.{self.implementation}.gc_count", + f"process.runtime.{self.implementation}.thread_count", + f"process.runtime.{self.implementation}.context_switches", + f"process.runtime.{self.implementation}.cpu.utilization", ] for observer in metric_names: @@ -161,9 +171,9 @@ def _assert_metrics(self, observer_name, reader, expected): for data_point in metric.data.data_points: for expect in expected: if ( - dict(data_point.attributes) - == expect.attributes - and metric.name == observer_name + dict(data_point.attributes) + == expect.attributes + and metric.name == observer_name ): self.assertEqual( data_point.value, @@ -782,3 +792,37 @@ def test_runtime_get_count(self, mock_gc_get_count): self._test_metrics( f"process.runtime.{self.implementation}.gc_count", expected ) + + @mock.patch("psutil.Process.num_ctx_switches") + def test_runtime_context_switches(self, mock_process_num_ctx_switches): + PCtxSwitches = namedtuple("PCtxSwitches", ["voluntary", "involuntary"]) + + mock_process_num_ctx_switches.configure_mock( + **{"return_value": PCtxSwitches(voluntary=1, involuntary=2)} + ) + + expected = [ + _SystemMetricsResult({"type": "voluntary"}, 1), + _SystemMetricsResult({"type": "involuntary"}, 2), + ] + self._test_metrics( + f"process.runtime.{self.implementation}.context_switches", expected + ) + + @mock.patch("psutil.Process.num_threads") + def test_runtime_thread_num(self, mock_process_thread_num): + mock_process_thread_num.configure_mock(**{"return_value": 42}) + + expected = [_SystemMetricsResult({}, 42)] + self._test_metrics( + f"process.runtime.{self.implementation}.thread_count", expected + ) + + @mock.patch("psutil.Process.cpu_percent") + def test_runtime_cpu_percent(self, mock_process_cpu_percent): + mock_process_cpu_percent.configure_mock(**{"return_value": 42}) + + expected = [_SystemMetricsResult({}, 42)] + self._test_metrics( + f"process.runtime.{self.implementation}.cpu.utilization", expected + ) From 3478831838ce54a972f7434ae6098f9bb28dc494 Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Mon, 9 Oct 2023 12:02:52 -0700 Subject: [PATCH 059/200] Using new cloud resource id attribute (#1976) --- CHANGELOG.md | 2 ++ .../resource/detector/azure/app_service.py | 4 +--- .../src/opentelemetry/resource/detector/azure/vm.py | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d671707c12..2923ebc791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix version of Flask dependency `werkzeug` ([#1980](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980)) +- `opentelemetry-resource-detector-azure` Using new Cloud Resource ID attribute. + ([#1976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1976)) ## Version 1.20.0/0.41b0 (2023-09-01) diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py index ea0959cb93..823aac30fd 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py @@ -18,8 +18,6 @@ from opentelemetry.semconv.resource import ResourceAttributes, CloudPlatformValues, CloudProviderValues _AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE = "azure.app.service.stamp" -# TODO: Remove once this resource attribute is no longer missing from SDK -_CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = "cloud.resource_id" _REGION_NAME = "REGION_NAME" _WEBSITE_HOME_STAMPNAME = "WEBSITE_HOME_STAMPNAME" _WEBSITE_HOSTNAME = "WEBSITE_HOSTNAME" @@ -49,7 +47,7 @@ def detect(self) -> Resource: azure_resource_uri = _get_azure_resource_uri(website_site_name) if azure_resource_uri: - attributes[_CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE] = azure_resource_uri + attributes[ResourceAttributes.CLOUD_RESOURCE_ID] = azure_resource_uri for (key, env_var) in _APP_SERVICE_ATTRIBUTE_ENV_VARS.items(): value = environ.get(env_var) if value: diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index 02f8ea537f..11b04ebff3 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -19,11 +19,14 @@ from urllib.error import URLError from opentelemetry.sdk.resources import ResourceDetector, Resource -from opentelemetry.semconv.resource import ResourceAttributes, CloudPlatformValues, CloudProviderValues +from opentelemetry.semconv.resource import ( + ResourceAttributes, + CloudPlatformValues, + CloudProviderValues, +) # TODO: Remove when cloud resource id is no longer missing in Resource Attributes -_CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = "cloud.resource_id" _AZURE_VM_METADATA_ENDPOINT = "http://169.254.169.254/metadata/instance/compute?api-version=2021-12-13&format=json" _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = "azure.vm.scaleset.name" _AZURE_VM_SKU_ATTRIBUTE = "azure.vm.sku" @@ -35,7 +38,7 @@ ResourceAttributes.CLOUD_PLATFORM, ResourceAttributes.CLOUD_PROVIDER, ResourceAttributes.CLOUD_REGION, - _CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE, + ResourceAttributes.CLOUD_RESOURCE_ID, ResourceAttributes.HOST_ID, ResourceAttributes.HOST_NAME, ResourceAttributes.HOST_TYPE, @@ -81,7 +84,7 @@ def get_attribute_from_metadata(self, metadata_json, attribute_key): ams_value = CloudProviderValues.AZURE.value elif attribute_key == ResourceAttributes.CLOUD_REGION: ams_value = metadata_json["location"] - elif attribute_key == _CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE: + elif attribute_key == ResourceAttributes.CLOUD_RESOURCE_ID: ams_value = metadata_json["resourceId"] elif attribute_key == ResourceAttributes.HOST_ID or \ attribute_key == ResourceAttributes.SERVICE_INSTANCE_ID: From 130543667133931b28e1b7acef7ff25de80450e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20=22decko=22=20de=20Brito?= Date: Mon, 30 Oct 2023 18:10:16 -0300 Subject: [PATCH 060/200] Aiohttp-server Instrumentation (#1800) Co-authored-by: Kenny Trytek Co-authored-by: Daniel Manchon --- CHANGELOG.md | 3 +- instrumentation/README.md | 1 + .../README.rst | 24 ++ .../pyproject.toml | 61 ++++ .../aiohttp_server/__init__.py | 267 ++++++++++++++++++ .../instrumentation/aiohttp_server/package.py | 16 ++ .../instrumentation/aiohttp_server/version.py | 15 + .../tests/__init__.py | 0 .../tests/test_aiohttp_server_integration.py | 105 +++++++ .../tests/utils.py | 32 +++ .../pyproject.toml | 1 + .../instrumentation/bootstrap_gen.py | 4 + tox.ini | 8 + 13 files changed, 536 insertions(+), 1 deletion(-) create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/README.rst create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/package.py create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 2923ebc791..ea44000be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- `opentelemetry-instrumentation-aiohttp-server` Add instrumentor and auto instrumentation support for aiohttp-server + ([#1800](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800)) ### Added - `opentelemetry-instrumentation-system-metrics` Add support for collecting process metrics @@ -19,7 +21,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-resource-detector-azure` Using new Cloud Resource ID attribute. ([#1976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1976)) - ## Version 1.20.0/0.41b0 (2023-09-01) ### Fixed diff --git a/instrumentation/README.md b/instrumentation/README.md index 12b8ada105..cc5ea02def 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -3,6 +3,7 @@ | --------------- | ------------------ | --------------- | | [opentelemetry-instrumentation-aio-pika](./opentelemetry-instrumentation-aio-pika) | aio_pika >= 7.2.0, < 10.0.0 | No | [opentelemetry-instrumentation-aiohttp-client](./opentelemetry-instrumentation-aiohttp-client) | aiohttp ~= 3.0 | No +| [opentelemetry-instrumentation-aiohttp-server](./opentelemetry-instrumentation-aiohttp-server) | aiohttp ~= 3.0 | No | [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 2.0.0 | No | [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No | [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/README.rst b/instrumentation/opentelemetry-instrumentation-aiohttp-server/README.rst new file mode 100644 index 0000000000..b8606ad687 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/README.rst @@ -0,0 +1,24 @@ +OpenTelemetry aiohttp server Integration +======================================== + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-aiohttp-client.svg + :target: https://pypi.org/project/opentelemetry-instrumentation-aiohttp-client/ + +This library allows tracing HTTP requests made by the +`aiohttp server `_ library. + +Installation +------------ + +:: + + pip install opentelemetry-instrumentation-aiohttp-server + +References +---------- + +* `OpenTelemetry Project `_ +* `aiohttp client Tracing `_ +* `OpenTelemetry Python Examples `_ diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml new file mode 100644 index 0000000000..77bfa08b11 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -0,0 +1,61 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-instrumentation-aiohttp-server" +dynamic = ["version"] +description = "Aiohttp server instrumentation for OpenTelemetry" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io"} +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11" +] +dependencies = [ + "opentelemetry-api ~= 1.12", + "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-util-http == 0.42b0.dev", + "wrapt >= 1.0.0, < 2.0.0", +] + +[project.optional-dependencies] +instruments = [ + "aiohttp ~= 3.0", +] +test = [ + "opentelemetry-instrumentation-aiohttp-server[instruments]", + "pytest-asyncio", + "pytest-aiohttp", +] + +[project.entry-points.opentelemetry_instrumentor] +aiohttp-server = "opentelemetry.instrumentation.aiohttp_server:AioHttpServerInstrumentor" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aiohttp-server" + +[tool.hatch.version] +path = "src/opentelemetry/instrumentation/aiohttp_server/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py new file mode 100644 index 0000000000..3fd8e62e78 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py @@ -0,0 +1,267 @@ +# Copyright 2020, 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. + +import urllib +from aiohttp import web +from multidict import CIMultiDictProxy +from timeit import default_timer +from typing import Tuple, Dict, List, Union + +from opentelemetry import context, trace, metrics +from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.aiohttp_server.package import _instruments +from opentelemetry.instrumentation.aiohttp_server.version import __version__ +from opentelemetry.instrumentation.instrumentor import BaseInstrumentor +from opentelemetry.instrumentation.utils import http_status_to_status_code +from opentelemetry.propagators.textmap import Getter +from opentelemetry.propagate import extract +from opentelemetry.semconv.trace import SpanAttributes +from opentelemetry.semconv.metrics import MetricInstruments +from opentelemetry.trace.status import Status, StatusCode +from opentelemetry.util.http import get_excluded_urls +from opentelemetry.util.http import remove_url_credentials + +_duration_attrs = [ + SpanAttributes.HTTP_METHOD, + SpanAttributes.HTTP_HOST, + SpanAttributes.HTTP_SCHEME, + SpanAttributes.HTTP_STATUS_CODE, + SpanAttributes.HTTP_FLAVOR, + SpanAttributes.HTTP_SERVER_NAME, + SpanAttributes.NET_HOST_NAME, + SpanAttributes.NET_HOST_PORT, + SpanAttributes.HTTP_ROUTE, +] + +_active_requests_count_attrs = [ + SpanAttributes.HTTP_METHOD, + SpanAttributes.HTTP_HOST, + SpanAttributes.HTTP_SCHEME, + SpanAttributes.HTTP_FLAVOR, + SpanAttributes.HTTP_SERVER_NAME, +] + +tracer = trace.get_tracer(__name__) +meter = metrics.get_meter(__name__, __version__) +_excluded_urls = get_excluded_urls("AIOHTTP_SERVER") + + +def _parse_duration_attrs(req_attrs): + duration_attrs = {} + for attr_key in _duration_attrs: + if req_attrs.get(attr_key) is not None: + duration_attrs[attr_key] = req_attrs[attr_key] + return duration_attrs + + +def _parse_active_request_count_attrs(req_attrs): + active_requests_count_attrs = {} + for attr_key in _active_requests_count_attrs: + if req_attrs.get(attr_key) is not None: + active_requests_count_attrs[attr_key] = req_attrs[attr_key] + return active_requests_count_attrs + + +def get_default_span_details(request: web.Request) -> Tuple[str, dict]: + """Default implementation for get_default_span_details + Args: + request: the request object itself. + Returns: + a tuple of the span name, and any attributes to attach to the span. + """ + span_name = request.path.strip() or f"HTTP {request.method}" + return span_name, {} + + +def _get_view_func(request: web.Request) -> str: + """Returns the name of the request handler. + Args: + request: the request object itself. + Returns: + a string containing the name of the handler function + """ + try: + return request.match_info.handler.__name__ + except AttributeError: + return "unknown" + + +def collect_request_attributes(request: web.Request) -> Dict: + """Collects HTTP request attributes from the ASGI scope and returns a + dictionary to be used as span creation attributes.""" + + server_host, port, http_url = ( + request.url.host, + request.url.port, + str(request.url), + ) + query_string = request.query_string + if query_string and http_url: + if isinstance(query_string, bytes): + query_string = query_string.decode("utf8") + http_url += "?" + urllib.parse.unquote(query_string) + + result = { + SpanAttributes.HTTP_SCHEME: request.scheme, + SpanAttributes.HTTP_HOST: server_host, + SpanAttributes.NET_HOST_PORT: port, + SpanAttributes.HTTP_ROUTE: _get_view_func(request), + SpanAttributes.HTTP_FLAVOR: f"{request.version.major}.{request.version.minor}", + SpanAttributes.HTTP_TARGET: request.path, + SpanAttributes.HTTP_URL: remove_url_credentials(http_url), + } + + http_method = request.method + if http_method: + result[SpanAttributes.HTTP_METHOD] = http_method + + http_host_value_list = ( + [request.host] if type(request.host) != list else request.host + ) + if http_host_value_list: + result[SpanAttributes.HTTP_SERVER_NAME] = ",".join( + http_host_value_list + ) + http_user_agent = request.headers.get("user-agent") + if http_user_agent: + result[SpanAttributes.HTTP_USER_AGENT] = http_user_agent + + # remove None values + result = {k: v for k, v in result.items() if v is not None} + + return result + + +def set_status_code(span, status_code: int) -> None: + """Adds HTTP response attributes to span using the status_code argument.""" + + try: + status_code = int(status_code) + except ValueError: + span.set_status( + Status( + StatusCode.ERROR, + "Non-integer HTTP status: " + repr(status_code), + ) + ) + else: + span.set_attribute(SpanAttributes.HTTP_STATUS_CODE, status_code) + span.set_status( + Status(http_status_to_status_code(status_code, server_span=True)) + ) + + +class AiohttpGetter(Getter): + """Extract current trace from headers""" + + def get(self, carrier, key: str) -> Union[List, None]: + """Getter implementation to retrieve an HTTP header value from the ASGI + scope. + + Args: + carrier: ASGI scope object + key: header name in scope + Returns: + A list of all header values matching the key, or None if the key + does not match any header. + """ + headers: CIMultiDictProxy = carrier.headers + if not headers: + return None + return headers.getall(key, None) + + def keys(self, carrier: Dict) -> List: + return list(carrier.keys()) + + +getter = AiohttpGetter() + + +@web.middleware +async def middleware(request, handler): + """Middleware for aiohttp implementing tracing logic""" + if ( + context.get_value("suppress_instrumentation") + or context.get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY) + or _excluded_urls.url_disabled(request.url.path) + ): + return await handler(request) + + span_name, additional_attributes = get_default_span_details(request) + + req_attrs = collect_request_attributes(request) + duration_attrs = _parse_duration_attrs(req_attrs) + active_requests_count_attrs = _parse_active_request_count_attrs(req_attrs) + + duration_histogram = meter.create_histogram( + name=MetricInstruments.HTTP_SERVER_DURATION, + unit="ms", + description="measures the duration of the inbound HTTP request", + ) + + active_requests_counter = meter.create_up_down_counter( + name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, + unit="requests", + description="measures the number of concurrent HTTP requests those are currently in flight", + ) + + with tracer.start_as_current_span( + span_name, + context=extract(request, getter=getter), + kind=trace.SpanKind.SERVER, + ) as span: + attributes = collect_request_attributes(request) + attributes.update(additional_attributes) + span.set_attributes(attributes) + start = default_timer() + active_requests_counter.add(1, active_requests_count_attrs) + try: + resp = await handler(request) + set_status_code(span, resp.status) + except web.HTTPException as ex: + set_status_code(span, ex.status_code) + raise + finally: + duration = max((default_timer() - start) * 1000, 0) + duration_histogram.record(duration, duration_attrs) + active_requests_counter.add(-1, active_requests_count_attrs) + return resp + + +class _InstrumentedApplication(web.Application): + """Insert tracing middleware""" + + def __init__(self, *args, **kwargs): + middlewares = kwargs.pop("middlewares", []) + middlewares.insert(0, middleware) + kwargs["middlewares"] = middlewares + super().__init__(*args, **kwargs) + + +class AioHttpServerInstrumentor(BaseInstrumentor): + # pylint: disable=protected-access,attribute-defined-outside-init + """An instrumentor for aiohttp.web.Application + + See `BaseInstrumentor` + """ + + def _instrument(self, **kwargs): + self._original_app = web.Application + setattr(web, "Application", _InstrumentedApplication) + + def _uninstrument(self, **kwargs): + setattr(web, "Application", self._original_app) + + def instrumentation_dependencies(self): + return _instruments diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/package.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/package.py new file mode 100644 index 0000000000..557f1a54a9 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/package.py @@ -0,0 +1,16 @@ +# 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. + + +_instruments = ("aiohttp ~= 3.0",) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py new file mode 100644 index 0000000000..c2996671d6 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py @@ -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.42b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py new file mode 100644 index 0000000000..973aea0d1c --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py @@ -0,0 +1,105 @@ +# Copyright 2020, 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. + +import pytest +import pytest_asyncio +import aiohttp +from http import HTTPStatus +from .utils import HTTPMethod + +from opentelemetry import trace as trace_api +from opentelemetry.test.test_base import TestBase +from opentelemetry.instrumentation.aiohttp_server import AioHttpServerInstrumentor +from opentelemetry.semconv.trace import SpanAttributes +from opentelemetry.util._importlib_metadata import entry_points + +from opentelemetry.test.globals_test import ( + reset_trace_globals, +) + + +@pytest.fixture(scope="session") +def tracer(): + test_base = TestBase() + + tracer_provider, memory_exporter = test_base.create_tracer_provider() + + reset_trace_globals() + trace_api.set_tracer_provider(tracer_provider) + + yield tracer_provider, memory_exporter + + reset_trace_globals() + + +async def default_handler(request, status=200): + return aiohttp.web.Response(status=status) + + +@pytest_asyncio.fixture +async def server_fixture(tracer, aiohttp_server): + _, memory_exporter = tracer + + AioHttpServerInstrumentor().instrument() + + app = aiohttp.web.Application() + app.add_routes( + [aiohttp.web.get("/test-path", default_handler)]) + + server = await aiohttp_server(app) + yield server, app + + memory_exporter.clear() + + AioHttpServerInstrumentor().uninstrument() + + +def test_checking_instrumentor_pkg_installed(): + + (instrumentor_entrypoint,) = entry_points(group="opentelemetry_instrumentor", name="aiohttp-server") + instrumentor = instrumentor_entrypoint.load()() + assert (isinstance(instrumentor, AioHttpServerInstrumentor)) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("url, expected_method, expected_status_code", [ + ("/test-path", HTTPMethod.GET, HTTPStatus.OK), + ("/not-found", HTTPMethod.GET, HTTPStatus.NOT_FOUND) +]) +async def test_status_code_instrumentation( + tracer, + server_fixture, + aiohttp_client, + url, + expected_method, + expected_status_code +): + _, memory_exporter = tracer + server, app = server_fixture + + assert len(memory_exporter.get_finished_spans()) == 0 + + client = await aiohttp_client(server) + await client.get(url) + + assert len(memory_exporter.get_finished_spans()) == 1 + + [span] = memory_exporter.get_finished_spans() + + assert expected_method.value == span.attributes[SpanAttributes.HTTP_METHOD] + assert expected_status_code == span.attributes[SpanAttributes.HTTP_STATUS_CODE] + + assert f"http://{server.host}:{server.port}{url}" == span.attributes[ + SpanAttributes.HTTP_URL + ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py new file mode 100644 index 0000000000..8fedcb32e3 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py @@ -0,0 +1,32 @@ +# Copyright 2020, 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. + +from enum import Enum + + +class HTTPMethod(Enum): + """HTTP methods and descriptions""" + + def __repr__(self): + return f"{self.value}" + + CONNECT = 'CONNECT' + DELETE = 'DELETE' + GET = 'GET' + HEAD = 'HEAD' + OPTIONS = 'OPTIONS' + PATCH = 'PATCH' + POST = 'POST' + PUT = 'PUT' + TRACE = 'TRACE' diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index feb229e384..008e5fb281 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -31,6 +31,7 @@ classifiers = [ dependencies = [ "opentelemetry-instrumentation-aio-pika==0.42b0.dev", "opentelemetry-instrumentation-aiohttp-client==0.42b0.dev", + "opentelemetry-instrumentation-aiohttp-server==0.42b0.dev", "opentelemetry-instrumentation-aiopg==0.42b0.dev", "opentelemetry-instrumentation-asgi==0.42b0.dev", "opentelemetry-instrumentation-asyncpg==0.42b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 49b044a2a3..eb9eac8762 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -24,6 +24,10 @@ "library": "aiohttp ~= 3.0", "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.42b0.dev", }, + "aiohttp": { + "library": "aiohttp ~= 3.0", + "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.42b0.dev", + }, "aiopg": { "library": "aiopg >= 0.13.0, < 2.0.0", "instrumentation": "opentelemetry-instrumentation-aiopg==0.42b0.dev", diff --git a/tox.ini b/tox.ini index aea0b49d4a..2eaef92404 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,10 @@ envlist = py3{7,8,9,10,11}-test-instrumentation-aiohttp-client pypy3-test-instrumentation-aiohttp-client + ; opentelemetry-instrumentation-aiohttp-server + py3{6,7,8,9,10,11}-test-instrumentation-aiohttp-server + pypy3-test-instrumentation-aiohttp-server + ; opentelemetry-instrumentation-aiopg py3{7,8,9,10,11}-test-instrumentation-aiopg ; instrumentation-aiopg intentionally excluded from pypy3 @@ -305,6 +309,7 @@ changedir = test-opentelemetry-instrumentation: opentelemetry-instrumentation/tests test-instrumentation-aio-pika: instrumentation/opentelemetry-instrumentation-aio-pika/tests test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests + test-instrumentation-aiohttp-server: instrumentation/opentelemetry-instrumentation-aiohttp-server/tests test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests test-instrumentation-asyncpg: instrumentation/opentelemetry-instrumentation-asyncpg/tests @@ -450,6 +455,8 @@ commands_pre = aiohttp-client: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] + aiohttp-server: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] + aiopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] richconsole: pip install flaky {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] @@ -555,6 +562,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] + python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid[test] From 657d502419b222fa226bc3e626770876905d838e Mon Sep 17 00:00:00 2001 From: Margaret Yu Date: Wed, 1 Nov 2023 14:54:26 -0700 Subject: [PATCH 061/200] Specify the topic arn as the span attribute messaging.destination.name in the botocore sns instrumentation (#1995) --- CHANGELOG.md | 2 ++ .../instrumentation/botocore/extensions/sns.py | 2 ++ .../tests/test_botocore_sns.py | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea44000be5..89970d2fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1800](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800)) ### Added +- `opentelemetry-instrumentation-botocore` Include SNS topic ARN as a span attribute with name `messaging.destination.name` to uniquely identify the SNS topic + ([#1995](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1995)) - `opentelemetry-instrumentation-system-metrics` Add support for collecting process metrics ([#1948](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1948)) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py index 7849daa286..9536133f5c 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py @@ -81,6 +81,8 @@ def extract_attributes( ] = MessagingDestinationKindValues.TOPIC.value attributes[SpanAttributes.MESSAGING_DESTINATION] = destination_name + # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when opentelemetry-semantic-conventions 0.42b0 is released + attributes["messaging.destination.name"] = cls._extract_input_arn(call_context) call_context.span_name = ( f"{'phone_number' if is_phone_number else destination_name} send" ) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py index 33f2531027..cf676619e6 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py @@ -118,6 +118,12 @@ def _test_publish_to_arn(self, arg_name: str): self.topic_name, span.attributes[SpanAttributes.MESSAGING_DESTINATION], ) + self.assertEqual( + target_arn, + # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when + # opentelemetry-semantic-conventions 0.42b0 is released + span.attributes["messaging.destination.name"] + ) @mock_sns def test_publish_to_phone_number(self): @@ -184,6 +190,12 @@ def test_publish_batch_to_topic(self): self.topic_name, span.attributes[SpanAttributes.MESSAGING_DESTINATION], ) + self.assertEqual( + topic_arn, + # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when + # opentelemetry-semantic-conventions 0.42b0 is released + span.attributes["messaging.destination.name"] + ) self.assert_injected_span(message1_attrs, span) self.assert_injected_span(message2_attrs, span) From 98923dc5b331277d8bdc4240aeb61a5a72cc0e47 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 2 Nov 2023 20:50:41 -0600 Subject: [PATCH 062/200] Add -ra option to pytest runs (#2035) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8decdb1a42..7d79123de5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: ~/.cache/pip key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }} - name: run tox - run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json # - name: Find and merge ${{ matrix.package }} benchmarks # # TODO: Add at least one benchmark to every package type to remove this (#249) # if: matrix.package == 'sdkextension' || matrix.package == 'propagator' From eb6024ca3171072daa5d842d9363e41d72ee64a6 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 2 Nov 2023 23:40:46 -0600 Subject: [PATCH 063/200] Fix failing test cases (#2033) --- .github/workflows/test.yml | 2 +- .../tests/test_asgi_middleware.py | 5 +--- .../tests/test_metrics.py | 7 +---- .../tests/test_sqlalchemy_metrics.py | 15 ++++------- .../tests/test_metrics_instrumentation.py | 26 ++++++++++++++----- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d79123de5..cb1eecbf34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 0ef76a5cc39626f783416ca75e43556e2bb2739d + CORE_REPO_SHA: d054dff47d2da663a39b9656d106c3d15f344269 jobs: build: diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index cb22174482..209acdf663 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -656,10 +656,7 @@ def test_no_metric_for_websockets(self): self.send_input({"type": "websocket.receive", "text": "ping"}) self.send_input({"type": "websocket.disconnect"}) self.get_all_output() - metrics_list = self.memory_metrics_reader.get_metrics_data() - self.assertEqual( - len(metrics_list.resource_metrics[0].scope_metrics), 0 - ) + self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) class TestAsgiAttributes(unittest.TestCase): diff --git a/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py index 46e39a6046..e290362e77 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py @@ -68,9 +68,4 @@ def test_metric_uninstrument(self): self.assertEqual(len(metrics), 1) CeleryInstrumentor().uninstrument() - metrics = self.get_metrics() - self.assertEqual(len(metrics), 1) - - for metric in metrics: - for point in list(metric.data.data_points): - self.assertEqual(point.count, 1) + self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py index 2d753c3c42..8d89959428 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests/test_sqlalchemy_metrics.py @@ -56,8 +56,7 @@ def test_metrics_one_connection(self): pool_logging_name=pool_name, ) - metrics = self.get_sorted_metrics() - self.assertEqual(len(metrics), 0) + self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) with engine.connect(): self.assert_pool_idle_used_expected( @@ -78,8 +77,7 @@ def test_metrics_without_pool_name(self): pool_logging_name=pool_name, ) - metrics = self.get_sorted_metrics() - self.assertEqual(len(metrics), 0) + self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) with engine.connect(): self.assert_pool_idle_used_expected( @@ -100,8 +98,7 @@ def test_metrics_two_connections(self): pool_logging_name=pool_name, ) - metrics = self.get_sorted_metrics() - self.assertEqual(len(metrics), 0) + self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) with engine.connect(): with engine.connect(): @@ -122,8 +119,7 @@ def test_metrics_connections(self): pool_logging_name=pool_name, ) - metrics = self.get_sorted_metrics() - self.assertEqual(len(metrics), 0) + self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) with engine.connect(): with engine.connect(): @@ -156,5 +152,4 @@ def test_metric_uninstrument(self): engine.connect() - metrics = self.get_sorted_metrics() - self.assertEqual(len(metrics), 0) + self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py index f56aa4f97d..d8f19f4e5d 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py @@ -16,6 +16,9 @@ from timeit import default_timer from urllib import request from urllib.parse import urlencode +from pytest import mark +from platform import python_implementation +from sys import version_info import httpretty @@ -185,16 +188,27 @@ def test_basic_metric_request_not_empty(self): ), ) + @mark.skipif( + python_implementation() == "PyPy" or version_info.minor == 7, + reason="Fails randomly in 3.7 and pypy" + ) def test_metric_uninstrument(self): with request.urlopen(self.URL): metrics = self.get_sorted_metrics() self.assertEqual(len(metrics), 3) + self.assertEqual( + metrics[0].data.data_points[0].sum, 1 + ) + self.assertEqual( + metrics[1].data.data_points[0].sum, 0 + ) + self.assertEqual( + metrics[2].data.data_points[0].sum, 6 + ) + URLLibInstrumentor().uninstrument() with request.urlopen(self.URL): - metrics = self.get_sorted_metrics() - self.assertEqual(len(metrics), 3) - - for metric in metrics: - for point in list(metric.data.data_points): - self.assertEqual(point.count, 1) + self.assertIsNone( + self.memory_metrics_reader.get_metrics_data() + ) From 4f6618324d02e663ddcc24fe68d5241ca1620a48 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 6 Nov 2023 11:39:51 -0800 Subject: [PATCH 064/200] Set schema_url on all tracers and meters (#1977) --- CHANGELOG.md | 5 +- .../aio_pika/aio_pika_instrumentor.py | 5 +- .../aiohttp_client/__init__.py | 7 +- .../tests/test_aiohttp_client_integration.py | 15 ++ .../instrumentation/asgi/__init__.py | 14 +- .../instrumentation/asyncpg/__init__.py | 7 +- .../instrumentation/aws_lambda/__init__.py | 7 +- .../instrumentation/boto/__init__.py | 5 +- .../instrumentation/boto3sqs/__init__.py | 5 +- .../instrumentation/botocore/__init__.py | 5 +- .../instrumentation/cassandra/__init__.py | 16 ++- .../tests/test_cassandra_integration.py | 24 +++- .../instrumentation/celery/__init__.py | 14 +- .../confluent_kafka/__init__.py | 15 +- .../instrumentation/dbapi/__init__.py | 1 + .../instrumentation/django/__init__.py | 8 +- .../instrumentation/elasticsearch/__init__.py | 7 +- .../instrumentation/falcon/__init__.py | 12 +- .../instrumentation/fastapi/__init__.py | 12 +- .../instrumentation/flask/__init__.py | 24 +++- .../tests/test_programmatic.py | 6 +- .../instrumentation/grpc/__init__.py | 28 +++- .../instrumentation/httpx/__init__.py | 2 + .../instrumentation/jinja2/__init__.py | 7 +- .../instrumentation/kafka/__init__.py | 5 +- .../instrumentation/pika/pika_instrumentor.py | 7 +- .../instrumentation/pymemcache/__init__.py | 7 +- .../instrumentation/pymongo/__init__.py | 7 +- .../instrumentation/pyramid/callbacks.py | 12 +- .../instrumentation/redis/__init__.py | 5 +- .../instrumentation/remoulade/__init__.py | 7 +- .../instrumentation/requests/__init__.py | 8 +- .../instrumentation/sklearn/__init__.py | 8 +- .../instrumentation/sqlalchemy/__init__.py | 14 +- .../instrumentation/starlette/__init__.py | 12 +- .../system_metrics/__init__.py | 1 + .../instrumentation/tornado/__init__.py | 14 +- .../instrumentation/tortoiseorm/__init__.py | 7 +- .../instrumentation/urllib/__init__.py | 14 +- .../instrumentation/urllib3/__init__.py | 14 +- .../tests/test_urllib3_integration.py | 11 ++ .../tests/test_urllib3_metrics.py | 14 ++ .../instrumentation/wsgi/__init__.py | 18 ++- .../tests/test_wsgi_middleware.py | 14 +- .../resource/detector/azure/vm.py | 18 ++- .../tests/test_app_service.py | 131 +++++++++++------- .../tests/test_vm.py | 10 +- .../src/opentelemetry/util/http/__init__.py | 20 ++- .../tests/test_sanitize_method.py | 3 +- 49 files changed, 504 insertions(+), 128 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89970d2fb5..5c885d977e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1800](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800)) ### Added + - `opentelemetry-instrumentation-botocore` Include SNS topic ARN as a span attribute with name `messaging.destination.name` to uniquely identify the SNS topic ([#1995](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1995)) - `opentelemetry-instrumentation-system-metrics` Add support for collecting process metrics ([#1948](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1948)) +- Added schema_url (`"https://opentelemetry.io/schemas/1.11.0"`) to all metrics and traces + ([#1977](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1977)) ### Fixed @@ -61,7 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1744](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1744)) - Fix async redis clients not being traced correctly ([#1830](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1830)) -- Make Flask request span attributes available for `start_span`. +- Make Flask request span attributes available for `start_span`. ([#1784](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1784)) - Fix falcon instrumentation's usage of Span Status to only set the description if the status code is ERROR. ([#1840](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1840)) diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/aio_pika_instrumentor.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/aio_pika_instrumentor.py index 99420d0892..caf0e5b1a9 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/aio_pika_instrumentor.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/aio_pika_instrumentor.py @@ -64,7 +64,10 @@ async def wrapper(wrapped, instance, args, kwargs): def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider", None) tracer = trace.get_tracer( - _INSTRUMENTATION_MODULE_NAME, __version__, tracer_provider + _INSTRUMENTATION_MODULE_NAME, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self._instrument_queue(tracer) self._instrument_exchange(tracer) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py index 65e1601f34..ef3b667c98 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py @@ -163,7 +163,12 @@ def create_trace_config( # Explicitly specify the type for the `request_hook` and `response_hook` param and rtype to work # around this issue. - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) def _end_trace(trace_config_ctx: types.SimpleNamespace): context_api.detach(trace_config_ctx.token) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py index 6af9d41900..9c73071465 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py @@ -134,6 +134,21 @@ def test_status_codes(self): self.memory_exporter.clear() + def test_schema_url(self): + with self.subTest(status_code=200): + host, port = self._http_request( + trace_config=aiohttp_client.create_trace_config(), + url="/test-path?query=param#foobar", + status_code=200, + ) + + span = self.memory_exporter.get_finished_spans()[0] + self.assertEqual( + span.instrumentation_info.schema_url, + "https://opentelemetry.io/schemas/1.11.0", + ) + self.memory_exporter.clear() + def test_not_recording(self): mock_tracer = mock.Mock() mock_span = mock.Mock() diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index c0dcd39fd2..8d5aa4e2d2 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -495,9 +495,19 @@ def __init__( meter=None, ): self.app = guarantee_single_callable(app) - self.tracer = trace.get_tracer(__name__, __version__, tracer_provider) + self.tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) self.meter = ( - get_meter(__name__, __version__, meter_provider) + get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) if meter is None else meter ) diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py index 4c9bc8c727..c6b5a55e79 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py @@ -107,7 +107,12 @@ def instrumentation_dependencies(self) -> Collection[str]: def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider") - self._tracer = trace.get_tracer(__name__, __version__, tracer_provider) + self._tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) for method in [ "Connection.execute", diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index 799becbdcc..391bc32f60 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -321,7 +321,12 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches except (IndexError, KeyError, TypeError): span_kind = SpanKind.SERVER - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) with tracer.start_as_current_span( name=orig_handler_name, diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py index 84c4e54a86..c92ccc8106 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py @@ -91,7 +91,10 @@ def _instrument(self, **kwargs): # pylint: disable=attribute-defined-outside-init self._tracer = get_tracer( - __name__, __version__, kwargs.get("tracer_provider") + __name__, + __version__, + kwargs.get("tracer_provider"), + schema_url="https://opentelemetry.io/schemas/1.11.0", ) wrap_function_wrapper( diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py index c34be82189..137c570ac6 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py @@ -422,7 +422,10 @@ def _instrument(self, **kwargs: Dict[str, Any]) -> None: "tracer_provider" ) self._tracer: Tracer = trace.get_tracer( - __name__, __version__, self._tracer_provider + __name__, + __version__, + self._tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self._wrap_client_creation() diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py index baf8a56e71..686b040b13 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py @@ -127,7 +127,10 @@ def instrumentation_dependencies(self) -> Collection[str]: def _instrument(self, **kwargs): # pylint: disable=attribute-defined-outside-init self._tracer = get_tracer( - __name__, __version__, kwargs.get("tracer_provider") + __name__, + __version__, + kwargs.get("tracer_provider"), + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self.request_hook = kwargs.get("request_hook") diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py index 6a4ee7edc5..202bf03712 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py @@ -55,7 +55,12 @@ def _instrument(tracer_provider, include_db_statement=False): Wraps cassandra.cluster.Session.execute_async(). """ - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) name = "Cassandra" def _traced_execute_async(func, instance, args, kwargs): @@ -65,7 +70,10 @@ def _traced_execute_async(func, instance, args, kwargs): if span.is_recording(): span.set_attribute(SpanAttributes.DB_NAME, instance.keyspace) span.set_attribute(SpanAttributes.DB_SYSTEM, "cassandra") - span.set_attribute(SpanAttributes.NET_PEER_NAME, instance.cluster.contact_points) + span.set_attribute( + SpanAttributes.NET_PEER_NAME, + instance.cluster.contact_points, + ) if include_db_statement: query = args[0] @@ -74,7 +82,9 @@ def _traced_execute_async(func, instance, args, kwargs): response = func(*args, **kwargs) return response - wrap_function_wrapper("cassandra.cluster", "Session.execute_async", _traced_execute_async) + wrap_function_wrapper( + "cassandra.cluster", "Session.execute_async", _traced_execute_async + ) class CassandraInstrumentor(BaseInstrumentor): diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py b/instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py index 6977e1b2a2..ed488ab07f 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/tests/test_cassandra_integration.py @@ -46,15 +46,25 @@ def tearDown(self): def test_instrument_uninstrument(self): instrumentation = CassandraInstrumentor() instrumentation.instrument() - self.assertTrue(isinstance(cassandra.cluster.Session.execute_async, BoundFunctionWrapper)) + self.assertTrue( + isinstance( + cassandra.cluster.Session.execute_async, BoundFunctionWrapper + ) + ) instrumentation.uninstrument() - self.assertFalse(isinstance(cassandra.cluster.Session.execute_async, BoundFunctionWrapper)) + self.assertFalse( + isinstance( + cassandra.cluster.Session.execute_async, BoundFunctionWrapper + ) + ) @mock.patch("cassandra.cluster.Cluster.connect") @mock.patch("cassandra.cluster.Session.__init__") @mock.patch("cassandra.cluster.Session._create_response_future") - def test_instrumentor(self, mock_create_response_future, mock_session_init, mock_connect): + def test_instrumentor( + self, mock_create_response_future, mock_session_init, mock_connect + ): mock_create_response_future.return_value = mock.Mock() mock_session_init.return_value = None mock_connect.return_value = cassandra.cluster.Session() @@ -85,7 +95,9 @@ def test_instrumentor(self, mock_create_response_future, mock_session_init, mock @mock.patch("cassandra.cluster.Cluster.connect") @mock.patch("cassandra.cluster.Session.__init__") @mock.patch("cassandra.cluster.Session._create_response_future") - def test_custom_tracer_provider(self, mock_create_response_future, mock_session_init, mock_connect): + def test_custom_tracer_provider( + self, mock_create_response_future, mock_session_init, mock_connect + ): mock_create_response_future.return_value = mock.Mock() mock_session_init.return_value = None mock_connect.return_value = cassandra.cluster.Session() @@ -107,7 +119,9 @@ def test_custom_tracer_provider(self, mock_create_response_future, mock_session_ @mock.patch("cassandra.cluster.Cluster.connect") @mock.patch("cassandra.cluster.Session.__init__") @mock.patch("cassandra.cluster.Session._create_response_future") - def test_instrument_connection_no_op_tracer_provider(self, mock_create_response_future, mock_session_init, mock_connect): + def test_instrument_connection_no_op_tracer_provider( + self, mock_create_response_future, mock_session_init, mock_connect + ): mock_create_response_future.return_value = mock.Mock() mock_session_init.return_value = None mock_connect.return_value = cassandra.cluster.Session() diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py index bb83a5c192..8baddcca94 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py @@ -126,10 +126,20 @@ def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider") # pylint: disable=attribute-defined-outside-init - self._tracer = trace.get_tracer(__name__, __version__, tracer_provider) + self._tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) meter_provider = kwargs.get("meter_provider") - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) self.create_celery_metrics(meter) diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py index c4e68b33b4..45a16fcffb 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py @@ -229,7 +229,10 @@ def instrument_producer( producer: Producer, tracer_provider=None ) -> ProxiedProducer: tracer = trace.get_tracer( - __name__, __version__, tracer_provider=tracer_provider + __name__, + __version__, + tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) manual_producer = ProxiedProducer(producer, tracer) @@ -241,7 +244,10 @@ def instrument_consumer( consumer: Consumer, tracer_provider=None ) -> ProxiedConsumer: tracer = trace.get_tracer( - __name__, __version__, tracer_provider=tracer_provider + __name__, + __version__, + tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) manual_consumer = ProxiedConsumer(consumer, tracer) @@ -272,7 +278,10 @@ def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider") tracer = trace.get_tracer( - __name__, __version__, tracer_provider=tracer_provider + __name__, + __version__, + tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self._tracer = tracer diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py index 6d7e37a45f..e1840ae011 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py @@ -264,6 +264,7 @@ def __init__( self._name, instrumenting_library_version=self._version, tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self.capture_parameters = capture_parameters self.enable_commenter = enable_commenter diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py index d545a1950b..583f1adeb6 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py @@ -300,8 +300,14 @@ def _instrument(self, **kwargs): __name__, __version__, tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) + meter = get_meter( + __name__, + __version__, + meter_provider=meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) - meter = get_meter(__name__, __version__, meter_provider=meter_provider) _DjangoMiddleware._tracer = tracer _DjangoMiddleware._meter = meter _DjangoMiddleware._excluded_urls = ( diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py index 480ccb6402..e3a9f5256f 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py @@ -140,7 +140,12 @@ def _instrument(self, **kwargs): Instruments Elasticsearch module """ tracer_provider = kwargs.get("tracer_provider") - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) request_hook = kwargs.get("request_hook") response_hook = kwargs.get("response_hook") if es_transport_split: diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py index 669f41b0ab..d6cf8249a4 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py @@ -254,9 +254,17 @@ def __init__(self, *args, **kwargs): self._middlewares_list = [self._middlewares_list] self._otel_tracer = trace.get_tracer( - __name__, __version__, tracer_provider + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) + self._otel_meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) - self._otel_meter = get_meter(__name__, __version__, meter_provider) self.duration_histogram = self._otel_meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py index e99c8be6ed..10b73c7a5b 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py @@ -222,7 +222,12 @@ def instrument_app( excluded_urls = _excluded_urls_from_env else: excluded_urls = parse_excluded_urls(excluded_urls) - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) app.add_middleware( OpenTelemetryMiddleware, @@ -295,7 +300,10 @@ class _InstrumentedFastAPI(fastapi.FastAPI): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) meter = get_meter( - __name__, __version__, _InstrumentedFastAPI._meter_provider + __name__, + __version__, + _InstrumentedFastAPI._meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self.add_middleware( OpenTelemetryMiddleware, diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index 432c6b1fbf..18b4713eaf 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -495,7 +495,10 @@ def __init__(self, *args, **kwargs): self._is_instrumented_by_opentelemetry = True meter = get_meter( - __name__, __version__, _InstrumentedFlask._meter_provider + __name__, + __version__, + _InstrumentedFlask._meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, @@ -517,7 +520,10 @@ def __init__(self, *args, **kwargs): ) tracer = trace.get_tracer( - __name__, __version__, _InstrumentedFlask._tracer_provider + __name__, + __version__, + _InstrumentedFlask._tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) _before_request = _wrapped_before_request( @@ -594,7 +600,12 @@ def instrument_app( if excluded_urls is not None else _excluded_urls_from_env ) - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", @@ -615,7 +626,12 @@ def instrument_app( excluded_urls=excluded_urls, ) - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) _before_request = _wrapped_before_request( request_hook, diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py index bf641aaed4..a86bc3166a 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py @@ -328,7 +328,9 @@ def test_flask_metric_values(self): if isinstance(point, NumberDataPoint): self.assertEqual(point.value, 0) - def _assert_basic_metric(self, expected_duration_attributes, expected_requests_count_attributes): + def _assert_basic_metric( + self, expected_duration_attributes, expected_requests_count_attributes + ): metrics_list = self.memory_metrics_reader.get_metrics_data() for resource_metric in metrics_list.resource_metrics: for scope_metrics in resource_metric.scope_metrics: @@ -394,7 +396,7 @@ def test_basic_metric_nonstandard_http_method_success(self): ) @patch.dict( - "os.environ", + "os.environ", { OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS: "1", }, diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py index 440d1facc8..717977146e 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py @@ -576,7 +576,12 @@ def client_interceptor( """ from . import _client - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) return _client.OpenTelemetryClientInterceptor( tracer, @@ -601,7 +606,12 @@ def server_interceptor(tracer_provider=None, filter_=None): """ from . import _server - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) return _server.OpenTelemetryServerInterceptor(tracer, filter_=filter_) @@ -619,7 +629,12 @@ def aio_client_interceptors( """ from . import _aio_client - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) return [ _aio_client.UnaryUnaryAioClientInterceptor( @@ -660,7 +675,12 @@ def aio_server_interceptor(tracer_provider=None, filter_=None): """ from . import _aio_server - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) return _aio_server.OpenTelemetryAioServerInterceptor( tracer, filter_=filter_ diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py index bb40adbc26..f5d34b3c40 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -290,6 +290,7 @@ def __init__( __name__, instrumenting_library_version=__version__, tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self._request_hook = request_hook self._response_hook = response_hook @@ -384,6 +385,7 @@ def __init__( __name__, instrumenting_library_version=__version__, tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self._request_hook = request_hook self._response_hook = response_hook diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/__init__.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/__init__.py index 735f808e90..0b199cbe64 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/__init__.py @@ -130,7 +130,12 @@ def instrumentation_dependencies(self) -> Collection[str]: def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider") - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) _wrap(jinja2, "environment.Template.render", _wrap_render(tracer)) _wrap(jinja2, "environment.Template.generate", _wrap_render(tracer)) diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/__init__.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/__init__.py index ad94a4fb04..8d7378dfdf 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/__init__.py @@ -102,7 +102,10 @@ def _instrument(self, **kwargs): consume_hook = kwargs.get("consume_hook") tracer = trace.get_tracer( - __name__, __version__, tracer_provider=tracer_provider + __name__, + __version__, + tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) wrap_function_wrapper( diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py index b09c3a0f9c..186128b3b2 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py @@ -122,7 +122,12 @@ def instrument_channel( "Attempting to instrument Pika channel while already instrumented!" ) return - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) PikaInstrumentor._instrument_blocking_channel_consumers( channel, tracer, consume_hook ) diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py index 573414c1c7..e95c6b21ce 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py @@ -182,7 +182,12 @@ def instrumentation_dependencies(self) -> Collection[str]: def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider") - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) for cmd in COMMANDS: _wrap( diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py index 00e757edee..041ff6b928 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py @@ -248,7 +248,12 @@ def _instrument(self, **kwargs): capture_statement = kwargs.get("capture_statement") # Create and register a CommandTracer only the first time if self._commandtracer_instance is None: - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) self._commandtracer_instance = CommandTracer( tracer, diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py index ce15f0cb24..e3675fcfab 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py @@ -84,7 +84,11 @@ def _before_traversal(event): return start_time = request_environ.get(_ENVIRON_STARTTIME_KEY) - tracer = trace.get_tracer(__name__, __version__) + tracer = trace.get_tracer( + __name__, + __version__, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) if request.matched_route: span_name = request.matched_route.pattern @@ -128,7 +132,11 @@ def trace_tween_factory(handler, registry): # pylint: disable=too-many-statements settings = registry.settings enabled = asbool(settings.get(SETTING_TRACE_ENABLED, True)) - meter = get_meter(__name__, __version__) + meter = get_meter( + __name__, + __version__, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py index ba4b8d529e..1d61e8cfd3 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/__init__.py @@ -333,7 +333,10 @@ def _instrument(self, **kwargs): """ tracer_provider = kwargs.get("tracer_provider") tracer = trace.get_tracer( - __name__, __version__, tracer_provider=tracer_provider + __name__, + __version__, + tracer_provider=tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) _instrument( tracer, diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/__init__.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/__init__.py index 87a26585fc..56e544edcd 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/__init__.py @@ -176,7 +176,12 @@ def _instrument(self, **kwargs): tracer_provider = kwargs.get("tracer_provider") # pylint: disable=attribute-defined-outside-init - self._tracer = trace.get_tracer(__name__, __version__, tracer_provider) + self._tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) instrumentation_middleware = _InstrumentationMiddleware(self._tracer) broker.add_extra_default_middleware(instrumentation_middleware) diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py index c3dabf05a5..535b14285f 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -277,13 +277,19 @@ def _instrument(self, **kwargs): list of regexes used to exclude URLs from tracking """ tracer_provider = kwargs.get("tracer_provider") - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) excluded_urls = kwargs.get("excluded_urls") meter_provider = kwargs.get("meter_provider") meter = get_meter( __name__, __version__, meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_DURATION, diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py index 08abeb1d0e..5ca132797f 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py @@ -129,9 +129,11 @@ def implement_span_function(func: Callable, name: str, attributes: Attributes): @wraps(func) def wrapper(*args, **kwargs): - with get_tracer(__name__, __version__).start_as_current_span( - name=name - ) as span: + with get_tracer( + __name__, + __version__, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ).start_as_current_span(name=name) as span: if span.is_recording(): for key, val in attributes.items(): span.set_attribute(key, val) diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py index e14ac9600c..2107bc3e23 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/__init__.py @@ -142,10 +142,20 @@ def _instrument(self, **kwargs): An instrumented engine if passed in as an argument or list of instrumented engines, None otherwise. """ tracer_provider = kwargs.get("tracer_provider") - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) meter_provider = kwargs.get("meter_provider") - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) connections_usage = meter.create_up_down_counter( name=MetricInstruments.DB_CLIENT_CONNECTIONS_USAGE, diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py index 2d123aa70e..1ebc3348d4 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py @@ -207,7 +207,12 @@ def instrument_app( tracer_provider=None, ): """Instrument an uninstrumented Starlette application.""" - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) if not getattr(app, "is_instrumented_by_opentelemetry", False): app.add_middleware( OpenTelemetryMiddleware, @@ -273,7 +278,10 @@ class _InstrumentedStarlette(applications.Starlette): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) meter = get_meter( - __name__, __version__, _InstrumentedStarlette._meter_provider + __name__, + __version__, + _InstrumentedStarlette._meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) self.add_middleware( OpenTelemetryMiddleware, diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py index 3d6a0c6775..e97685ba74 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py @@ -172,6 +172,7 @@ def _instrument(self, **kwargs): __name__, __version__, meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", ) if "system.cpu.time" in self._config: diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py index 1e2f0e5162..dfa4b217df 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py @@ -236,10 +236,20 @@ def _instrument(self, **kwargs): process lifetime. """ tracer_provider = kwargs.get("tracer_provider") - tracer = trace.get_tracer(__name__, __version__, tracer_provider) + tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) meter_provider = kwargs.get("meter_provider") - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) client_histograms = _create_client_histograms(meter) server_histograms = _create_server_histograms(meter) diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/__init__.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/__init__.py index 0b1ae4a29e..7988daf130 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/__init__.py @@ -95,7 +95,12 @@ def _instrument(self, **kwargs): """ tracer_provider = kwargs.get("tracer_provider") # pylint: disable=attribute-defined-outside-init - self._tracer = trace.get_tracer(__name__, __version__, tracer_provider) + self._tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) self.capture_parameters = kwargs.get("capture_parameters", False) if TORTOISE_SQLITE_SUPPORT: funcs = [ diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py index cdd35a0bad..da31bf99fa 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py @@ -137,10 +137,20 @@ def _instrument(self, **kwargs): list of regexes used to exclude URLs from tracking """ tracer_provider = kwargs.get("tracer_provider") - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) excluded_urls = kwargs.get("excluded_urls") meter_provider = kwargs.get("meter_provider") - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) histograms = _create_client_histograms(meter) diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py index d3016ea5ee..45bab7454d 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py @@ -163,12 +163,22 @@ def _instrument(self, **kwargs): list of regexes used to exclude URLs from tracking """ tracer_provider = kwargs.get("tracer_provider") - tracer = get_tracer(__name__, __version__, tracer_provider) + tracer = get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) excluded_urls = kwargs.get("excluded_urls") meter_provider = kwargs.get("meter_provider") - meter = get_meter(__name__, __version__, meter_provider) + meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_DURATION, diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py index 7ba7e2731b..27e1b81269 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py @@ -138,6 +138,17 @@ def test_basic_https_success_using_connection_pool(self): self.assert_success_span(response, self.HTTPS_URL) + def test_schema_url(self): + pool = urllib3.HTTPSConnectionPool("mock") + response = pool.request("GET", "/status/200") + + self.assertEqual(b"Hello!", response.data) + span = self.assert_span() + self.assertEqual( + span.instrumentation_info.schema_url, + "https://opentelemetry.io/schemas/1.11.0", + ) + def test_basic_not_found(self): url_404 = "http://mock/status/404" httpretty.register_uri(httpretty.GET, url_404, status=404) diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py index 2fd4cb2c5c..787b920d7c 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_metrics.py @@ -155,6 +155,20 @@ def test_str_request_body_size_metrics(self): ], ) + def test_schema_url(self): + self.pool.request("POST", self.HTTP_URL, body="foobar") + + resource_metrics = ( + self.memory_metrics_reader.get_metrics_data().resource_metrics + ) + + for metrics in resource_metrics: + for scope_metrics in metrics.scope_metrics: + self.assertEqual( + scope_metrics.scope.schema_url, + "https://opentelemetry.io/schemas/1.11.0", + ) + def test_bytes_request_body_size_metrics(self): self.pool.request("POST", self.HTTP_URL, body=b"foobar") diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py index 35e217264d..87c73cc737 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -302,7 +302,9 @@ def collect_request_attributes(environ): """ result = { - SpanAttributes.HTTP_METHOD: sanitize_method(environ.get("REQUEST_METHOD")), + SpanAttributes.HTTP_METHOD: sanitize_method( + environ.get("REQUEST_METHOD") + ), SpanAttributes.HTTP_SERVER_NAME: environ.get("SERVER_NAME"), SpanAttributes.HTTP_SCHEME: environ.get("wsgi.url_scheme"), } @@ -490,8 +492,18 @@ def __init__( meter_provider=None, ): self.wsgi = wsgi - self.tracer = trace.get_tracer(__name__, __version__, tracer_provider) - self.meter = get_meter(__name__, __version__, meter_provider) + self.tracer = trace.get_tracer( + __name__, + __version__, + tracer_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) + self.meter = get_meter( + __name__, + __version__, + meter_provider, + schema_url="https://opentelemetry.io/schemas/1.11.0", + ) self.duration_histogram = self.meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index 6aef096218..bc78a787ca 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -286,22 +286,26 @@ def test_wsgi_metrics(self): self.assertTrue(number_data_point_seen and histogram_data_point_seen) def test_nonstandard_http_method(self): - self.environ["REQUEST_METHOD"]= "NONSTANDARD" + self.environ["REQUEST_METHOD"] = "NONSTANDARD" app = otel_wsgi.OpenTelemetryMiddleware(simple_wsgi) response = app(self.environ, self.start_response) - self.validate_response(response, span_name="UNKNOWN /", http_method="UNKNOWN") + self.validate_response( + response, span_name="UNKNOWN /", http_method="UNKNOWN" + ) @mock.patch.dict( - "os.environ", + "os.environ", { OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS: "1", }, ) def test_nonstandard_http_method_allowed(self): - self.environ["REQUEST_METHOD"]= "NONSTANDARD" + self.environ["REQUEST_METHOD"] = "NONSTANDARD" app = otel_wsgi.OpenTelemetryMiddleware(simple_wsgi) response = app(self.environ, self.start_response) - self.validate_response(response, span_name="NONSTANDARD /", http_method="NONSTANDARD") + self.validate_response( + response, span_name="NONSTANDARD /", http_method="NONSTANDARD" + ) def test_default_span_name_missing_path_info(self): """Test that default span_names with missing path info.""" diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index 11b04ebff3..d5da611bc2 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -47,17 +47,25 @@ ResourceAttributes.SERVICE_INSTANCE_ID, ] + class AzureVMResourceDetector(ResourceDetector): # pylint: disable=no-self-use def detect(self) -> "Resource": attributes = {} - metadata_json = _AzureVMMetadataServiceRequestor().get_azure_vm_metadata() + metadata_json = ( + _AzureVMMetadataServiceRequestor().get_azure_vm_metadata() + ) if not metadata_json: return Resource(attributes) for attribute_key in EXPECTED_AZURE_AMS_ATTRIBUTES: - attributes[attribute_key] = _AzureVMMetadataServiceRequestor().get_attribute_from_metadata(metadata_json, attribute_key) + attributes[ + attribute_key + ] = _AzureVMMetadataServiceRequestor().get_attribute_from_metadata( + metadata_json, attribute_key + ) return Resource(attributes) + class _AzureVMMetadataServiceRequestor: def get_azure_vm_metadata(self): request = Request(_AZURE_VM_METADATA_ENDPOINT) @@ -86,8 +94,10 @@ def get_attribute_from_metadata(self, metadata_json, attribute_key): ams_value = metadata_json["location"] elif attribute_key == ResourceAttributes.CLOUD_RESOURCE_ID: ams_value = metadata_json["resourceId"] - elif attribute_key == ResourceAttributes.HOST_ID or \ - attribute_key == ResourceAttributes.SERVICE_INSTANCE_ID: + elif ( + attribute_key == ResourceAttributes.HOST_ID + or attribute_key == ResourceAttributes.SERVICE_INSTANCE_ID + ): ams_value = metadata_json["vmId"] elif attribute_key == ResourceAttributes.HOST_NAME: ams_value = metadata_json["name"] diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py index f5d6a0dd3d..209df39134 100644 --- a/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py +++ b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py @@ -28,17 +28,22 @@ TEST_WEBSITE_RESOURCE_GROUP = "TEST_WEBSITE_RESOURCE_GROUP" TEST_WEBSITE_OWNER_NAME = "TEST_WEBSITE_OWNER_NAME" + class TestAzureAppServiceResourceDetector(unittest.TestCase): - @patch.dict("os.environ", { - "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, - "REGION_NAME": TEST_REGION_NAME, - "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, - "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, - "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, - "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, - "WEBSITE_RESOURCE_GROUP": TEST_WEBSITE_RESOURCE_GROUP, - "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, - }, clear=True) + @patch.dict( + "os.environ", + { + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_RESOURCE_GROUP": TEST_WEBSITE_RESOURCE_GROUP, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, + clear=True, + ) def test_on_app_service(self): resource = AzureAppServiceResourceDetector().detect() attributes = resource.attributes @@ -46,24 +51,36 @@ def test_on_app_service(self): self.assertEqual(attributes["cloud.provider"], "azure") self.assertEqual(attributes["cloud.platform"], "azure_app_service") - self.assertEqual(attributes["cloud.resource_id"], \ - f"/subscriptions/{TEST_WEBSITE_OWNER_NAME}/resourceGroups/{TEST_WEBSITE_RESOURCE_GROUP}/providers/Microsoft.Web/sites/{TEST_WEBSITE_SITE_NAME}") + self.assertEqual( + attributes["cloud.resource_id"], + f"/subscriptions/{TEST_WEBSITE_OWNER_NAME}/resourceGroups/{TEST_WEBSITE_RESOURCE_GROUP}/providers/Microsoft.Web/sites/{TEST_WEBSITE_SITE_NAME}", + ) self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) - self.assertEqual(attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME) + self.assertEqual( + attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME + ) self.assertEqual(attributes["host.id"], TEST_WEBSITE_HOSTNAME) - self.assertEqual(attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID) - self.assertEqual(attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME) + self.assertEqual( + attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID + ) + self.assertEqual( + attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME + ) - @patch.dict("os.environ", { - "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, - "REGION_NAME": TEST_REGION_NAME, - "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, - "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, - "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, - "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, - "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, - }, clear=True) + @patch.dict( + "os.environ", + { + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, + clear=True, + ) def test_on_app_service_no_resource_group(self): resource = AzureAppServiceResourceDetector().detect() attributes = resource.attributes @@ -74,20 +91,30 @@ def test_on_app_service_no_resource_group(self): self.assertTrue("cloud.resource_id" not in attributes) self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) - self.assertEqual(attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME) + self.assertEqual( + attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME + ) self.assertEqual(attributes["host.id"], TEST_WEBSITE_HOSTNAME) - self.assertEqual(attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID) - self.assertEqual(attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME) + self.assertEqual( + attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID + ) + self.assertEqual( + attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME + ) - @patch.dict("os.environ", { - "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, - "REGION_NAME": TEST_REGION_NAME, - "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, - "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, - "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, - "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, - "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, - }, clear=True) + @patch.dict( + "os.environ", + { + "WEBSITE_SITE_NAME": TEST_WEBSITE_SITE_NAME, + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, + clear=True, + ) def test_on_app_service_no_owner(self): resource = AzureAppServiceResourceDetector().detect() attributes = resource.attributes @@ -98,19 +125,29 @@ def test_on_app_service_no_owner(self): self.assertTrue("cloud.resource_id" not in attributes) self.assertEqual(attributes["cloud.region"], TEST_REGION_NAME) - self.assertEqual(attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME) + self.assertEqual( + attributes["deployment.environment"], TEST_WEBSITE_SLOT_NAME + ) self.assertEqual(attributes["host.id"], TEST_WEBSITE_HOSTNAME) - self.assertEqual(attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID) - self.assertEqual(attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME) + self.assertEqual( + attributes["service.instance.id"], TEST_WEBSITE_INSTANCE_ID + ) + self.assertEqual( + attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME + ) - @patch.dict("os.environ", { - "REGION_NAME": TEST_REGION_NAME, - "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, - "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, - "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, - "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, - "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, - }, clear=True) + @patch.dict( + "os.environ", + { + "REGION_NAME": TEST_REGION_NAME, + "WEBSITE_SLOT_NAME": TEST_WEBSITE_SLOT_NAME, + "WEBSITE_HOSTNAME": TEST_WEBSITE_HOSTNAME, + "WEBSITE_INSTANCE_ID": TEST_WEBSITE_INSTANCE_ID, + "WEBSITE_HOME_STAMPNAME": TEST_WEBSITE_HOME_STAMPNAME, + "WEBSITE_OWNER_NAME": TEST_WEBSITE_OWNER_NAME, + }, + clear=True, + ) def test_off_app_service(self): resource = AzureAppServiceResourceDetector().detect() self.assertEqual(resource.attributes, {}) diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py index 0531fa02b1..450b2890da 100644 --- a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py +++ b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py @@ -175,7 +175,7 @@ "zone": "1" } """ -WINDOWS_JSON =""" +WINDOWS_JSON = """ { "additionalCapabilities": { "hibernationEnabled": "false" @@ -370,7 +370,9 @@ def test_linux(self, mock_urlopen): mock_open.read.return_value = LINUX_JSON attributes = AzureVMResourceDetector().detect().attributes for attribute_key in LINUX_ATTRIBUTES: - self.assertEqual(attributes[attribute_key], LINUX_ATTRIBUTES[attribute_key]) + self.assertEqual( + attributes[attribute_key], LINUX_ATTRIBUTES[attribute_key] + ) @patch("opentelemetry.resource.detector.azure.vm.urlopen") def test_windows(self, mock_urlopen): @@ -379,4 +381,6 @@ def test_windows(self, mock_urlopen): mock_open.read.return_value = WINDOWS_JSON attributes = AzureVMResourceDetector().detect().attributes for attribute_key in WINDOWS_ATTRIBUTES: - self.assertEqual(attributes[attribute_key], WINDOWS_ATTRIBUTES[attribute_key]) + self.assertEqual( + attributes[attribute_key], WINDOWS_ATTRIBUTES[attribute_key] + ) diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py index 4f4a5d0353..054ade6d27 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py @@ -190,16 +190,32 @@ def normalise_response_header_name(header: str) -> str: key = header.lower().replace("-", "_") return f"http.response.header.{key}" + def sanitize_method(method: Optional[str]) -> Optional[str]: if method is None: return None method = method.upper() - if (environ.get(OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS) or + if ( + environ.get(OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS) + or # Based on https://www.rfc-editor.org/rfc/rfc7231#section-4.1 and https://www.rfc-editor.org/rfc/rfc5789#section-2. - method in ["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]): + method + in [ + "GET", + "HEAD", + "POST", + "PUT", + "DELETE", + "CONNECT", + "OPTIONS", + "TRACE", + "PATCH", + ] + ): return method return "UNKNOWN" + def get_custom_headers(env_var: str) -> List[str]: custom_headers = environ.get(env_var, []) if custom_headers: diff --git a/util/opentelemetry-util-http/tests/test_sanitize_method.py b/util/opentelemetry-util-http/tests/test_sanitize_method.py index a488ef589e..b4095324a6 100644 --- a/util/opentelemetry-util-http/tests/test_sanitize_method.py +++ b/util/opentelemetry-util-http/tests/test_sanitize_method.py @@ -20,6 +20,7 @@ sanitize_method, ) + class TestSanitizeMethod(unittest.TestCase): def test_standard_method_uppercase(self): method = sanitize_method("GET") @@ -34,7 +35,7 @@ def test_nonstandard_method(self): self.assertEqual(method, "NONSTANDARD") @patch.dict( - "os.environ", + "os.environ", { OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS: "1", }, From 3b9d6264e2d305f6c049769174ee24ed595bf0bf Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:06:08 -0300 Subject: [PATCH 065/200] Update version to 1.22.0.dev/0.43b0.dev (#2031) Co-authored-by: Diego Hurtado --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + _template/version.py | 2 +- eachdist.ini | 4 +- .../prometheus_remote_write/version.py | 2 +- .../pyproject.toml | 2 +- .../exporter/richconsole/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/aio_pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_client/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_server/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/aiopg/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/asgi/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncpg/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aws_lambda/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto3sqs/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/botocore/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/cassandra/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/celery/version.py | 2 +- .../confluent_kafka/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/dbapi/version.py | 2 +- .../pyproject.toml | 12 +-- .../instrumentation/django/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/elasticsearch/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/falcon/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/fastapi/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/flask/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/grpc/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/httpx/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/jinja2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/kafka/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/logging/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysql/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysqlclient/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/psycopg2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymemcache/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymongo/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymysql/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/pyramid/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/redis/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/remoulade/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/requests/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sklearn/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlalchemy/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/sqlite3/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/starlette/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/system_metrics/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/tornado/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/tortoiseorm/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib3/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/wsgi/version.py | 2 +- .../pyproject.toml | 90 ++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 96 +++++++++---------- .../opentelemetry/instrumentation/version.py | 2 +- .../propagators/ot_trace/version.py | 2 +- .../resource/detector/container/version.py | 2 +- .../src/opentelemetry/util/http/version.py | 2 +- 105 files changed, 297 insertions(+), 295 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb1eecbf34..64c39745f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: d054dff47d2da663a39b9656d106c3d15f344269 + CORE_REPO_SHA: 9831afaff5b4d371fd9a14266ab47884546bd971 jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c885d977e..7e9b4fdf9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## Version 1.21.0/0.42b0 (2023-11-01) + - `opentelemetry-instrumentation-aiohttp-server` Add instrumentor and auto instrumentation support for aiohttp-server ([#1800](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800)) diff --git a/_template/version.py b/_template/version.py index c2996671d6..2e4aa8c751 100644 --- a/_template/version.py +++ b/_template/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/eachdist.ini b/eachdist.ini index dacd4fc42f..8a5e1edfbe 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.21.0.dev +version=1.22.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.42b0.dev +version=0.43b0.dev packages= all diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py index c2996671d6..2e4aa8c751 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index 202dda7a51..b2e7c7fc28 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "rich>=10.0.0", ] diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py index c2996671d6..2e4aa8c751 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index af57ebe6e7..ee87d4303b 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aio-pika[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index c466977377..d35b3326fa 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py index e9ca2a1777..0d568a8987 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index 77bfa08b11..bc3372bfc6 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 024f707d89..cddbf583ca 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-dbapi == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-dbapi == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,8 +37,8 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index 60f15e9ba7..2813274ace 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -27,9 +27,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asgi[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 41a7e3ef3c..17be9fd807 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asyncpg[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index b632297922..f1c17410f8 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -22,15 +22,15 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 125f311045..559fdc5cac 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ test = [ "opentelemetry-instrumentation-boto[instruments]", "markupsafe==2.0.1", "moto~=2.0", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 5a91c1d206..21628ef70c 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-boto3sqs[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index d78756778d..df0d9a8939 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", ] @@ -39,7 +39,7 @@ test = [ "opentelemetry-instrumentation-botocore[instruments]", "markupsafe==2.0.1", "moto[all] ~= 2.2.6", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index 9abb17598f..a9f6b76310 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-cassandra[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index 2c0de681e1..ff39e54d8f 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-celery[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "pytest", ] diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index 5f9df3983e..2f866514c8 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py index 084725a38e..633040fa58 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index e235d6e6a9..d27e4a400c 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -26,22 +26,22 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-wsgi == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-wsgi == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.42b0.dev", + "opentelemetry-instrumentation-asgi == 0.43b0.dev", ] instruments = [ "django >= 1.10", ] test = [ "opentelemetry-instrumentation-django[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index bee1d44d2a..0d1bb6adcc 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-elasticsearch[instruments]", "elasticsearch-dsl >= 2.0", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index b6c482ed1f..0d5114b4eb 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-wsgi == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-wsgi == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", "packaging >= 20.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-falcon[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "parameterized == 0.7.4", ] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 4938baaffb..7abead865e 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-asgi == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-asgi == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-fastapi[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index e6c7851f7e..abb9f7289d 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-wsgi == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-wsgi == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", "packaging >= 21.0", ] @@ -41,7 +41,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-flask[instruments]", "markupsafe==2.1.2", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 37023eae4d..1fe1b6bea7 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-grpc[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "protobuf ~= 3.13", ] diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index a50b2f4754..3d8eebfa9b 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-httpx[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index c0f0c51d37..8283b16c98 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-jinja2[instruments]", "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index 9fbde3057d..23d9338b66 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-kafka-python[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 76bde24c55..93fc900e1f 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,13 +25,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py index 084725a38e..633040fa58 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index e155147d5c..370dd9213f 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-dbapi == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-dbapi == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysql[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index 72d4bc67cc..4bee91321a 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-dbapi == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-dbapi == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysqlclient[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index 8ee033e58d..8d723bb0ea 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pika[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index d709c2bad1..df917b8917 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-dbapi == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-dbapi == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-psycopg2[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index f6b61bd4d0..067ad618aa 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymemcache[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index 2c40ed26bb..5962545901 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymongo[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 62404ed4f1..7e36fa65bd 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-dbapi == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-dbapi == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymysql[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 59483c972b..348d73abd7 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-wsgi == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-wsgi == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pyramid[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "werkzeug == 0.16.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index 3ae0609147..3f32ae2f6d 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "wrapt >= 1.12.1", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-redis[instruments]", "opentelemetry-sdk ~= 1.3", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index 2a3a596700..0c6995a752 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-remoulade[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "opentelemetry-sdk ~= 1.10" ] diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index 184bd1ca7e..075bb1f571 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-requests[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index 85a145f662..c4864cbeb8 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-sklearn[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index e9ca2a1777..0d568a8987 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 3b96607b41..a1ca23779e 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", "packaging >= 21.0", "wrapt >= 1.11.2", ] diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index d7f6d6aae9..b67bb1d695 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -26,14 +26,14 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-dbapi == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-dbapi == 0.43b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py index 084725a38e..633040fa58 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index 4c884bcc5e..a35920530c 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-instrumentation-asgi == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation-asgi == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-starlette[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 3c9f363a4c..227069f584 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-system-metrics[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index 1a286e5114..191c30d980 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tornado[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", "http-server-mock" ] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 42e3573806..695bb6a219 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tortoiseorm[instruments]", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index 56bfb5e869..222f229a2d 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -26,16 +26,16 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] instruments = [] test = [ "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py index 084725a38e..633040fa58 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index db4d485d8e..965df9ea77 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-urllib3[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 50860fb0d6..70afad641c 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", - "opentelemetry-semantic-conventions == 0.42b0.dev", - "opentelemetry-util-http == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-util-http == 0.43b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.42b0.dev", + "opentelemetry-test-utils == 0.43b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py index c2996671d6..2e4aa8c751 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 008e5fb281..b4e1db321e 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -29,51 +29,51 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.42b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.42b0.dev", - "opentelemetry-instrumentation-aiohttp-server==0.42b0.dev", - "opentelemetry-instrumentation-aiopg==0.42b0.dev", - "opentelemetry-instrumentation-asgi==0.42b0.dev", - "opentelemetry-instrumentation-asyncpg==0.42b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.42b0.dev", - "opentelemetry-instrumentation-boto==0.42b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.42b0.dev", - "opentelemetry-instrumentation-botocore==0.42b0.dev", - "opentelemetry-instrumentation-cassandra==0.42b0.dev", - "opentelemetry-instrumentation-celery==0.42b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.42b0.dev", - "opentelemetry-instrumentation-dbapi==0.42b0.dev", - "opentelemetry-instrumentation-django==0.42b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.42b0.dev", - "opentelemetry-instrumentation-falcon==0.42b0.dev", - "opentelemetry-instrumentation-fastapi==0.42b0.dev", - "opentelemetry-instrumentation-flask==0.42b0.dev", - "opentelemetry-instrumentation-grpc==0.42b0.dev", - "opentelemetry-instrumentation-httpx==0.42b0.dev", - "opentelemetry-instrumentation-jinja2==0.42b0.dev", - "opentelemetry-instrumentation-kafka-python==0.42b0.dev", - "opentelemetry-instrumentation-logging==0.42b0.dev", - "opentelemetry-instrumentation-mysql==0.42b0.dev", - "opentelemetry-instrumentation-mysqlclient==0.42b0.dev", - "opentelemetry-instrumentation-pika==0.42b0.dev", - "opentelemetry-instrumentation-psycopg2==0.42b0.dev", - "opentelemetry-instrumentation-pymemcache==0.42b0.dev", - "opentelemetry-instrumentation-pymongo==0.42b0.dev", - "opentelemetry-instrumentation-pymysql==0.42b0.dev", - "opentelemetry-instrumentation-pyramid==0.42b0.dev", - "opentelemetry-instrumentation-redis==0.42b0.dev", - "opentelemetry-instrumentation-remoulade==0.42b0.dev", - "opentelemetry-instrumentation-requests==0.42b0.dev", - "opentelemetry-instrumentation-sklearn==0.42b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.42b0.dev", - "opentelemetry-instrumentation-sqlite3==0.42b0.dev", - "opentelemetry-instrumentation-starlette==0.42b0.dev", - "opentelemetry-instrumentation-system-metrics==0.42b0.dev", - "opentelemetry-instrumentation-tornado==0.42b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.42b0.dev", - "opentelemetry-instrumentation-urllib==0.42b0.dev", - "opentelemetry-instrumentation-urllib3==0.42b0.dev", - "opentelemetry-instrumentation-wsgi==0.42b0.dev", + "opentelemetry-instrumentation-aio-pika==0.43b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.43b0.dev", + "opentelemetry-instrumentation-aiohttp-server==0.43b0.dev", + "opentelemetry-instrumentation-aiopg==0.43b0.dev", + "opentelemetry-instrumentation-asgi==0.43b0.dev", + "opentelemetry-instrumentation-asyncpg==0.43b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.43b0.dev", + "opentelemetry-instrumentation-boto==0.43b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.43b0.dev", + "opentelemetry-instrumentation-botocore==0.43b0.dev", + "opentelemetry-instrumentation-cassandra==0.43b0.dev", + "opentelemetry-instrumentation-celery==0.43b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.43b0.dev", + "opentelemetry-instrumentation-dbapi==0.43b0.dev", + "opentelemetry-instrumentation-django==0.43b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.43b0.dev", + "opentelemetry-instrumentation-falcon==0.43b0.dev", + "opentelemetry-instrumentation-fastapi==0.43b0.dev", + "opentelemetry-instrumentation-flask==0.43b0.dev", + "opentelemetry-instrumentation-grpc==0.43b0.dev", + "opentelemetry-instrumentation-httpx==0.43b0.dev", + "opentelemetry-instrumentation-jinja2==0.43b0.dev", + "opentelemetry-instrumentation-kafka-python==0.43b0.dev", + "opentelemetry-instrumentation-logging==0.43b0.dev", + "opentelemetry-instrumentation-mysql==0.43b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.43b0.dev", + "opentelemetry-instrumentation-pika==0.43b0.dev", + "opentelemetry-instrumentation-psycopg2==0.43b0.dev", + "opentelemetry-instrumentation-pymemcache==0.43b0.dev", + "opentelemetry-instrumentation-pymongo==0.43b0.dev", + "opentelemetry-instrumentation-pymysql==0.43b0.dev", + "opentelemetry-instrumentation-pyramid==0.43b0.dev", + "opentelemetry-instrumentation-redis==0.43b0.dev", + "opentelemetry-instrumentation-remoulade==0.43b0.dev", + "opentelemetry-instrumentation-requests==0.43b0.dev", + "opentelemetry-instrumentation-sklearn==0.43b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.43b0.dev", + "opentelemetry-instrumentation-sqlite3==0.43b0.dev", + "opentelemetry-instrumentation-starlette==0.43b0.dev", + "opentelemetry-instrumentation-system-metrics==0.43b0.dev", + "opentelemetry-instrumentation-tornado==0.43b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", + "opentelemetry-instrumentation-urllib==0.43b0.dev", + "opentelemetry-instrumentation-urllib3==0.43b0.dev", + "opentelemetry-instrumentation-wsgi==0.43b0.dev", ] [project.optional-dependencies] diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py index c2996671d6..2e4aa8c751 100644 --- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py +++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index 9898884319..6d5e2228bf 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -24,13 +24,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.42b0.dev", + "opentelemetry-instrumentation == 0.43b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.21.0.dev", + "opentelemetry-exporter-otlp == 1.22.0.dev", ] test = [] diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py index c2996671d6..2e4aa8c751 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/version.py +++ b/opentelemetry-distro/src/opentelemetry/distro/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index eb9eac8762..6e193539a8 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,178 +18,178 @@ libraries = { "aio_pika": { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.43b0.dev", }, "aiohttp": { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.43b0.dev", }, "aiohttp": { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.43b0.dev", }, "aiopg": { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.43b0.dev", }, "asgiref": { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.43b0.dev", }, "asyncpg": { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.43b0.dev", }, "boto": { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.43b0.dev", }, "boto3": { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.43b0.dev", }, "botocore": { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.43b0.dev", }, "cassandra-driver": { "library": "cassandra-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0.dev", }, "scylla-driver": { "library": "scylla-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0.dev", }, "celery": { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.43b0.dev", }, "confluent-kafka": { "library": "confluent-kafka >= 1.8.2, <= 2.2.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.43b0.dev", }, "django": { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.43b0.dev", }, "elasticsearch": { "library": "elasticsearch >= 2.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.43b0.dev", }, "falcon": { "library": "falcon >= 1.4.1, < 4.0.0", - "instrumentation": "opentelemetry-instrumentation-falcon==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.43b0.dev", }, "fastapi": { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.43b0.dev", }, "flask": { "library": "flask >= 1.0, < 3.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.43b0.dev", }, "werkzeug": { "library": "werkzeug < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.43b0.dev", }, "grpcio": { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.43b0.dev", }, "httpx": { "library": "httpx >= 0.18.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.43b0.dev", }, "jinja2": { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.43b0.dev", }, "kafka-python": { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.43b0.dev", }, "mysql-connector-python": { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.43b0.dev", }, "mysqlclient": { "library": "mysqlclient < 3", - "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.43b0.dev", }, "pika": { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.43b0.dev", }, "psycopg2": { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.43b0.dev", }, "pymemcache": { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.43b0.dev", }, "pymongo": { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.43b0.dev", }, "PyMySQL": { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.43b0.dev", }, "pyramid": { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.43b0.dev", }, "redis": { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.43b0.dev", }, "remoulade": { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.43b0.dev", }, "requests": { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.43b0.dev", }, "scikit-learn": { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.43b0.dev", }, "sqlalchemy": { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.43b0.dev", }, "starlette": { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.43b0.dev", }, "psutil": { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.43b0.dev", }, "tornado": { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.43b0.dev", }, "tortoise-orm": { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", }, "pydantic": { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", }, "urllib3": { "library": "urllib3 >= 1.0.0, < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.42b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.43b0.dev", }, } default_instrumentations = [ - "opentelemetry-instrumentation-aws-lambda==0.42b0.dev", - "opentelemetry-instrumentation-dbapi==0.42b0.dev", - "opentelemetry-instrumentation-logging==0.42b0.dev", - "opentelemetry-instrumentation-sqlite3==0.42b0.dev", - "opentelemetry-instrumentation-urllib==0.42b0.dev", - "opentelemetry-instrumentation-wsgi==0.42b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.43b0.dev", + "opentelemetry-instrumentation-dbapi==0.43b0.dev", + "opentelemetry-instrumentation-logging==0.43b0.dev", + "opentelemetry-instrumentation-sqlite3==0.43b0.dev", + "opentelemetry-instrumentation-urllib==0.43b0.dev", + "opentelemetry-instrumentation-wsgi==0.43b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index c2996671d6..2e4aa8c751 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py index c2996671d6..2e4aa8c751 100644 --- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py +++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py index c2996671d6..2e4aa8c751 100644 --- a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py index c2996671d6..2e4aa8c751 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.42b0.dev" +__version__ = "0.43b0.dev" From 46fc3ce638cdd62c68baa7bc19897ccc23c43711 Mon Sep 17 00:00:00 2001 From: siminn-arnorgj <106159316+siminn-arnorgj@users.noreply.github.com> Date: Wed, 8 Nov 2023 18:46:01 +0000 Subject: [PATCH 066/200] Exclude background task execution from root server span in ASGI middleware (#1952) --- CHANGELOG.md | 2 + .../instrumentation/asgi/__init__.py | 19 +- .../tests/test_asgi_middleware.py | 194 +++++++++++++++++- 3 files changed, 209 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e9b4fdf9d..50f591d950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1824)) - Fix sqlalchemy instrumentation wrap methods to accept sqlcommenter options ([#1873](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1873)) +- Exclude background task execution from root server span in ASGI middleware + ([#1952](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1952)) ### Added diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index 8d5aa4e2d2..ae47a5cb4f 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -576,7 +576,7 @@ async def __call__(self, scope, receive, send): if scope["type"] == "http": self.active_requests_counter.add(1, active_requests_count_attrs) try: - with trace.use_span(span, end_on_exit=True) as current_span: + with trace.use_span(span, end_on_exit=False) as current_span: if current_span.is_recording(): for key, value in attributes.items(): current_span.set_attribute(key, value) @@ -630,6 +630,8 @@ async def __call__(self, scope, receive, send): ) if token: context.detach(token) + if span.is_recording(): + span.end() # pylint: enable=too-many-branches @@ -653,8 +655,11 @@ async def otel_receive(): def _get_otel_send( self, server_span, server_span_name, scope, send, duration_attrs ): + expecting_trailers = False + @wraps(send) async def otel_send(message): + nonlocal expecting_trailers with self.tracer.start_as_current_span( " ".join((server_span_name, scope["type"], "send")) ) as send_span: @@ -668,6 +673,8 @@ async def otel_send(message): ] = status_code set_status_code(server_span, status_code) set_status_code(send_span, status_code) + + expecting_trailers = message.get("trailers", False) elif message["type"] == "websocket.send": set_status_code(server_span, 200) set_status_code(send_span, 200) @@ -703,5 +710,15 @@ async def otel_send(message): pass await send(message) + if ( + not expecting_trailers + and message["type"] == "http.response.body" + and not message.get("more_body", False) + ) or ( + expecting_trailers + and message["type"] == "http.response.trailers" + and not message.get("more_trailers", False) + ): + server_span.end() return otel_send diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 209acdf663..da7bc8ea74 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -16,6 +16,7 @@ import asyncio import sys +import time import unittest from timeit import default_timer from unittest import mock @@ -57,6 +58,8 @@ "http.server.request.size": _duration_attrs, } +_SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S = 0.01 + async def http_app(scope, receive, send): message = await receive() @@ -99,6 +102,108 @@ async def simple_asgi(scope, receive, send): await websocket_app(scope, receive, send) +async def long_response_asgi(scope, receive, send): + assert isinstance(scope, dict) + assert scope["type"] == "http" + message = await receive() + scope["headers"] = [(b"content-length", b"128")] + assert scope["type"] == "http" + if message.get("type") == "http.request": + await send( + { + "type": "http.response.start", + "status": 200, + "headers": [ + [b"Content-Type", b"text/plain"], + [b"content-length", b"1024"], + ], + } + ) + await send( + {"type": "http.response.body", "body": b"*", "more_body": True} + ) + await send( + {"type": "http.response.body", "body": b"*", "more_body": True} + ) + await send( + {"type": "http.response.body", "body": b"*", "more_body": True} + ) + await send( + {"type": "http.response.body", "body": b"*", "more_body": False} + ) + + +async def background_execution_asgi(scope, receive, send): + assert isinstance(scope, dict) + assert scope["type"] == "http" + message = await receive() + scope["headers"] = [(b"content-length", b"128")] + assert scope["type"] == "http" + if message.get("type") == "http.request": + await send( + { + "type": "http.response.start", + "status": 200, + "headers": [ + [b"Content-Type", b"text/plain"], + [b"content-length", b"1024"], + ], + } + ) + await send( + { + "type": "http.response.body", + "body": b"*", + } + ) + time.sleep(_SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S) + + +async def background_execution_trailers_asgi(scope, receive, send): + assert isinstance(scope, dict) + assert scope["type"] == "http" + message = await receive() + scope["headers"] = [(b"content-length", b"128")] + assert scope["type"] == "http" + if message.get("type") == "http.request": + await send( + { + "type": "http.response.start", + "status": 200, + "headers": [ + [b"Content-Type", b"text/plain"], + [b"content-length", b"1024"], + ], + "trailers": True, + } + ) + await send( + {"type": "http.response.body", "body": b"*", "more_body": True} + ) + await send( + {"type": "http.response.body", "body": b"*", "more_body": False} + ) + await send( + { + "type": "http.response.trailers", + "headers": [ + [b"trailer", b"test-trailer"], + ], + "more_trailers": True, + } + ) + await send( + { + "type": "http.response.trailers", + "headers": [ + [b"trailer", b"second-test-trailer"], + ], + "more_trailers": False, + } + ) + time.sleep(_SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S) + + async def error_asgi(scope, receive, send): assert isinstance(scope, dict) assert scope["type"] == "http" @@ -127,14 +232,19 @@ def validate_outputs(self, outputs, error=None, modifiers=None): # Ensure modifiers is a list modifiers = modifiers or [] # Check for expected outputs - self.assertEqual(len(outputs), 2) response_start = outputs[0] - response_body = outputs[1] + response_final_body = [ + output + for output in outputs + if output["type"] == "http.response.body" + ][-1] + self.assertEqual(response_start["type"], "http.response.start") - self.assertEqual(response_body["type"], "http.response.body") + self.assertEqual(response_final_body["type"], "http.response.body") + self.assertEqual(response_final_body.get("more_body", False), False) # Check http response body - self.assertEqual(response_body["body"], b"*") + self.assertEqual(response_final_body["body"], b"*") # Check http response start self.assertEqual(response_start["status"], 200) @@ -153,7 +263,6 @@ def validate_outputs(self, outputs, error=None, modifiers=None): # Check spans span_list = self.memory_exporter.get_finished_spans() - self.assertEqual(len(span_list), 4) expected = [ { "name": "GET / http receive", @@ -194,6 +303,7 @@ def validate_outputs(self, outputs, error=None, modifiers=None): for modifier in modifiers: expected = modifier(expected) # Check that output matches + self.assertEqual(len(span_list), len(expected)) for span, expected in zip(span_list, expected): self.assertEqual(span.name, expected["name"]) self.assertEqual(span.kind, expected["kind"]) @@ -232,6 +342,80 @@ def test_asgi_exc_info(self): outputs = self.get_all_output() self.validate_outputs(outputs, error=ValueError) + def test_long_response(self): + """Test that the server span is ended on the final response body message. + + If the server span is ended early then this test will fail due + to discrepancies in the expected list of spans and the emitted list of spans. + """ + app = otel_asgi.OpenTelemetryMiddleware(long_response_asgi) + self.seed_app(app) + self.send_default_request() + outputs = self.get_all_output() + + def add_more_body_spans(expected: list): + more_body_span = { + "name": "GET / http send", + "kind": trace_api.SpanKind.INTERNAL, + "attributes": {"type": "http.response.body"}, + } + extra_spans = [more_body_span] * 3 + expected[2:2] = extra_spans + return expected + + self.validate_outputs(outputs, modifiers=[add_more_body_spans]) + + def test_background_execution(self): + """Test that the server span is ended BEFORE the background task is finished.""" + app = otel_asgi.OpenTelemetryMiddleware(background_execution_asgi) + self.seed_app(app) + self.send_default_request() + outputs = self.get_all_output() + self.validate_outputs(outputs) + span_list = self.memory_exporter.get_finished_spans() + server_span = span_list[-1] + assert server_span.kind == SpanKind.SERVER + span_duration_nanos = server_span.end_time - server_span.start_time + self.assertLessEqual( + span_duration_nanos, + _SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S * 10**9, + ) + + def test_trailers(self): + """Test that trailers are emitted as expected and that the server span is ended + BEFORE the background task is finished.""" + app = otel_asgi.OpenTelemetryMiddleware( + background_execution_trailers_asgi + ) + self.seed_app(app) + self.send_default_request() + outputs = self.get_all_output() + + def add_body_and_trailer_span(expected: list): + body_span = { + "name": "GET / http send", + "kind": trace_api.SpanKind.INTERNAL, + "attributes": {"type": "http.response.body"}, + } + trailer_span = { + "name": "GET / http send", + "kind": trace_api.SpanKind.INTERNAL, + "attributes": {"type": "http.response.trailers"}, + } + expected[2:2] = [body_span] + expected[4:4] = [trailer_span] * 2 + return expected + + self.validate_outputs(outputs, modifiers=[add_body_and_trailer_span]) + span_list = self.memory_exporter.get_finished_spans() + server_span = span_list[-1] + assert server_span.kind == SpanKind.SERVER + span_duration_nanos = server_span.end_time - server_span.start_time + self.assertLessEqual( + span_duration_nanos, + _SIMULATED_BACKGROUND_TASK_EXECUTION_TIME_S * 10**9, + ) + def test_override_span_name(self): """Test that default span_names can be overwritten by our callback function.""" span_name = "Dymaxion" From c2f38940029ff10d97db1068e9a6c307032564be Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 9 Nov 2023 14:07:24 -0800 Subject: [PATCH 067/200] Fix contrib build (#2054) --- .../opentelemetry-instrumentation-botocore/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index df0d9a8939..702723015e 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -38,6 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-botocore[instruments]", "markupsafe==2.0.1", + "botocore ~= 1.0, < 1.31.81", "moto[all] ~= 2.2.6", "opentelemetry-test-utils == 0.43b0.dev", ] From 1e1162c2501820a8123a4161ffbdddf1a84a0a02 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 9 Nov 2023 14:42:26 -0800 Subject: [PATCH 068/200] Fix error in build for README in Cassandra instrumentation (#2045) --- .../opentelemetry-instrumentation-cassandra/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/README.rst b/instrumentation/opentelemetry-instrumentation-cassandra/README.rst index 36e7d6202e..dfd5fa07e6 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/README.rst +++ b/instrumentation/opentelemetry-instrumentation-cassandra/README.rst @@ -1,5 +1,5 @@ OpenTelemetry Cassandra Instrumentation -=================================== +======================================= |pypi| From 7166de673fa9dd7abc178bec3103d4adebb05e0d Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Thu, 9 Nov 2023 21:05:21 -0300 Subject: [PATCH 069/200] Copy change log updates from release/v1.21.x-0.42bx (#2049) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f591d950..b0ca452602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -## Version 1.21.0/0.42b0 (2023-11-01) +## Version 1.21.0/0.42b0 () - `opentelemetry-instrumentation-aiohttp-server` Add instrumentor and auto instrumentation support for aiohttp-server ([#1800](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800)) From b6d77f11467df9de3dfc4f947f29e3f7fc45a637 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 10 Nov 2023 09:48:32 -0800 Subject: [PATCH 070/200] Implement Otel semantic convention stability opt-in (#1987) --- CHANGELOG.md | 10 +++- .../instrumentation/instrumentor.py | 6 ++ .../opentelemetry/instrumentation/utils.py | 60 +++++++++++++++++++ 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ca452602..d4f1db1959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -## Version 1.21.0/0.42b0 () +### Added -- `opentelemetry-instrumentation-aiohttp-server` Add instrumentor and auto instrumentation support for aiohttp-server - ([#1800](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800)) +- `opentelemetry-instrumentation` Added Otel semantic convention opt-in mechanism + ([#1987](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1987)) + +## Version 1.21.0/0.42b0 (2023-11-01) ### Added +- `opentelemetry-instrumentation-aiohttp-server` Add instrumentor and auto instrumentation support for aiohttp-server + ([#1800](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1800)) - `opentelemetry-instrumentation-botocore` Include SNS topic ARN as a span attribute with name `messaging.destination.name` to uniquely identify the SNS topic ([#1995](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1995)) - `opentelemetry-instrumentation-system-metrics` Add support for collecting process metrics diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py index 7f05e7f30a..6c6f86fd51 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py @@ -25,6 +25,9 @@ DependencyConflict, get_dependency_conflicts, ) +from opentelemetry.instrumentation.utils import ( + _OpenTelemetrySemanticConventionStability, +) _LOG = getLogger(__name__) @@ -105,6 +108,9 @@ def instrument(self, **kwargs): _LOG.error(conflict) return None + # initialize semantic conventions opt-in if needed + _OpenTelemetrySemanticConventionStability._initialize() + result = self._instrument( # pylint: disable=assignment-from-no-return **kwargs ) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py index 35a55a1279..e4f9b37c37 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py @@ -12,7 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os +import threading import urllib.parse +from enum import Enum from re import escape, sub from typing import Dict, Sequence @@ -152,3 +155,60 @@ def _python_path_without_directory(python_path, directory, path_separator): "", python_path, ) + + +_OTEL_SEMCONV_STABILITY_OPT_IN_KEY = "OTEL_SEMCONV_STABILITY_OPT_IN" + + +class _OpenTelemetryStabilitySignalType: + HTTP = "http" + + +class _OpenTelemetryStabilityMode(Enum): + # http - emit the new, stable HTTP and networking conventions ONLY + HTTP = "http" + # http/dup - emit both the old and the stable HTTP and networking conventions + HTTP_DUP = "http/dup" + # default - continue emitting old experimental HTTP and networking conventions + DEFAULT = "default" + + +class _OpenTelemetrySemanticConventionStability: + _initialized = False + _lock = threading.Lock() + _OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING = {} + + @classmethod + def _initialize(cls): + with _OpenTelemetrySemanticConventionStability._lock: + if not _OpenTelemetrySemanticConventionStability._initialized: + # Users can pass in comma delimited string for opt-in options + # Only values for http stability are supported for now + opt_in = os.environ.get(_OTEL_SEMCONV_STABILITY_OPT_IN_KEY, "") + opt_in_list = [] + if opt_in: + opt_in_list = [s.strip() for s in opt_in.split(",")] + http_opt_in = _OpenTelemetryStabilityMode.DEFAULT + if opt_in_list: + # Process http opt-in + # http/dup takes priority over http + if ( + _OpenTelemetryStabilityMode.HTTP_DUP.value + in opt_in_list + ): + http_opt_in = _OpenTelemetryStabilityMode.HTTP_DUP + elif _OpenTelemetryStabilityMode.HTTP.value in opt_in_list: + http_opt_in = _OpenTelemetryStabilityMode.HTTP + _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[ + _OpenTelemetryStabilitySignalType.HTTP + ] = http_opt_in + _OpenTelemetrySemanticConventionStability._initialized = True + + @classmethod + def _get_opentelemetry_stability_opt_in( + type: _OpenTelemetryStabilitySignalType, + ) -> _OpenTelemetryStabilityMode: + with _OpenTelemetrySemanticConventionStability._lock: + return _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING.get( + type, _OpenTelemetryStabilityMode.DEFAULT + ) From 6f6c28da45fbf2327e7a7af0675f4de3e66b5634 Mon Sep 17 00:00:00 2001 From: Rahul Kumar Date: Fri, 17 Nov 2023 00:48:51 +0530 Subject: [PATCH 071/200] Added support for pypy3 system metrics (#2062) * Added support for pypy3 system metrics Co-authored-by: Suryanarayana Peri Signed-off-by: Rahul Kumar * Change in if condition to log warn message for pypy Co-authored-by: Suryanarayana Peri Signed-off-by: Rahul Kumar * Added logger to else block if pypy Co-authored-by: Suryanarayana Peri Signed-off-by: Rahul Kumar * Reverting the changes Co-authored-by: Suryanarayana Peri Signed-off-by: Rahul Kumar * Changes requested by external reviewer Co-authored-by: Suryanarayana Peri Signed-off-by: Rahul Kumar --------- Signed-off-by: Rahul Kumar Co-authored-by: Suryanarayana Peri --- CHANGELOG.md | 3 +++ .../system_metrics/__init__.py | 22 +++++++++++++----- .../tests/test_system_metrics.py | 23 ++++++++++++++----- tox.ini | 2 +- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4f1db1959..6e74c017c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1394,6 +1394,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-ext-wsgi` Updates for core library changes - `opentelemetry-ext-http-requests` Updates for core library changes +- `Added support for PyPy3` Initial release +## [#1033](https://github.com/open-telemetryopentelemetry-python-contrib/issues/1033) + ## Version 0.1a0 (2019-09-30) ### Added diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py index e97685ba74..56d07f4e63 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py @@ -77,6 +77,7 @@ import gc import os +import logging import threading from platform import python_implementation from typing import Collection, Dict, Iterable, List, Optional @@ -91,6 +92,9 @@ from opentelemetry.metrics import CallbackOptions, Observation, get_meter from opentelemetry.sdk.util import get_dict_as_key +_logger = logging.getLogger(__name__) + + _DEFAULT_CONFIG = { "system.cpu.time": ["idle", "user", "system", "irq"], "system.cpu.utilization": ["idle", "user", "system", "irq"], @@ -352,12 +356,18 @@ def _instrument(self, **kwargs): ) if "process.runtime.gc_count" in self._config: - self._meter.create_observable_counter( - name=f"process.runtime.{self._python_implementation}.gc_count", - callbacks=[self._get_runtime_gc_count], - description=f"Runtime {self._python_implementation} GC count", - unit="bytes", - ) + if self._python_implementation == "pypy": + _logger.warning( + "The process.runtime.gc_count metric won't be collected because the interpreter is PyPy" + ) + else: + self._meter.create_observable_counter( + name=f"process.runtime.{self._python_implementation}.gc_count", + callbacks=[self._get_runtime_gc_count], + description=f"Runtime {self._python_implementation} GC count", + unit="bytes", + ) + if "process.runtime.thread_count" in self._config: self._meter.create_observable_up_down_counter( diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py b/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py index e28c437009..064a1534a6 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py @@ -16,7 +16,7 @@ from collections import namedtuple from platform import python_implementation -from unittest import mock +from unittest import mock, skipIf from opentelemetry.sdk.metrics import MeterProvider from opentelemetry.sdk.metrics.export import InMemoryMetricReader @@ -97,7 +97,6 @@ def test_system_metrics_instrument(self): for scope_metrics in resource_metrics.scope_metrics: for metric in scope_metrics.metrics: metric_names.append(metric.name) - self.assertEqual(len(metric_names), 21) observer_names = [ "system.cpu.time", @@ -117,11 +116,16 @@ def test_system_metrics_instrument(self): "system.thread_count", f"process.runtime.{self.implementation}.memory", f"process.runtime.{self.implementation}.cpu_time", - f"process.runtime.{self.implementation}.gc_count", f"process.runtime.{self.implementation}.thread_count", f"process.runtime.{self.implementation}.context_switches", f"process.runtime.{self.implementation}.cpu.utilization", ] + + if self.implementation == "pypy": + self.assertEqual(len(metric_names), 20) + else: + self.assertEqual(len(metric_names), 21) + observer_names.append(f"process.runtime.{self.implementation}.gc_count",) for observer in metric_names: self.assertIn(observer, observer_names) @@ -131,11 +135,13 @@ def test_runtime_metrics_instrument(self): runtime_config = { "process.runtime.memory": ["rss", "vms"], "process.runtime.cpu.time": ["user", "system"], - "process.runtime.gc_count": None, "process.runtime.thread_count": None, "process.runtime.cpu.utilization": None, "process.runtime.context_switches": ["involuntary", "voluntary"], } + + if self.implementation != "pypy": + runtime_config["process.runtime.gc_count"] = None reader = InMemoryMetricReader() meter_provider = MeterProvider(metric_readers=[reader]) @@ -147,17 +153,21 @@ def test_runtime_metrics_instrument(self): for scope_metrics in resource_metrics.scope_metrics: for metric in scope_metrics.metrics: metric_names.append(metric.name) - self.assertEqual(len(metric_names), 6) observer_names = [ f"process.runtime.{self.implementation}.memory", f"process.runtime.{self.implementation}.cpu_time", - f"process.runtime.{self.implementation}.gc_count", f"process.runtime.{self.implementation}.thread_count", f"process.runtime.{self.implementation}.context_switches", f"process.runtime.{self.implementation}.cpu.utilization", ] + if self.implementation == "pypy": + self.assertEqual(len(metric_names), 5) + else: + self.assertEqual(len(metric_names), 6) + observer_names.append(f"process.runtime.{self.implementation}.gc_count") + for observer in metric_names: self.assertIn(observer, observer_names) observer_names.remove(observer) @@ -781,6 +791,7 @@ def test_runtime_cpu_time(self, mock_process_cpu_times): ) @mock.patch("gc.get_count") + @skipIf(python_implementation().lower() == "pypy", "not supported for pypy") def test_runtime_get_count(self, mock_gc_get_count): mock_gc_get_count.configure_mock(**{"return_value": (1, 2, 3)}) diff --git a/tox.ini b/tox.ini index 2eaef92404..2527613c54 100644 --- a/tox.ini +++ b/tox.ini @@ -194,7 +194,7 @@ envlist = ; opentelemetry-instrumentation-system-metrics py3{6,7,8,9,10,11}-test-instrumentation-system-metrics - ; instrumentation-system-metrics intentionally excluded from pypy3 + pypy3-test-instrumentation-system-metrics ; opentelemetry-instrumentation-tornado py3{7,8,9,10,11}-test-instrumentation-tornado From f34771618ca92299a26a9a72a2d31ebc6802a174 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Fri, 17 Nov 2023 02:54:56 -0600 Subject: [PATCH 072/200] Don't collect system.network.connections due to limitation in psutil causing exceptions (#2008) * Don't collect system.network.connections due to limitation in psutil causing exceptions * add changelog --------- Co-authored-by: Srikanth Chekuri Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 ++ .../opentelemetry/instrumentation/system_metrics/__init__.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e74c017c4..ccbb325e44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1980](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980)) - `opentelemetry-resource-detector-azure` Using new Cloud Resource ID attribute. ([#1976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1976)) +- Do not collect `system.network.connections` by default on macOS which was causing exceptions in metrics collection. + ([#2008](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2008)) ## Version 1.20.0/0.41b0 (2023-09-01) diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py index 56d07f4e63..d84cc94d01 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py @@ -77,6 +77,7 @@ import gc import os +import sys import logging import threading from platform import python_implementation @@ -119,6 +120,10 @@ "process.runtime.context_switches": ["involuntary", "voluntary"], } +if sys.platform == "darwin": + # see https://github.com/giampaolo/psutil/issues/1219 + _DEFAULT_CONFIG.pop("system.network.connections") + class SystemMetricsInstrumentor(BaseInstrumentor): def __init__( From 9afaf26b3a5753f94cd04099bc00b228dd3d9dd6 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Sun, 19 Nov 2023 01:20:41 -0500 Subject: [PATCH 073/200] urllib/urllib3 - set metric descriptions per semantic conventions (#1959) * Set metric descriptions per semantic conventions * Set metric descriptions per semantic conventions * fix spelling --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 5 +++++ .../src/opentelemetry/instrumentation/urllib/__init__.py | 6 +++--- .../src/opentelemetry/instrumentation/urllib3/__init__.py | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccbb325e44..11e4962c27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation` Added Otel semantic convention opt-in mechanism ([#1987](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1987)) +### Fixed + +- `opentelemetry-instrumentation-urllib`/`opentelemetry-instrumentation-urllib3` Fix metric descriptions to match semantic conventions + ([#1959]((https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1959)) + ## Version 1.21.0/0.42b0 (2023-11-01) ### Added diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py index da31bf99fa..656aa993ea 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py @@ -307,17 +307,17 @@ def _create_client_histograms(meter) -> Dict[str, Histogram]: MetricInstruments.HTTP_CLIENT_DURATION: meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_DURATION, unit="ms", - description="measures the duration outbound HTTP requests", + description="Measures the duration of outbound HTTP requests.", ), MetricInstruments.HTTP_CLIENT_REQUEST_SIZE: meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_REQUEST_SIZE, unit="By", - description="measures the size of HTTP request messages (compressed)", + description="Measures the size of HTTP request messages.", ), MetricInstruments.HTTP_CLIENT_RESPONSE_SIZE: meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_RESPONSE_SIZE, unit="By", - description="measures the size of HTTP response messages (compressed)", + description="Measures the size of HTTP response messages.", ), } diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py index 45bab7454d..5580cb529f 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py @@ -183,17 +183,17 @@ def _instrument(self, **kwargs): duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_DURATION, unit="ms", - description="measures the duration outbound HTTP requests", + description="Measures the duration of outbound HTTP requests.", ) request_size_histogram = meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_REQUEST_SIZE, unit="By", - description="measures the size of HTTP request messages (compressed)", + description="Measures the size of HTTP request messages.", ) response_size_histogram = meter.create_histogram( name=MetricInstruments.HTTP_CLIENT_RESPONSE_SIZE, unit="By", - description="measures the size of HTTP response messages (compressed)", + description="Measures the size of HTTP response messages.", ) _instrument( From 5888d4ef95f772337ca7b93c0e283d5a05d4aa35 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Tue, 21 Nov 2023 13:55:11 +0530 Subject: [PATCH 074/200] Enable lint on CI and update deps (#2067) * Fix black an isort * change bootstrap_gen to use a list instead of dict * Bunch of updates * Fix build * fix lint * Fix docs * Fix lint * More fixes * Fix lint * fix stupid mistake --------- Co-authored-by: Christian Hartung --- .pylintrc | 13 +-- dev-requirements.txt | 27 +++--- docs-requirements.txt | 9 +- eachdist.ini | 1 + .../tests/conftest.py | 2 + .../test_prometheus_remote_write_exporter.py | 1 + .../tests/test_aiohttp_client_integration.py | 12 ++- .../aiohttp_server/__init__.py | 16 ++-- .../tests/test_aiohttp_server_integration.py | 79 +++++++++++------ .../tests/utils.py | 32 ------- .../aiopg/aiopg_integration.py | 1 + .../instrumentation/asgi/__init__.py | 1 + .../tests/test_asgi_middleware.py | 1 + .../instrumentation/asyncpg/__init__.py | 2 +- .../tests/__init__.py | 0 .../tests/mocks/__init__.py | 0 .../test_aws_lambda_instrumentation_manual.py | 10 ++- .../botocore/extensions/dynamodb.py | 1 + .../botocore/extensions/lmbd.py | 4 +- .../botocore/extensions/sns.py | 8 +- .../botocore/extensions/types.py | 18 ++-- .../tests/test_botocore_sns.py | 4 +- .../instrumentation/cassandra/__init__.py | 2 +- .../instrumentation/celery/__init__.py | 3 +- .../instrumentation/celery/utils.py | 1 - .../confluent_kafka/__init__.py | 5 +- .../instrumentation/confluent_kafka/utils.py | 2 +- .../tests/test_instrumentation.py | 14 +-- .../instrumentation/dbapi/__init__.py | 14 +-- .../instrumentation/elasticsearch/__init__.py | 1 + .../tests/test_elasticsearch.py | 1 + .../tests/test_programmatic.py | 1 - .../instrumentation/grpc/_aio_server.py | 4 +- .../instrumentation/grpc/_server.py | 4 +- .../instrumentation/grpc/filters/__init__.py | 25 +++--- .../tests/test_client_interceptor.py | 1 + .../tests/test_client_interceptor_filter.py | 1 + .../tests/test_utils.py | 15 ++++ .../instrumentation/pika/pika_instrumentor.py | 2 + .../tests/test_psycopg2_integration.py | 2 +- .../instrumentation/pymemcache/__init__.py | 2 +- .../tests/test_pymemcache.py | 5 +- .../instrumentation/redis/util.py | 2 +- .../tests/test_requests_integration.py | 6 +- .../tests/test_requests_ip_support.py | 2 +- .../instrumentation/sklearn/__init__.py | 2 + .../tests/test_sklearn.py | 1 + .../instrumentation/sqlalchemy/engine.py | 12 +-- .../system_metrics/__init__.py | 5 +- .../tests/test_system_metrics.py | 29 +++--- .../instrumentation/urllib/__init__.py | 2 +- .../tests/test_metrics_instrumentation.py | 20 ++--- .../tests/test_wsgi_middleware.py | 1 + .../instrumentation/bootstrap.py | 17 ++-- .../instrumentation/bootstrap_gen.py | 88 +++++++++---------- .../opentelemetry/instrumentation/utils.py | 5 +- .../tests/test_bootstrap.py | 2 +- .../resource/detector/azure/app_service.py | 32 ++++--- .../resource/detector/azure/vm.py | 26 +++--- .../tests/test_app_service.py | 1 + .../tests/test_vm.py | 20 ++--- scripts/generate_instrumentation_bootstrap.py | 7 +- scripts/update_sha.py | 2 +- .../sdk/extension/aws/resource/__init__.py | 1 + .../sdk/extension/aws/trace/__init__.py | 1 + .../aws/trace/aws_xray_id_generator.py | 3 +- .../trace/test_aws_xray_ids_generator.py | 1 + tox.ini | 27 +++--- .../src/opentelemetry/util/http/httplib.py | 6 +- 69 files changed, 344 insertions(+), 324 deletions(-) delete mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py create mode 100644 instrumentation/opentelemetry-instrumentation-aws-lambda/tests/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/__init__.py diff --git a/.pylintrc b/.pylintrc index 30d60bc2d3..5ea4385ea0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -3,7 +3,7 @@ # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code. -extension-pkg-whitelist= +extension-pkg-whitelist=cassandra # Add list of files or directories to be excluded. They should be base names, not # paths. @@ -29,7 +29,7 @@ limit-inference-results=100 # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins= +load-plugins=pylint.extensions.no_self_use # Pickle collected data for later comparisons. persistent=yes @@ -69,7 +69,6 @@ disable=missing-docstring, duplicate-code, ungrouped-imports, # Leave this up to isort wrong-import-order, # Leave this up to isort - bad-continuation, # Leave this up to black line-too-long, # Leave this up to black exec-used, super-with-arguments, # temp-pylint-upgrade @@ -81,6 +80,7 @@ disable=missing-docstring, invalid-overridden-method, # temp-pylint-upgrade missing-module-docstring, # temp-pylint-upgrade import-error, # needed as a workaround as reported here: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/290 + cyclic-import, # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -268,13 +268,6 @@ max-line-length=79 # Maximum number of lines in a module. max-module-lines=1000 -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator - # Allow the body of a class to be on the same line as the declaration if body # contains single statement. single-line-class-stmt=no diff --git a/dev-requirements.txt b/dev-requirements.txt index feab6b4b02..fffb4c445d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,20 +1,19 @@ -pylint==2.12.2 -flake8~=3.7 -isort~=5.6 -black>=22.1.0 -httpretty~=1.0 -mypy==0.790 -sphinx -sphinx-rtd-theme~=0.4 -sphinx-autodoc-typehints -pytest!=5.2.3 -pytest-cov>=2.8 -readme-renderer~=24.0 +pylint==3.0.2 +flake8==6.1.0 +isort==5.12.0 +black==22.3.0 +httpretty==1.1.4 +mypy==0.931 +sphinx==7.1.2 +sphinx-rtd-theme==2.0.0rc4 +sphinx-autodoc-typehints==1.25.2 +pytest==7.1.3 +pytest-cov==4.1.0 +readme-renderer==42.0 bleach==4.1.0 # transient dependency for readme-renderer -grpcio-tools==1.29.0 -mypy-protobuf>=1.23 protobuf~=3.13 markupsafe>=2.0.1 codespell==2.1.0 requests==2.31.0 ruamel.yaml==0.17.21 +flaky==3.7.0 diff --git a/docs-requirements.txt b/docs-requirements.txt index 32f4a406aa..965ea850c2 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,6 +1,6 @@ -sphinx==4.5.0 -sphinx-rtd-theme~=0.4 -sphinx-autodoc-typehints +sphinx==7.1.2 +sphinx-rtd-theme==2.0.0rc4 +sphinx-autodoc-typehints==1.25.2 # Need to install the api/sdk in the venv for autodoc. Modifying sys.path # doesn't work for pkg_resources. @@ -45,11 +45,8 @@ remoulade>=0.50 sqlalchemy>=1.0 tornado>=5.1.1 tortoise-orm>=0.17.0 -ddtrace>=0.34.0 httpx>=0.18.0 # indirect dependency pins markupsafe==2.0.1 itsdangerous==2.0.1 - -docutils==0.16 \ No newline at end of file diff --git a/eachdist.ini b/eachdist.ini index 8a5e1edfbe..2884f8608d 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -54,6 +54,7 @@ packages= [lintroots] extraroots=examples/*,scripts/ subglob=*.py,tests/,test/,src/*,examples/* +ignore=sklearn [testroots] extraroots=examples/*,tests/ diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py index 259de7b7a2..78e9c49bee 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py @@ -3,6 +3,8 @@ import pytest import opentelemetry.test.metrictestutil as metric_util + +# pylint: disable=no-name-in-module from opentelemetry.exporter.prometheus_remote_write import ( PrometheusRemoteWriteMetricsExporter, ) diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py index d64a8f04a8..785c6bdc29 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py @@ -17,6 +17,7 @@ import pytest +# pylint: disable=no-name-in-module from opentelemetry.exporter.prometheus_remote_write import ( PrometheusRemoteWriteMetricsExporter, ) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py index 9c73071465..50330b05be 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py @@ -14,6 +14,7 @@ import asyncio import contextlib +import sys import typing import unittest import urllib.parse @@ -116,6 +117,11 @@ def test_status_codes(self): status_code=status_code, ) + url = f"http://{host}:{port}/test-path?query=param#foobar" + # if python version is < 3.8, then the url will be + if sys.version_info[1] < 8: + url = f"http://{host}:{port}/test-path#foobar" + self.assert_spans( [ ( @@ -123,7 +129,7 @@ def test_status_codes(self): (span_status, None), { SpanAttributes.HTTP_METHOD: "GET", - SpanAttributes.HTTP_URL: f"http://{host}:{port}/test-path#foobar", + SpanAttributes.HTTP_URL: url, SpanAttributes.HTTP_STATUS_CODE: int( status_code ), @@ -136,7 +142,7 @@ def test_status_codes(self): def test_schema_url(self): with self.subTest(status_code=200): - host, port = self._http_request( + self._http_request( trace_config=aiohttp_client.create_trace_config(), url="/test-path?query=param#foobar", status_code=200, @@ -156,7 +162,7 @@ def test_not_recording(self): mock_tracer.start_span.return_value = mock_span with mock.patch("opentelemetry.trace.get_tracer"): # pylint: disable=W0612 - host, port = self._http_request( + self._http_request( trace_config=aiohttp_client.create_trace_config(), url="/test-path?query=param#foobar", ) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py index 3fd8e62e78..914f005b2a 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py @@ -13,24 +13,24 @@ # limitations under the License. import urllib +from timeit import default_timer +from typing import Dict, List, Tuple, Union + from aiohttp import web from multidict import CIMultiDictProxy -from timeit import default_timer -from typing import Tuple, Dict, List, Union -from opentelemetry import context, trace, metrics +from opentelemetry import context, metrics, trace from opentelemetry.context import _SUPPRESS_HTTP_INSTRUMENTATION_KEY from opentelemetry.instrumentation.aiohttp_server.package import _instruments from opentelemetry.instrumentation.aiohttp_server.version import __version__ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.utils import http_status_to_status_code -from opentelemetry.propagators.textmap import Getter from opentelemetry.propagate import extract -from opentelemetry.semconv.trace import SpanAttributes +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 opentelemetry.util.http import get_excluded_urls -from opentelemetry.util.http import remove_url_credentials +from opentelemetry.util.http import get_excluded_urls, remove_url_credentials _duration_attrs = [ SpanAttributes.HTTP_METHOD, @@ -127,7 +127,7 @@ def collect_request_attributes(request: web.Request) -> Dict: result[SpanAttributes.HTTP_METHOD] = http_method http_host_value_list = ( - [request.host] if type(request.host) != list else request.host + [request.host] if not isinstance(request.host, list) else request.host ) if http_host_value_list: result[SpanAttributes.HTTP_SERVER_NAME] = ",".join( diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py index 973aea0d1c..b5e8ec468f 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py @@ -12,25 +12,42 @@ # See the License for the specific language governing permissions and # limitations under the License. +from enum import Enum +from http import HTTPStatus + +import aiohttp import pytest import pytest_asyncio -import aiohttp -from http import HTTPStatus -from .utils import HTTPMethod from opentelemetry import trace as trace_api -from opentelemetry.test.test_base import TestBase -from opentelemetry.instrumentation.aiohttp_server import AioHttpServerInstrumentor +from opentelemetry.instrumentation.aiohttp_server import ( + AioHttpServerInstrumentor, +) from opentelemetry.semconv.trace import SpanAttributes +from opentelemetry.test.globals_test import reset_trace_globals +from opentelemetry.test.test_base import TestBase from opentelemetry.util._importlib_metadata import entry_points -from opentelemetry.test.globals_test import ( - reset_trace_globals, -) +class HTTPMethod(Enum): + """HTTP methods and descriptions""" + + def __repr__(self): + return f"{self.value}" + + CONNECT = "CONNECT" + DELETE = "DELETE" + GET = "GET" + HEAD = "HEAD" + OPTIONS = "OPTIONS" + PATCH = "PATCH" + POST = "POST" + PUT = "PUT" + TRACE = "TRACE" -@pytest.fixture(scope="session") -def tracer(): + +@pytest.fixture(name="tracer", scope="session") +def fixture_tracer(): test_base = TestBase() tracer_provider, memory_exporter = test_base.create_tracer_provider() @@ -47,15 +64,14 @@ async def default_handler(request, status=200): return aiohttp.web.Response(status=status) -@pytest_asyncio.fixture -async def server_fixture(tracer, aiohttp_server): +@pytest_asyncio.fixture(name="server_fixture") +async def fixture_server_fixture(tracer, aiohttp_server): _, memory_exporter = tracer AioHttpServerInstrumentor().instrument() app = aiohttp.web.Application() - app.add_routes( - [aiohttp.web.get("/test-path", default_handler)]) + app.add_routes([aiohttp.web.get("/test-path", default_handler)]) server = await aiohttp_server(app) yield server, app @@ -67,26 +83,31 @@ async def server_fixture(tracer, aiohttp_server): def test_checking_instrumentor_pkg_installed(): - (instrumentor_entrypoint,) = entry_points(group="opentelemetry_instrumentor", name="aiohttp-server") + (instrumentor_entrypoint,) = entry_points( + group="opentelemetry_instrumentor", name="aiohttp-server" + ) instrumentor = instrumentor_entrypoint.load()() - assert (isinstance(instrumentor, AioHttpServerInstrumentor)) + assert isinstance(instrumentor, AioHttpServerInstrumentor) @pytest.mark.asyncio -@pytest.mark.parametrize("url, expected_method, expected_status_code", [ - ("/test-path", HTTPMethod.GET, HTTPStatus.OK), - ("/not-found", HTTPMethod.GET, HTTPStatus.NOT_FOUND) -]) +@pytest.mark.parametrize( + "url, expected_method, expected_status_code", + [ + ("/test-path", HTTPMethod.GET, HTTPStatus.OK), + ("/not-found", HTTPMethod.GET, HTTPStatus.NOT_FOUND), + ], +) async def test_status_code_instrumentation( tracer, server_fixture, aiohttp_client, url, expected_method, - expected_status_code + expected_status_code, ): _, memory_exporter = tracer - server, app = server_fixture + server, _ = server_fixture assert len(memory_exporter.get_finished_spans()) == 0 @@ -98,8 +119,12 @@ async def test_status_code_instrumentation( [span] = memory_exporter.get_finished_spans() assert expected_method.value == span.attributes[SpanAttributes.HTTP_METHOD] - assert expected_status_code == span.attributes[SpanAttributes.HTTP_STATUS_CODE] - - assert f"http://{server.host}:{server.port}{url}" == span.attributes[ - SpanAttributes.HTTP_URL - ] + assert ( + expected_status_code + == span.attributes[SpanAttributes.HTTP_STATUS_CODE] + ) + + assert ( + f"http://{server.host}:{server.port}{url}" + == span.attributes[SpanAttributes.HTTP_URL] + ) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py deleted file mode 100644 index 8fedcb32e3..0000000000 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/utils.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2020, 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. - -from enum import Enum - - -class HTTPMethod(Enum): - """HTTP methods and descriptions""" - - def __repr__(self): - return f"{self.value}" - - CONNECT = 'CONNECT' - DELETE = 'DELETE' - GET = 'GET' - HEAD = 'HEAD' - OPTIONS = 'OPTIONS' - PATCH = 'PATCH' - POST = 'POST' - PUT = 'PUT' - TRACE = 'TRACE' diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py index 6cc87f4900..a4bde482db 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/aiopg_integration.py @@ -215,6 +215,7 @@ async def __aexit__(self, exc_type, exc, tb): class _PoolAcquireContextManager(_ContextManager): + # pylint: disable=redefined-slots-in-subclass __slots__ = ("_coro", "_obj", "_pool") def __init__(self, coro, pool): diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index ae47a5cb4f..6ae6ce1790 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -710,6 +710,7 @@ async def otel_send(message): pass await send(message) + # pylint: disable=too-many-boolean-expressions if ( not expecting_trailers and message["type"] == "http.response.body" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index da7bc8ea74..4819f80630 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -227,6 +227,7 @@ async def error_asgi(scope, receive, send): await send({"type": "http.response.body", "body": b"*"}) +# pylint: disable=too-many-public-methods class TestAsgiApplication(AsgiTestBase): def validate_outputs(self, outputs, error=None, modifiers=None): # Ensure modifiers is a list diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py index c6b5a55e79..a8c0eab2ac 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py @@ -84,7 +84,7 @@ def _hydrate_span_from_args(connection, query, parameters) -> dict: span_attributes[SpanAttributes.NET_PEER_NAME] = addr span_attributes[ SpanAttributes.NET_TRANSPORT - ] = NetTransportValues.UNIX.value + ] = NetTransportValues.OTHER.value if query is not None: span_attributes[SpanAttributes.DB_STATEMENT] = query diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py index 1df7499d31..5e4aaf0312 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py @@ -17,10 +17,12 @@ from typing import Any, Callable, Dict from unittest import mock -from mocks.api_gateway_http_api_event import ( +from tests.mocks.api_gateway_http_api_event import ( MOCK_LAMBDA_API_GATEWAY_HTTP_API_EVENT, ) -from mocks.api_gateway_proxy_event import MOCK_LAMBDA_API_GATEWAY_PROXY_EVENT +from tests.mocks.api_gateway_proxy_event import ( + MOCK_LAMBDA_API_GATEWAY_PROXY_EVENT, +) from opentelemetry.environment_variables import OTEL_PROPAGATORS from opentelemetry.instrumentation.aws_lambda import ( @@ -103,7 +105,7 @@ def setUp(self): super().setUp() self.common_env_patch = mock.patch.dict( "os.environ", - {_HANDLER: "mocks.lambda_function.handler"}, + {_HANDLER: "tests.mocks.lambda_function.handler"}, ) self.common_env_patch.start() @@ -356,7 +358,7 @@ def test_lambda_handles_multiple_consumers(self): def test_api_gateway_proxy_event_sets_attributes(self): handler_patch = mock.patch.dict( "os.environ", - {_HANDLER: "mocks.lambda_function.rest_api_handler"}, + {_HANDLER: "tests.mocks.lambda_function.rest_api_handler"}, ) handler_patch.start() diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/dynamodb.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/dynamodb.py index da389415c7..1a5f01b6ce 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/dynamodb.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/dynamodb.py @@ -28,6 +28,7 @@ from opentelemetry.trace.span import Span from opentelemetry.util.types import AttributeValue +# pylint: disable=invalid-name _AttributePathT = Union[str, Tuple[str]] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/lmbd.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/lmbd.py index 05d45de689..299a37ab6c 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/lmbd.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/lmbd.py @@ -99,13 +99,13 @@ def _inject_current_span(cls, call_context: _AwsSdkCallContext): # Lambda extension ################################################################################ -_OPERATION_MAPPING = { +_OPERATION_MAPPING: Dict[str, _LambdaOperation] = { op.operation_name(): op for op in globals().values() if inspect.isclass(op) and issubclass(op, _LambdaOperation) and not inspect.isabstract(op) -} # type: Dict[str, _LambdaOperation] +} class _LambdaExtension(_AwsSdkExtension): diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py index 9536133f5c..aa55ae697f 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/sns.py @@ -82,7 +82,9 @@ def extract_attributes( attributes[SpanAttributes.MESSAGING_DESTINATION] = destination_name # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when opentelemetry-semantic-conventions 0.42b0 is released - attributes["messaging.destination.name"] = cls._extract_input_arn(call_context) + attributes["messaging.destination.name"] = cls._extract_input_arn( + call_context + ) call_context.span_name = ( f"{'phone_number' if is_phone_number else destination_name} send" ) @@ -141,13 +143,13 @@ def before_service_call(cls, call_context: _AwsSdkCallContext, span: Span): # SNS extension ################################################################################ -_OPERATION_MAPPING = { +_OPERATION_MAPPING: Dict[str, _SnsOperation] = { op.operation_name(): op for op in globals().values() if inspect.isclass(op) and issubclass(op, _SnsOperation) and not inspect.isabstract(op) -} # type: Dict[str, _SnsOperation] +} class _SnsExtension(_AwsSdkExtension): diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py index b6a1c3aa57..a3c73af65c 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py @@ -57,23 +57,21 @@ def __init__(self, client: _BotoClientT, args: Tuple[str, Dict[str, Any]]): boto_meta = client.meta service_model = boto_meta.service_model - self.service = service_model.service_name.lower() # type: str - self.operation = operation # type: str - self.params = params # type: Dict[str, Any] + self.service = service_model.service_name.lower() + self.operation = operation + self.params = params # 'operation' and 'service' are essential for instrumentation. # for all other attributes we extract them defensively. All of them should # usually exist unless some future botocore version moved things. - self.region = self._get_attr( - boto_meta, "region_name" - ) # type: Optional[str] - self.endpoint_url = self._get_attr( + self.region: Optional[str] = self._get_attr(boto_meta, "region_name") + self.endpoint_url: Optional[str] = self._get_attr( boto_meta, "endpoint_url" - ) # type: Optional[str] + ) - self.api_version = self._get_attr( + self.api_version: Optional[str] = self._get_attr( service_model, "api_version" - ) # type: Optional[str] + ) # name of the service in proper casing self.service_id = str( self._get_attr(service_model, "service_id", self.service) diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py index cf676619e6..e2b4c55732 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_sns.py @@ -122,7 +122,7 @@ def _test_publish_to_arn(self, arg_name: str): target_arn, # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when # opentelemetry-semantic-conventions 0.42b0 is released - span.attributes["messaging.destination.name"] + span.attributes["messaging.destination.name"], ) @mock_sns @@ -194,7 +194,7 @@ def test_publish_batch_to_topic(self): topic_arn, # TODO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when # opentelemetry-semantic-conventions 0.42b0 is released - span.attributes["messaging.destination.name"] + span.attributes["messaging.destination.name"], ) self.assert_injected_span(message1_attrs, span) diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py index 202bf03712..2a9239f152 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/__init__.py @@ -43,9 +43,9 @@ from wrapt import wrap_function_wrapper from opentelemetry import trace -from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.cassandra.package import _instruments from opentelemetry.instrumentation.cassandra.version import __version__ +from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.utils import unwrap from opentelemetry.semconv.trace import SpanAttributes diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py index 8baddcca94..94cac68b70 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py @@ -63,6 +63,7 @@ def add(x, y): from timeit import default_timer from typing import Collection, Iterable +from billiard import VERSION from billiard.einfo import ExceptionInfo from celery import signals # pylint: disable=no-name-in-module @@ -76,8 +77,6 @@ def add(x, y): from opentelemetry.propagators.textmap import Getter from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace.status import Status, StatusCode -from billiard import VERSION - if VERSION >= (4, 0, 1): from billiard.einfo import ExceptionWithTraceback diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py index f92c5e03c8..6f4f9cbc3a 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/utils.py @@ -15,7 +15,6 @@ import logging from celery import registry # pylint: disable=no-name-in-module -from billiard import VERSION from opentelemetry.semconv.trace import SpanAttributes diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py index 45a16fcffb..c869d03dd9 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py @@ -107,16 +107,15 @@ def instrument_consumer(consumer: Consumer, tracer_provider=None) from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.utils import unwrap from opentelemetry.semconv.trace import MessagingOperationValues -from opentelemetry.trace import Link, SpanKind, Tracer +from opentelemetry.trace import Tracer from .package import _instruments from .utils import ( KafkaPropertiesExtractor, - _end_current_consume_span, _create_new_consume_span, + _end_current_consume_span, _enrich_span, _get_span_name, - _kafka_getter, _kafka_setter, ) from .version import __version__ diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py index 2029960703..4769f2a88f 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py @@ -2,13 +2,13 @@ from typing import List, Optional from opentelemetry import context, propagate -from opentelemetry.trace import SpanKind, Link from opentelemetry.propagators import textmap from opentelemetry.semconv.trace import ( MessagingDestinationKindValues, MessagingOperationValues, SpanAttributes, ) +from opentelemetry.trace import Link, SpanKind _LOG = getLogger(__name__) diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py index d7ac343dbf..21d5bd6f83 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py @@ -14,13 +14,6 @@ # pylint: disable=no-name-in-module -from opentelemetry.semconv.trace import ( - SpanAttributes, - MessagingDestinationKindValues, -) -from opentelemetry.test.test_base import TestBase -from .utils import MockConsumer, MockedMessage - from confluent_kafka import Consumer, Producer from opentelemetry.instrumentation.confluent_kafka import ( @@ -32,6 +25,13 @@ KafkaContextGetter, KafkaContextSetter, ) +from opentelemetry.semconv.trace import ( + MessagingDestinationKindValues, + SpanAttributes, +) +from opentelemetry.test.test_base import TestBase + +from .utils import MockConsumer, MockedMessage class TestConfluentKafka(TestBase): diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py index e1840ae011..b0acbed185 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/__init__.py @@ -427,14 +427,14 @@ def traced_execution( if args and self._commenter_enabled: try: args_list = list(args) - commenter_data = dict( + commenter_data = { # Psycopg2/framework information - db_driver=f"psycopg2:{self._connect_module.__version__.split(' ')[0]}", - dbapi_threadsafety=self._connect_module.threadsafety, - dbapi_level=self._connect_module.apilevel, - libpq_version=self._connect_module.__libpq_version__, - driver_paramstyle=self._connect_module.paramstyle, - ) + "db_driver": f"psycopg2:{self._connect_module.__version__.split(' ')[0]}", + "dbapi_threadsafety": self._connect_module.threadsafety, + "dbapi_level": self._connect_module.apilevel, + "libpq_version": self._connect_module.__libpq_version__, + "driver_paramstyle": self._connect_module.paramstyle, + } if self._commenter_options.get( "opentelemetry_values", True ): diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py index e3a9f5256f..dd72a5235e 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py @@ -172,6 +172,7 @@ def _instrument(self, **kwargs): ) def _uninstrument(self, **kwargs): + # pylint: disable=no-member unwrap(elasticsearch.Transport, "perform_request") diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py index 37dd5f9cd7..0c84cf5cd6 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py @@ -11,6 +11,7 @@ # 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. +# pylint: disable=unexpected-keyword-arg,missing-kwoa,no-value-for-parameter import json import os diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py index a86bc3166a..3bd2f74ba8 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py @@ -40,7 +40,6 @@ OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS, OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST, OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE, - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE, OTEL_PYTHON_INSTRUMENTATION_HTTP_CAPTURE_ALL_METHODS, get_excluded_urls, ) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py index d64dcf000b..7c20de0cc0 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py @@ -77,7 +77,7 @@ async def _unary_interceptor(request_or_iterator, context): # we handle in our context wrapper. # Here, we're interested in uncaught exceptions. # pylint:disable=unidiomatic-typecheck - if type(error) != Exception: + if type(error) != Exception: # noqa: E721 span.record_exception(error) raise error @@ -101,7 +101,7 @@ async def _stream_interceptor(request_or_iterator, context): except Exception as error: # pylint:disable=unidiomatic-typecheck - if type(error) != Exception: + if type(error) != Exception: # noqa: E721 span.record_exception(error) raise error diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py index dcee959b4d..9b66110574 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py @@ -315,7 +315,7 @@ def telemetry_interceptor(request_or_iterator, context): # we handle in our context wrapper. # Here, we're interested in uncaught exceptions. # pylint:disable=unidiomatic-typecheck - if type(error) != Exception: + if type(error) != Exception: # noqa: E721 span.record_exception(error) raise error @@ -342,6 +342,6 @@ def _intercept_server_stream( except Exception as error: # pylint:disable=unidiomatic-typecheck - if type(error) != Exception: + if type(error) != Exception: # noqa: E721 span.record_exception(error) raise error diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py index 8100a2d17f..858d5d9e40 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py @@ -17,13 +17,14 @@ import grpc -TCallDetails = TypeVar( - "TCallDetails", +CallDetailsT = TypeVar( + "CallDetailsT", grpc.HandlerCallDetails, grpc.ClientCallDetails, grpc.aio.ClientCallDetails, ) -Condition = Callable[[TCallDetails], bool] +# pylint: disable=invalid-name +Condition = Callable[[CallDetailsT], bool] def _full_method(metadata): @@ -61,7 +62,7 @@ def _split_full_method(metadata): return (service, method) -def all_of(*args: Condition[TCallDetails]) -> Condition[TCallDetails]: +def all_of(*args: Condition[CallDetailsT]) -> Condition[CallDetailsT]: """Returns a filter function that returns True if all filter functions assigned matches conditions. @@ -79,7 +80,7 @@ def filter_fn(metadata): return filter_fn -def any_of(*args: Condition[TCallDetails]) -> Condition[TCallDetails]: +def any_of(*args: Condition[CallDetailsT]) -> Condition[CallDetailsT]: """Returns a filter function that returns True if any of filter functions assigned matches conditions. @@ -97,7 +98,7 @@ def filter_fn(metadata): return filter_fn -def negate(func: Condition[TCallDetails]) -> Condition[TCallDetails]: +def negate(func: Condition[CallDetailsT]) -> Condition[CallDetailsT]: """Returns a filter function that negate the result of func Args: @@ -113,7 +114,7 @@ def filter_fn(metadata): return filter_fn -def method_name(name: str) -> Condition[TCallDetails]: +def method_name(name: str) -> Condition[CallDetailsT]: """Returns a filter function that return True if request's gRPC method name matches name. @@ -132,7 +133,7 @@ def filter_fn(metadata): return filter_fn -def method_prefix(prefix: str) -> Condition[TCallDetails]: +def method_prefix(prefix: str) -> Condition[CallDetailsT]: """Returns a filter function that return True if request's gRPC method name starts with prefix. @@ -151,7 +152,7 @@ def filter_fn(metadata): return filter_fn -def full_method_name(name: str) -> Condition[TCallDetails]: +def full_method_name(name: str) -> Condition[CallDetailsT]: """Returns a filter function that return True if request's gRPC full method name matches name. @@ -170,7 +171,7 @@ def filter_fn(metadata): return filter_fn -def service_name(name: str) -> Condition[TCallDetails]: +def service_name(name: str) -> Condition[CallDetailsT]: """Returns a filter function that return True if request's gRPC service name matches name. @@ -189,7 +190,7 @@ def filter_fn(metadata): return filter_fn -def service_prefix(prefix: str) -> Condition[TCallDetails]: +def service_prefix(prefix: str) -> Condition[CallDetailsT]: """Returns a filter function that return True if request's gRPC service name starts with prefix. @@ -208,7 +209,7 @@ def filter_fn(metadata): return filter_fn -def health_check() -> Condition[TCallDetails]: +def health_check() -> Condition[CallDetailsT]: """Returns a Filter that returns true if the request's service name is health check defined by gRPC Health Checking Protocol. https://github.com/grpc/grpc/blob/master/doc/health-checking.md diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py index 810ee930dd..21d016d624 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py @@ -11,6 +11,7 @@ # 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. +# pylint:disable=cyclic-import import grpc from tests.protobuf import ( # pylint: disable=no-name-in-module diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py index a15268464b..bfa20592ba 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py @@ -11,6 +11,7 @@ # 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. +# pylint:disable=cyclic-import import os from unittest import mock diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/tests/test_utils.py b/instrumentation/opentelemetry-instrumentation-kafka-python/tests/test_utils.py index 7da1ed0596..85397bcb73 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/tests/test_utils.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/tests/test_utils.py @@ -1,3 +1,18 @@ +# 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. +# pylint: disable=unnecessary-dunder-call + from unittest import TestCase, mock from opentelemetry.instrumentation.kafka.utils import ( diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py index 186128b3b2..56c78a85c3 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/pika_instrumentor.py @@ -11,6 +11,8 @@ # 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. +# pylint: disable=unnecessary-dunder-call + from logging import getLogger from typing import Any, Collection, Dict, Optional diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py b/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py index 8252929037..369d63d5cf 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/tests/test_psycopg2_integration.py @@ -61,7 +61,7 @@ def cursor(self): return MockCursor() def get_dsn_parameters(self): # pylint: disable=no-self-use - return dict(dbname="test") + return {"dbname": "test"} class TestPostgresqlIntegration(TestBase): diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py index e95c6b21ce..512ce9ea56 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/__init__.py @@ -169,7 +169,7 @@ def _get_address_attributes(instance): address_attributes[SpanAttributes.NET_PEER_NAME] = instance.server address_attributes[ SpanAttributes.NET_TRANSPORT - ] = NetTransportValues.UNIX.value + ] = NetTransportValues.OTHER.value return address_attributes diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py b/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py index 4e29091217..35b672bac0 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py @@ -24,14 +24,15 @@ MemcacheUnknownError, ) +# pylint: disable=import-error,no-name-in-module +from tests.utils import MockSocket, _str + from opentelemetry import trace as trace_api from opentelemetry.instrumentation.pymemcache import PymemcacheInstrumentor from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase from opentelemetry.trace import get_tracer -from .utils import MockSocket, _str - TEST_HOST = "localhost" TEST_PORT = 117711 diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py index b24f9b2655..3c274c8c43 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py @@ -43,7 +43,7 @@ def _extract_conn_attributes(conn_kwargs): attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get("path", "") attributes[ SpanAttributes.NET_TRANSPORT - ] = NetTransportValues.UNIX.value + ] = NetTransportValues.OTHER.value return attributes diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py index 3bd76a6995..82fa4ed1e6 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py @@ -456,7 +456,7 @@ class TestRequestsIntegration(RequestsIntegrationTestBase, TestBase): @staticmethod def perform_request(url: str, session: requests.Session = None): if session is None: - return requests.get(url) + return requests.get(url, timeout=5) return session.get(url) def test_credential_removal(self): @@ -467,7 +467,7 @@ def test_credential_removal(self): self.assertEqual(span.attributes[SpanAttributes.HTTP_URL], self.URL) def test_if_headers_equals_none(self): - result = requests.get(self.URL, headers=None) + result = requests.get(self.URL, headers=None, timeout=5) self.assertEqual(result.text, "Hello!") self.assert_span() @@ -501,7 +501,7 @@ def tearDown(self): @staticmethod def perform_request(url: str) -> requests.Response: - return requests.get(url) + return requests.get(url, timeout=5) def test_basic_metric_success(self): self.perform_request(self.URL) diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py index cf2e7fb4dd..8589ac0e26 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_ip_support.py @@ -38,7 +38,7 @@ def tearDown(self): @staticmethod def perform_request(url: str) -> requests.Response: - return requests.get(url) + return requests.get(url, timeout=5) def test_basic_http_success(self): response = self.perform_request(self.http_url) diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py index 5ca132797f..a67bfa6ef4 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/__init__.py @@ -82,6 +82,8 @@ from sklearn.utils.metaestimators import _IffHasAttrDescriptor from opentelemetry.instrumentation.instrumentor import BaseInstrumentor + +# pylint: disable=no-name-in-module from opentelemetry.instrumentation.sklearn.package import _instruments from opentelemetry.instrumentation.sklearn.version import __version__ from opentelemetry.trace import get_tracer diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/tests/test_sklearn.py b/instrumentation/opentelemetry-instrumentation-sklearn/tests/test_sklearn.py index ad4d032280..db69761ece 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/tests/test_sklearn.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/tests/test_sklearn.py @@ -14,6 +14,7 @@ from sklearn.ensemble import RandomForestClassifier +# pylint: disable=no-name-in-module from opentelemetry.instrumentation.sklearn import ( DEFAULT_EXCLUDE_CLASSES, DEFAULT_METHODS, diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py index 1cf980929b..0632d71faf 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py @@ -224,11 +224,11 @@ def _before_cur_exec( for key, value in attrs.items(): span.set_attribute(key, value) if self.enable_commenter: - commenter_data = dict( - db_driver=conn.engine.driver, + commenter_data = { + "db_driver": conn.engine.driver, # Driver/framework centric information. - db_framework=f"sqlalchemy:{__version__}", - ) + "db_framework": f"sqlalchemy:{__version__}", + } if self.commenter_options.get("opentelemetry_values", True): commenter_data.update(**_get_opentelemetry_values()) @@ -296,7 +296,9 @@ def _get_attributes_from_cursor(vendor, cursor, attrs): is_unix_socket = info.host and info.host.startswith("/") if is_unix_socket: - attrs[SpanAttributes.NET_TRANSPORT] = NetTransportValues.UNIX.value + attrs[ + SpanAttributes.NET_TRANSPORT + ] = NetTransportValues.OTHER.value if info.port: # postgresql enforces this pattern on all socket names attrs[SpanAttributes.NET_PEER_NAME] = os.path.join( diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py index d84cc94d01..32766fa0c5 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py @@ -76,9 +76,9 @@ """ import gc +import logging import os import sys -import logging import threading from platform import python_implementation from typing import Collection, Dict, Iterable, List, Optional @@ -363,7 +363,7 @@ def _instrument(self, **kwargs): if "process.runtime.gc_count" in self._config: if self._python_implementation == "pypy": _logger.warning( - "The process.runtime.gc_count metric won't be collected because the interpreter is PyPy" + "The process.runtime.gc_count metric won't be collected because the interpreter is PyPy" ) else: self._meter.create_observable_counter( @@ -372,7 +372,6 @@ def _instrument(self, **kwargs): description=f"Runtime {self._python_implementation} GC count", unit="bytes", ) - if "process.runtime.thread_count" in self._config: self._meter.create_observable_up_down_counter( diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py b/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py index 064a1534a6..3986a32c16 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py @@ -18,13 +18,12 @@ from platform import python_implementation from unittest import mock, skipIf -from opentelemetry.sdk.metrics import MeterProvider -from opentelemetry.sdk.metrics.export import InMemoryMetricReader -from opentelemetry.test.test_base import TestBase - from opentelemetry.instrumentation.system_metrics import ( SystemMetricsInstrumentor, ) +from opentelemetry.sdk.metrics import MeterProvider +from opentelemetry.sdk.metrics.export import InMemoryMetricReader +from opentelemetry.test.test_base import TestBase def _mock_netconnection(): @@ -120,12 +119,14 @@ def test_system_metrics_instrument(self): f"process.runtime.{self.implementation}.context_switches", f"process.runtime.{self.implementation}.cpu.utilization", ] - + if self.implementation == "pypy": self.assertEqual(len(metric_names), 20) else: self.assertEqual(len(metric_names), 21) - observer_names.append(f"process.runtime.{self.implementation}.gc_count",) + observer_names.append( + f"process.runtime.{self.implementation}.gc_count", + ) for observer in metric_names: self.assertIn(observer, observer_names) @@ -139,7 +140,7 @@ def test_runtime_metrics_instrument(self): "process.runtime.cpu.utilization": None, "process.runtime.context_switches": ["involuntary", "voluntary"], } - + if self.implementation != "pypy": runtime_config["process.runtime.gc_count"] = None @@ -166,7 +167,9 @@ def test_runtime_metrics_instrument(self): self.assertEqual(len(metric_names), 5) else: self.assertEqual(len(metric_names), 6) - observer_names.append(f"process.runtime.{self.implementation}.gc_count") + observer_names.append( + f"process.runtime.{self.implementation}.gc_count" + ) for observer in metric_names: self.assertIn(observer, observer_names) @@ -181,9 +184,9 @@ def _assert_metrics(self, observer_name, reader, expected): for data_point in metric.data.data_points: for expect in expected: if ( - dict(data_point.attributes) - == expect.attributes - and metric.name == observer_name + dict(data_point.attributes) + == expect.attributes + and metric.name == observer_name ): self.assertEqual( data_point.value, @@ -791,7 +794,9 @@ def test_runtime_cpu_time(self, mock_process_cpu_times): ) @mock.patch("gc.get_count") - @skipIf(python_implementation().lower() == "pypy", "not supported for pypy") + @skipIf( + python_implementation().lower() == "pypy", "not supported for pypy" + ) def test_runtime_get_count(self, mock_gc_get_count): mock_gc_get_count.configure_mock(**{"return_value": (1, 2, 3)}) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py index 656aa993ea..eca8fbda77 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py @@ -239,8 +239,8 @@ def _instrumented_open_call( token = context.attach( context.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True) ) + start_time = default_timer() try: - start_time = default_timer() result = call_wrapped() # *** PROCEED except Exception as exc: # pylint: disable=W0703 exception = exc diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py index d8f19f4e5d..087607e606 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py @@ -13,14 +13,14 @@ # limitations under the License. +from platform import python_implementation +from sys import version_info from timeit import default_timer from urllib import request from urllib.parse import urlencode -from pytest import mark -from platform import python_implementation -from sys import version_info import httpretty +from pytest import mark from opentelemetry.instrumentation.urllib import ( # pylint: disable=no-name-in-module,import-error URLLibInstrumentor, @@ -190,22 +190,16 @@ def test_basic_metric_request_not_empty(self): @mark.skipif( python_implementation() == "PyPy" or version_info.minor == 7, - reason="Fails randomly in 3.7 and pypy" + reason="Fails randomly in 3.7 and pypy", ) def test_metric_uninstrument(self): with request.urlopen(self.URL): metrics = self.get_sorted_metrics() self.assertEqual(len(metrics), 3) - self.assertEqual( - metrics[0].data.data_points[0].sum, 1 - ) - self.assertEqual( - metrics[1].data.data_points[0].sum, 0 - ) - self.assertEqual( - metrics[2].data.data_points[0].sum, 6 - ) + self.assertEqual(metrics[0].data.data_points[0].sum, 1) + self.assertEqual(metrics[1].data.data_points[0].sum, 0) + self.assertEqual(metrics[2].data.data_points[0].sum, 6) URLLibInstrumentor().uninstrument() with request.urlopen(self.URL): diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index bc78a787ca..d71e584ca8 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -78,6 +78,7 @@ def gen_wsgi(environ, start_response): def error_wsgi(environ, start_response): assert isinstance(environ, dict) + exc_info = None try: raise ValueError except ValueError: diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py index 6fa36f0463..afd5a045d9 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py @@ -77,7 +77,7 @@ def _pip_check(): ) as check_pipe: pip_check = check_pipe.communicate()[0].decode() pip_check_lower = pip_check.lower() - for package_tup in libraries.values(): + for package_tup in libraries: for package in package_tup: if package.lower() in pip_check_lower: raise RuntimeError(f"Dependency conflict found: {pip_check}") @@ -102,15 +102,12 @@ def _is_installed(req): def _find_installed_libraries(): - libs = default_instrumentations[:] - libs.extend( - [ - v["instrumentation"] - for _, v in libraries.items() - if _is_installed(v["library"]) - ] - ) - return libs + for lib in default_instrumentations: + yield lib + + for lib in libraries: + if _is_installed(lib["library"]): + yield lib["instrumentation"] def _run_requirements(): diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 6e193539a8..dc386cf9cc 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -15,176 +15,176 @@ # DO NOT EDIT. THIS FILE WAS AUTOGENERATED FROM INSTRUMENTATION PACKAGES. # RUN `python scripts/generate_instrumentation_bootstrap.py` TO REGENERATE. -libraries = { - "aio_pika": { +libraries = [ + { "library": "aio_pika >= 7.2.0, < 10.0.0", "instrumentation": "opentelemetry-instrumentation-aio-pika==0.43b0.dev", }, - "aiohttp": { + { "library": "aiohttp ~= 3.0", "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.43b0.dev", }, - "aiohttp": { + { "library": "aiohttp ~= 3.0", "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.43b0.dev", }, - "aiopg": { + { "library": "aiopg >= 0.13.0, < 2.0.0", "instrumentation": "opentelemetry-instrumentation-aiopg==0.43b0.dev", }, - "asgiref": { + { "library": "asgiref ~= 3.0", "instrumentation": "opentelemetry-instrumentation-asgi==0.43b0.dev", }, - "asyncpg": { + { "library": "asyncpg >= 0.12.0", "instrumentation": "opentelemetry-instrumentation-asyncpg==0.43b0.dev", }, - "boto": { + { "library": "boto~=2.0", "instrumentation": "opentelemetry-instrumentation-boto==0.43b0.dev", }, - "boto3": { + { "library": "boto3 ~= 1.0", "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.43b0.dev", }, - "botocore": { + { "library": "botocore ~= 1.0", "instrumentation": "opentelemetry-instrumentation-botocore==0.43b0.dev", }, - "cassandra-driver": { + { "library": "cassandra-driver ~= 3.25", "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0.dev", }, - "scylla-driver": { + { "library": "scylla-driver ~= 3.25", "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0.dev", }, - "celery": { + { "library": "celery >= 4.0, < 6.0", "instrumentation": "opentelemetry-instrumentation-celery==0.43b0.dev", }, - "confluent-kafka": { + { "library": "confluent-kafka >= 1.8.2, <= 2.2.0", "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.43b0.dev", }, - "django": { + { "library": "django >= 1.10", "instrumentation": "opentelemetry-instrumentation-django==0.43b0.dev", }, - "elasticsearch": { + { "library": "elasticsearch >= 2.0", "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.43b0.dev", }, - "falcon": { + { "library": "falcon >= 1.4.1, < 4.0.0", "instrumentation": "opentelemetry-instrumentation-falcon==0.43b0.dev", }, - "fastapi": { + { "library": "fastapi ~= 0.58", "instrumentation": "opentelemetry-instrumentation-fastapi==0.43b0.dev", }, - "flask": { + { "library": "flask >= 1.0, < 3.0", "instrumentation": "opentelemetry-instrumentation-flask==0.43b0.dev", }, - "werkzeug": { + { "library": "werkzeug < 3.0.0", "instrumentation": "opentelemetry-instrumentation-flask==0.43b0.dev", }, - "grpcio": { + { "library": "grpcio ~= 1.27", "instrumentation": "opentelemetry-instrumentation-grpc==0.43b0.dev", }, - "httpx": { + { "library": "httpx >= 0.18.0", "instrumentation": "opentelemetry-instrumentation-httpx==0.43b0.dev", }, - "jinja2": { + { "library": "jinja2 >= 2.7, < 4.0", "instrumentation": "opentelemetry-instrumentation-jinja2==0.43b0.dev", }, - "kafka-python": { + { "library": "kafka-python >= 2.0", "instrumentation": "opentelemetry-instrumentation-kafka-python==0.43b0.dev", }, - "mysql-connector-python": { + { "library": "mysql-connector-python ~= 8.0", "instrumentation": "opentelemetry-instrumentation-mysql==0.43b0.dev", }, - "mysqlclient": { + { "library": "mysqlclient < 3", "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.43b0.dev", }, - "pika": { + { "library": "pika >= 0.12.0", "instrumentation": "opentelemetry-instrumentation-pika==0.43b0.dev", }, - "psycopg2": { + { "library": "psycopg2 >= 2.7.3.1", "instrumentation": "opentelemetry-instrumentation-psycopg2==0.43b0.dev", }, - "pymemcache": { + { "library": "pymemcache >= 1.3.5, < 5", "instrumentation": "opentelemetry-instrumentation-pymemcache==0.43b0.dev", }, - "pymongo": { + { "library": "pymongo >= 3.1, < 5.0", "instrumentation": "opentelemetry-instrumentation-pymongo==0.43b0.dev", }, - "PyMySQL": { + { "library": "PyMySQL < 2", "instrumentation": "opentelemetry-instrumentation-pymysql==0.43b0.dev", }, - "pyramid": { + { "library": "pyramid >= 1.7", "instrumentation": "opentelemetry-instrumentation-pyramid==0.43b0.dev", }, - "redis": { + { "library": "redis >= 2.6", "instrumentation": "opentelemetry-instrumentation-redis==0.43b0.dev", }, - "remoulade": { + { "library": "remoulade >= 0.50", "instrumentation": "opentelemetry-instrumentation-remoulade==0.43b0.dev", }, - "requests": { + { "library": "requests ~= 2.0", "instrumentation": "opentelemetry-instrumentation-requests==0.43b0.dev", }, - "scikit-learn": { + { "library": "scikit-learn ~= 0.24.0", "instrumentation": "opentelemetry-instrumentation-sklearn==0.43b0.dev", }, - "sqlalchemy": { + { "library": "sqlalchemy", "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.43b0.dev", }, - "starlette": { + { "library": "starlette ~= 0.13.0", "instrumentation": "opentelemetry-instrumentation-starlette==0.43b0.dev", }, - "psutil": { + { "library": "psutil >= 5", "instrumentation": "opentelemetry-instrumentation-system-metrics==0.43b0.dev", }, - "tornado": { + { "library": "tornado >= 5.1.1", "instrumentation": "opentelemetry-instrumentation-tornado==0.43b0.dev", }, - "tortoise-orm": { + { "library": "tortoise-orm >= 0.17.0", "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", }, - "pydantic": { + { "library": "pydantic >= 1.10.2", "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", }, - "urllib3": { + { "library": "urllib3 >= 1.0.0, < 3.0.0", "instrumentation": "opentelemetry-instrumentation-urllib3==0.43b0.dev", }, -} +] default_instrumentations = [ "opentelemetry-instrumentation-aws-lambda==0.43b0.dev", "opentelemetry-instrumentation-dbapi==0.43b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py index e4f9b37c37..71a0087149 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py @@ -206,9 +206,10 @@ def _initialize(cls): @classmethod def _get_opentelemetry_stability_opt_in( - type: _OpenTelemetryStabilitySignalType, + cls, + signal_type: _OpenTelemetryStabilitySignalType, ) -> _OpenTelemetryStabilityMode: with _OpenTelemetrySemanticConventionStability._lock: return _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING.get( - type, _OpenTelemetryStabilityMode.DEFAULT + signal_type, _OpenTelemetryStabilityMode.DEFAULT ) diff --git a/opentelemetry-instrumentation/tests/test_bootstrap.py b/opentelemetry-instrumentation/tests/test_bootstrap.py index 416aad0667..bbe2f5623b 100644 --- a/opentelemetry-instrumentation/tests/test_bootstrap.py +++ b/opentelemetry-instrumentation/tests/test_bootstrap.py @@ -36,7 +36,7 @@ class TestBootstrap(TestCase): @classmethod def setUpClass(cls): cls.installed_libraries = sample_packages( - [lib["instrumentation"] for lib in libraries.values()], 0.6 + [lib["instrumentation"] for lib in libraries], 0.6 ) # treat 50% of sampled packages as pre-installed diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py index 823aac30fd..1e853acc57 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py @@ -14,8 +14,12 @@ from os import environ -from opentelemetry.sdk.resources import ResourceDetector, Resource -from opentelemetry.semconv.resource import ResourceAttributes, CloudPlatformValues, CloudProviderValues +from opentelemetry.sdk.resources import Resource, ResourceDetector +from opentelemetry.semconv.resource import ( + CloudPlatformValues, + CloudProviderValues, + ResourceAttributes, +) _AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE = "azure.app.service.stamp" _REGION_NAME = "REGION_NAME" @@ -36,18 +40,25 @@ _AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE: _WEBSITE_HOME_STAMPNAME, } + class AzureAppServiceResourceDetector(ResourceDetector): def detect(self) -> Resource: attributes = {} website_site_name = environ.get(_WEBSITE_SITE_NAME) if website_site_name: attributes[ResourceAttributes.SERVICE_NAME] = website_site_name - attributes[ResourceAttributes.CLOUD_PROVIDER] = CloudProviderValues.AZURE.value - attributes[ResourceAttributes.CLOUD_PLATFORM] = CloudPlatformValues.AZURE_APP_SERVICE.value + attributes[ + ResourceAttributes.CLOUD_PROVIDER + ] = CloudProviderValues.AZURE.value + attributes[ + ResourceAttributes.CLOUD_PLATFORM + ] = CloudPlatformValues.AZURE_APP_SERVICE.value azure_resource_uri = _get_azure_resource_uri(website_site_name) if azure_resource_uri: - attributes[ResourceAttributes.CLOUD_RESOURCE_ID] = azure_resource_uri + attributes[ + ResourceAttributes.CLOUD_RESOURCE_ID + ] = azure_resource_uri for (key, env_var) in _APP_SERVICE_ATTRIBUTE_ENV_VARS.items(): value = environ.get(env_var) if value: @@ -55,19 +66,16 @@ def detect(self) -> Resource: return Resource(attributes) + def _get_azure_resource_uri(website_site_name): website_resource_group = environ.get(_WEBSITE_RESOURCE_GROUP) website_owner_name = environ.get(_WEBSITE_OWNER_NAME) subscription_id = website_owner_name - if website_owner_name and '+' in website_owner_name: - subscription_id = website_owner_name[0:website_owner_name.index('+')] + if website_owner_name and "+" in website_owner_name: + subscription_id = website_owner_name[0 : website_owner_name.index("+")] if not (website_resource_group and subscription_id): return None - return "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/sites/%s" % ( - subscription_id, - website_resource_group, - website_site_name, - ) + return f"/subscriptions/{subscription_id}/resourceGroups/{website_resource_group}/providers/Microsoft.Web/sites/{website_site_name}" diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index d5da611bc2..fd14b482ed 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -14,18 +14,16 @@ from json import loads from logging import getLogger -from os import environ -from urllib.request import Request, urlopen from urllib.error import URLError +from urllib.request import Request, urlopen -from opentelemetry.sdk.resources import ResourceDetector, Resource +from opentelemetry.sdk.resources import Resource, ResourceDetector from opentelemetry.semconv.resource import ( - ResourceAttributes, CloudPlatformValues, CloudProviderValues, + ResourceAttributes, ) - # TODO: Remove when cloud resource id is no longer missing in Resource Attributes _AZURE_VM_METADATA_ENDPOINT = "http://169.254.169.254/metadata/instance/compute?api-version=2021-12-13&format=json" _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = "azure.vm.scaleset.name" @@ -67,20 +65,22 @@ def detect(self) -> "Resource": class _AzureVMMetadataServiceRequestor: - def get_azure_vm_metadata(self): + def get_azure_vm_metadata(self): # pylint: disable=no-self-use request = Request(_AZURE_VM_METADATA_ENDPOINT) request.add_header("Metadata", "True") try: - response = urlopen(request).read() - return loads(response) + with urlopen(request).read() as response: + return loads(response) except URLError: # Not on Azure VM return None - except Exception as e: + except Exception as e: # pylint: disable=broad-except,invalid-name _logger.exception("Failed to receive Azure VM metadata: %s", e) return None - def get_attribute_from_metadata(self, metadata_json, attribute_key): + def get_attribute_from_metadata( + self, metadata_json, attribute_key + ): # pylint: disable=no-self-use ams_value = "" if attribute_key == _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE: ams_value = metadata_json["vmScaleSetName"] @@ -94,9 +94,9 @@ def get_attribute_from_metadata(self, metadata_json, attribute_key): ams_value = metadata_json["location"] elif attribute_key == ResourceAttributes.CLOUD_RESOURCE_ID: ams_value = metadata_json["resourceId"] - elif ( - attribute_key == ResourceAttributes.HOST_ID - or attribute_key == ResourceAttributes.SERVICE_INSTANCE_ID + elif attribute_key in ( + ResourceAttributes.HOST_ID, + ResourceAttributes.SERVICE_INSTANCE_ID, ): ams_value = metadata_json["vmId"] elif attribute_key == ResourceAttributes.HOST_NAME: diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py index 209df39134..c5d2396dab 100644 --- a/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py +++ b/resource/opentelemetry-resource-detector-azure/tests/test_app_service.py @@ -14,6 +14,7 @@ import unittest from unittest.mock import patch +# pylint: disable=no-name-in-module from opentelemetry.resource.detector.azure.app_service import ( AzureAppServiceResourceDetector, ) diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py index 450b2890da..13ec225c82 100644 --- a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py +++ b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. import unittest -from unittest.mock import patch, Mock +from unittest.mock import Mock, patch -from opentelemetry.semconv.resource import ResourceAttributes -from opentelemetry.resource.detector.azure.vm import ( - AzureVMResourceDetector, -) +# pylint: disable=no-name-in-module +from opentelemetry.resource.detector.azure.vm import AzureVMResourceDetector LINUX_JSON = """ { @@ -369,10 +367,8 @@ def test_linux(self, mock_urlopen): mock_urlopen.return_value = mock_open mock_open.read.return_value = LINUX_JSON attributes = AzureVMResourceDetector().detect().attributes - for attribute_key in LINUX_ATTRIBUTES: - self.assertEqual( - attributes[attribute_key], LINUX_ATTRIBUTES[attribute_key] - ) + for attribute_key, attribute_value in LINUX_ATTRIBUTES.items(): + self.assertEqual(attributes[attribute_key], attribute_value) @patch("opentelemetry.resource.detector.azure.vm.urlopen") def test_windows(self, mock_urlopen): @@ -380,7 +376,5 @@ def test_windows(self, mock_urlopen): mock_urlopen.return_value = mock_open mock_open.read.return_value = WINDOWS_JSON attributes = AzureVMResourceDetector().detect().attributes - for attribute_key in WINDOWS_ATTRIBUTES: - self.assertEqual( - attributes[attribute_key], WINDOWS_ATTRIBUTES[attribute_key] - ) + for attribute_key, attribute_value in LINUX_ATTRIBUTES.items(): + self.assertEqual(attributes[attribute_key], attribute_value) diff --git a/scripts/generate_instrumentation_bootstrap.py b/scripts/generate_instrumentation_bootstrap.py index 23841309ff..1c0cc30f7b 100755 --- a/scripts/generate_instrumentation_bootstrap.py +++ b/scripts/generate_instrumentation_bootstrap.py @@ -21,7 +21,6 @@ import sys import astor -import pkg_resources from otel_packaging import ( get_instrumentation_packages, root_path, @@ -58,14 +57,12 @@ def main(): # pylint: disable=no-member default_instrumentations = ast.List(elts=[]) - libraries = ast.Dict(keys=[], values=[]) + libraries = ast.List(elts=[]) for pkg in get_instrumentation_packages(): if not pkg["instruments"]: default_instrumentations.elts.append(ast.Str(pkg["requirement"])) for target_pkg in pkg["instruments"]: - parsed = pkg_resources.Requirement.parse(target_pkg) - libraries.keys.append(ast.Str(parsed.name)) - libraries.values.append( + libraries.elts.append( ast.Dict( keys=[ast.Str("library"), ast.Str("instrumentation")], values=[ast.Str(target_pkg), ast.Str(pkg["requirement"])], diff --git a/scripts/update_sha.py b/scripts/update_sha.py index d74ccc12db..1c913249a2 100644 --- a/scripts/update_sha.py +++ b/scripts/update_sha.py @@ -27,7 +27,7 @@ def get_sha(branch): url = API_URL + branch - response = requests.get(url) + response = requests.get(url, timeout=15) response.raise_for_status() return response.json()["sha"] diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/__init__.py b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/__init__.py index 550fde612b..81877eea58 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/__init__.py +++ b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/__init__.py @@ -11,6 +11,7 @@ # 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. +# pylint:disable=no-name-in-module from opentelemetry.sdk.extension.aws.resource._lambda import ( AwsLambdaResourceDetector, diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/__init__.py b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/__init__.py index bb36ae45d5..671358dddb 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/__init__.py +++ b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/__init__.py @@ -11,6 +11,7 @@ # 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. +# pylint:disable=no-name-in-module from opentelemetry.sdk.extension.aws.trace.aws_xray_id_generator import ( AwsXRayIdGenerator, diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/aws_xray_id_generator.py b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/aws_xray_id_generator.py index 562ec3ff55..6068511844 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/aws_xray_id_generator.py +++ b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/aws_xray_id_generator.py @@ -77,8 +77,7 @@ class AwsXRayIdGenerator(IdGenerator): def generate_span_id(self) -> int: return self.random_id_generator.generate_span_id() - @staticmethod - def generate_trace_id() -> int: + def generate_trace_id(self) -> int: trace_time = int(time.time()) trace_identifier = random.getrandbits(96) return (trace_time << 96) + trace_identifier diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/tests/trace/test_aws_xray_ids_generator.py b/sdk-extension/opentelemetry-sdk-extension-aws/tests/trace/test_aws_xray_ids_generator.py index ed78c8f0e7..d2e05240e3 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/tests/trace/test_aws_xray_ids_generator.py +++ b/sdk-extension/opentelemetry-sdk-extension-aws/tests/trace/test_aws_xray_ids_generator.py @@ -16,6 +16,7 @@ import time import unittest +# pylint: disable=no-name-in-module from opentelemetry.sdk.extension.aws.trace import AwsXRayIdGenerator from opentelemetry.trace.span import INVALID_TRACE_ID diff --git a/tox.ini b/tox.ini index 2527613c54..e3d3a1fe16 100644 --- a/tox.ini +++ b/tox.ini @@ -507,7 +507,7 @@ commands = sphinx-build -E -a -W -b html -T . _build/html [testenv:spellcheck] -basepython: python3.10 +basepython: python3 recreate = True deps = codespell @@ -516,17 +516,10 @@ commands = codespell [testenv:lint] -basepython: python3.9 -recreate = False +basepython: python3 +recreate = True deps = - -c dev-requirements.txt - flaky - pylint - flake8 - isort - black - readme_renderer - httpretty + -r dev-requirements.txt commands_pre = python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" @@ -551,7 +544,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] + ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] @@ -570,6 +563,8 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] + # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install + # for your OS to install the required dependencies python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] @@ -581,7 +576,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] - python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write[test] + # requires snappy headers to be available on the system python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] python -m pip install -e {toxinidir}/resource/opentelemetry-resource-detector-container[test] python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-aws-xray[test] @@ -592,7 +587,7 @@ commands = python scripts/eachdist.py lint --check-only [testenv:docker-tests] -basepython: python3.10 +basepython: python3 deps = pip >= 20.3.3 pytest @@ -601,6 +596,9 @@ deps = mysql-connector-python ~= 8.0 pymongo >= 3.1, < 5.0 PyMySQL ~= 0.10.1 + # prerequisite: install libpq-dev (debian) or postgresql-devel (rhel), postgresql (mac) + # see https://www.psycopg.org/docs/install.html#build-prerequisites + # you might have to install additional packages depending on your OS psycopg2 ~= 2.9.5 aiopg >= 0.13.0, < 1.3.0 sqlalchemy ~= 1.4 @@ -608,6 +606,7 @@ deps = celery[pytest] >= 4.0, < 6.0 protobuf~=3.13 requests==2.25.0 + # prerequisite: install unixodbc pyodbc~=4.0.30 flaky==3.7.0 remoulade>=0.50 diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/httplib.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/httplib.py index de95a0aa92..3d6b875752 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/httplib.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/httplib.py @@ -78,7 +78,7 @@ def trysetip(conn: http.client.HTTPConnection, loglevel=logging.DEBUG) -> bool: state = _getstate() if not state: return True - spanlist = state.get("need_ip") # type: typing.List[Span] + spanlist: typing.List[Span] = state.get("need_ip") if not spanlist: return True @@ -88,7 +88,7 @@ def trysetip(conn: http.client.HTTPConnection, loglevel=logging.DEBUG) -> bool: sock = "" try: - sock = conn.sock # type: typing.Optional[socket.socket] + sock: typing.Optional[socket.socket] = conn.sock logger.debug("Got socket: %s", sock) if sock is None: return False @@ -163,7 +163,7 @@ def set_ip_on_next_http_connection(span: Span): finally: context.detach(token) else: - spans = state["need_ip"] # type: typing.List[Span] + spans: typing.List[Span] = state["need_ip"] spans.append(span) try: yield From 773e431bf5706a804246cf536bee1b6bee7284f6 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Tue, 21 Nov 2023 14:31:04 +0530 Subject: [PATCH 075/200] Add a note about system dependencies for instrumentation pkgs (#2068) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CONTRIBUTING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41f2aa08cb..b79d25492a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,9 +52,13 @@ An easier way to do so is: 2. Run `.tox/lint/bin/isort .` See -[`tox.ini`](https://github.com/open-telemetry/opentelemetry-python/blob/main/tox.ini) +[`tox.ini`](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/tox.ini) for more detail on available tox commands. +### Troubleshooting + +- Some packages may require additional system wide dependencies to be installed. For example, you may need to install `libpq-dev` to run the postgresql client libraries instrumentation tests. or `libsnappy-dev` to run the prometheus exporter tests. If you encounter a build error, please check the installation instructions for the package you are trying to run tests for. + ### Benchmarks Performance progression of benchmarks for packages distributed by OpenTelemetry Python can be viewed as a [graph of throughput vs commit history](https://opentelemetry-python-contrib.readthedocs.io/en/latest/performance/benchmarks.html). From the linked page, you can download a JSON file with the performance results. From 1b1c38d7cd6e503450ec92e1cf54b087ca44f6e0 Mon Sep 17 00:00:00 2001 From: samypr100 <3933065+samypr100@users.noreply.github.com> Date: Tue, 21 Nov 2023 08:45:15 -0500 Subject: [PATCH 076/200] [opentelemetry-instrumentation-httpx] fix mixing of sync and non async hooks (#1920) * fix: sync response hooks being used on httpx.AsyncClient * docs: add changelog * docs: improved docs a bit more * docs: fix variable name --------- Co-authored-by: Diego Hurtado Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 + .../README.rst | 34 +++++++++- .../instrumentation/httpx/__init__.py | 64 +++++++++++++++---- .../tests/test_httpx_integration.py | 36 +++++++++++ 4 files changed, 122 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11e4962c27..fa52f4cde4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-instrumentation` Added Otel semantic convention opt-in mechanism ([#1987](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1987)) +- `opentelemetry-instrumentation-httpx` Fix mixing async and non async hooks + ([#1920](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1920)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-httpx/README.rst b/instrumentation/opentelemetry-instrumentation-httpx/README.rst index 1e03eb128e..cc465dd615 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/README.rst +++ b/instrumentation/opentelemetry-instrumentation-httpx/README.rst @@ -136,7 +136,21 @@ The hooks can be configured as follows: # status_code, headers, stream, extensions = response pass - HTTPXClientInstrumentor().instrument(request_hook=request_hook, response_hook=response_hook) + async def async_request_hook(span, request): + # method, url, headers, stream, extensions = request + pass + + async def async_response_hook(span, request, response): + # method, url, headers, stream, extensions = request + # status_code, headers, stream, extensions = response + pass + + HTTPXClientInstrumentor().instrument( + request_hook=request_hook, + response_hook=response_hook, + async_request_hook=async_request_hook, + async_response_hook=async_response_hook + ) Or if you are using the transport classes directly: @@ -144,7 +158,7 @@ Or if you are using the transport classes directly: .. code-block:: python - from opentelemetry.instrumentation.httpx import SyncOpenTelemetryTransport + from opentelemetry.instrumentation.httpx import SyncOpenTelemetryTransport, AsyncOpenTelemetryTransport def request_hook(span, request): # method, url, headers, stream, extensions = request @@ -155,6 +169,15 @@ Or if you are using the transport classes directly: # status_code, headers, stream, extensions = response pass + async def async_request_hook(span, request): + # method, url, headers, stream, extensions = request + pass + + async def async_response_hook(span, request, response): + # method, url, headers, stream, extensions = request + # status_code, headers, stream, extensions = response + pass + transport = httpx.HTTPTransport() telemetry_transport = SyncOpenTelemetryTransport( transport, @@ -162,6 +185,13 @@ Or if you are using the transport classes directly: response_hook=response_hook ) + async_transport = httpx.AsyncHTTPTransport() + async_telemetry_transport = AsyncOpenTelemetryTransport( + async_transport, + request_hook=async_request_hook, + response_hook=async_response_hook + ) + References ---------- diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py index f5d34b3c40..13b01b6ca3 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -131,7 +131,21 @@ def response_hook(span, request, response): # status_code, headers, stream, extensions = response pass - HTTPXClientInstrumentor().instrument(request_hook=request_hook, response_hook=response_hook) + async def async_request_hook(span, request): + # method, url, headers, stream, extensions = request + pass + + async def async_response_hook(span, request, response): + # method, url, headers, stream, extensions = request + # status_code, headers, stream, extensions = response + pass + + HTTPXClientInstrumentor().instrument( + request_hook=request_hook, + response_hook=response_hook, + async_request_hook=async_request_hook, + async_response_hook=async_response_hook + ) Or if you are using the transport classes directly: @@ -139,7 +153,7 @@ def response_hook(span, request, response): .. code-block:: python - from opentelemetry.instrumentation.httpx import SyncOpenTelemetryTransport + from opentelemetry.instrumentation.httpx import SyncOpenTelemetryTransport, AsyncOpenTelemetryTransport def request_hook(span, request): # method, url, headers, stream, extensions = request @@ -150,6 +164,15 @@ def response_hook(span, request, response): # status_code, headers, stream, extensions = response pass + async def async_request_hook(span, request): + # method, url, headers, stream, extensions = request + pass + + async def async_response_hook(span, request, response): + # method, url, headers, stream, extensions = request + # status_code, headers, stream, extensions = response + pass + transport = httpx.HTTPTransport() telemetry_transport = SyncOpenTelemetryTransport( transport, @@ -157,6 +180,13 @@ def response_hook(span, request, response): response_hook=response_hook ) + async_transport = httpx.AsyncHTTPTransport() + async_telemetry_transport = AsyncOpenTelemetryTransport( + async_transport, + request_hook=async_request_hook, + response_hook=async_response_hook + ) + API --- """ @@ -377,8 +407,8 @@ def __init__( self, transport: httpx.AsyncBaseTransport, tracer_provider: typing.Optional[TracerProvider] = None, - request_hook: typing.Optional[RequestHook] = None, - response_hook: typing.Optional[ResponseHook] = None, + request_hook: typing.Optional[AsyncRequestHook] = None, + response_hook: typing.Optional[AsyncResponseHook] = None, ): self._transport = transport self._tracer = get_tracer( @@ -511,21 +541,27 @@ def _instrument(self, **kwargs): Args: **kwargs: Optional arguments ``tracer_provider``: a TracerProvider, defaults to global - ``request_hook``: A hook that receives the span and request that is called - right after the span is created - ``response_hook``: A hook that receives the span, request, and response - that is called right before the span ends + ``request_hook``: A ``httpx.Client`` hook that receives the span and request + that is called right after the span is created + ``response_hook``: A ``httpx.Client`` hook that receives the span, request, + and response that is called right before the span ends + ``async_request_hook``: Async ``request_hook`` for ``httpx.AsyncClient`` + ``async_response_hook``: Async``response_hook`` for ``httpx.AsyncClient`` """ self._original_client = httpx.Client self._original_async_client = httpx.AsyncClient request_hook = kwargs.get("request_hook") response_hook = kwargs.get("response_hook") + async_request_hook = kwargs.get("async_request_hook", request_hook) + async_response_hook = kwargs.get("async_response_hook", response_hook) if callable(request_hook): _InstrumentedClient._request_hook = request_hook - _InstrumentedAsyncClient._request_hook = request_hook + if callable(async_request_hook): + _InstrumentedAsyncClient._request_hook = async_request_hook if callable(response_hook): _InstrumentedClient._response_hook = response_hook - _InstrumentedAsyncClient._response_hook = response_hook + if callable(async_response_hook): + _InstrumentedAsyncClient._response_hook = async_response_hook tracer_provider = kwargs.get("tracer_provider") _InstrumentedClient._tracer_provider = tracer_provider _InstrumentedAsyncClient._tracer_provider = tracer_provider @@ -546,8 +582,12 @@ def _uninstrument(self, **kwargs): def instrument_client( client: typing.Union[httpx.Client, httpx.AsyncClient], tracer_provider: TracerProvider = None, - request_hook: typing.Optional[RequestHook] = None, - response_hook: typing.Optional[ResponseHook] = None, + request_hook: typing.Union[ + typing.Optional[RequestHook], typing.Optional[AsyncRequestHook] + ] = None, + response_hook: typing.Union[ + typing.Optional[ResponseHook], typing.Optional[AsyncResponseHook] + ] = None, ) -> None: """Instrument httpx Client or AsyncClient diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index daddaad306..db35ab2639 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -421,6 +421,28 @@ def test_response_hook(self): ) HTTPXClientInstrumentor().uninstrument() + def test_response_hook_sync_async_kwargs(self): + HTTPXClientInstrumentor().instrument( + tracer_provider=self.tracer_provider, + response_hook=_response_hook, + async_response_hook=_async_response_hook, + ) + client = self.create_client() + result = self.perform_request(self.URL, client=client) + + self.assertEqual(result.text, "Hello!") + span = self.assert_span() + self.assertEqual( + span.attributes, + { + SpanAttributes.HTTP_METHOD: "GET", + SpanAttributes.HTTP_URL: self.URL, + SpanAttributes.HTTP_STATUS_CODE: 200, + HTTP_RESPONSE_BODY: "Hello!", + }, + ) + HTTPXClientInstrumentor().uninstrument() + def test_request_hook(self): HTTPXClientInstrumentor().instrument( tracer_provider=self.tracer_provider, @@ -434,6 +456,20 @@ def test_request_hook(self): self.assertEqual(span.name, "GET" + self.URL) HTTPXClientInstrumentor().uninstrument() + def test_request_hook_sync_async_kwargs(self): + HTTPXClientInstrumentor().instrument( + tracer_provider=self.tracer_provider, + request_hook=_request_hook, + async_request_hook=_async_request_hook, + ) + client = self.create_client() + result = self.perform_request(self.URL, client=client) + + self.assertEqual(result.text, "Hello!") + span = self.assert_span() + self.assertEqual(span.name, "GET" + self.URL) + HTTPXClientInstrumentor().uninstrument() + def test_request_hook_no_span_update(self): HTTPXClientInstrumentor().instrument( tracer_provider=self.tracer_provider, From b29682b5616f465394679c065c6d0d2519620bc1 Mon Sep 17 00:00:00 2001 From: Bulygin Evgeny <41860443+nesb1@users.noreply.github.com> Date: Mon, 27 Nov 2023 19:22:34 +0500 Subject: [PATCH 077/200] aio-pika instrumentation: Removed check for non-sampled span when inject message header. (#1969) * aio-pika instrumentation: Removed check for non-sampled span when inject message headers. Reason to change is that sampled flag can be propagate https://www.w3.org/TR/trace-context/#sampled-flag and be useful when trace is not sampled. * black formting --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 + .../aio_pika/publish_decorator.py | 3 +- .../tests/test_publish_decorator.py | 61 +++++++++++++++++++ .../instrumentation/pika/utils.py | 11 ++-- .../tests/test_utils.py | 52 +++++++++++++++- 5 files changed, 118 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa52f4cde4..01d9411162 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `opentelemetry-instrumentation-aio-pika` and `opentelemetry-instrumentation-pika` Fix missing trace context propagation when trace not recording. + ([#1969](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1969)) - Fix version of Flask dependency `werkzeug` ([#1980](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980)) - `opentelemetry-resource-detector-azure` Using new Cloud Resource ID attribute. diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/publish_decorator.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/publish_decorator.py index cae834a031..03937290ee 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/publish_decorator.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/publish_decorator.py @@ -45,8 +45,7 @@ async def decorated_publish( if not span: return await publish(message, routing_key, **kwargs) with trace.use_span(span, end_on_exit=True): - if span.is_recording(): - propagate.inject(message.properties.headers) + propagate.inject(message.properties.headers) return_value = await publish(message, routing_key, **kwargs) return return_value diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py b/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py index d5291e07d9..41cd11d5a6 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py @@ -14,6 +14,7 @@ import asyncio from typing import Type from unittest import TestCase, mock, skipIf +from unittest.mock import MagicMock from aio_pika import Exchange, RobustExchange @@ -92,6 +93,36 @@ def test_publish(self): def test_robust_publish(self): self._test_publish(RobustExchange) + def _test_publish_works_with_not_recording_span(self, exchange_type): + exchange = exchange_type(CONNECTION_7, CHANNEL_7, EXCHANGE_NAME) + with mock.patch.object( + PublishDecorator, "_get_publish_span" + ) as mock_get_publish_span: + mocked_not_recording_span = MagicMock() + mocked_not_recording_span.is_recording.return_value = False + mock_get_publish_span.return_value = mocked_not_recording_span + with mock.patch.object( + Exchange, "publish", return_value=asyncio.sleep(0) + ) as mock_publish: + with mock.patch( + "opentelemetry.instrumentation.aio_pika.publish_decorator.propagate.inject" + ) as mock_inject: + decorated_publish = PublishDecorator( + self.tracer, exchange + ).decorate(mock_publish) + self.loop.run_until_complete( + decorated_publish(MESSAGE, ROUTING_KEY) + ) + mock_publish.assert_called_once() + mock_get_publish_span.assert_called_once() + mock_inject.assert_called_once() + + def test_publish_works_with_not_recording_span(self): + self._test_publish_works_with_not_recording_span(Exchange) + + def test_publish_works_with_not_recording_span_robust(self): + self._test_publish_works_with_not_recording_span(RobustExchange) + @skipIf(AIOPIKA_VERSION_INFO <= (8, 0), "Only for aio_pika 8") class TestInstrumentedExchangeAioRmq8(TestCase): @@ -144,3 +175,33 @@ def test_publish(self): def test_robust_publish(self): self._test_publish(RobustExchange) + + def _test_publish_works_with_not_recording_span(self, exchange_type): + exchange = exchange_type(CONNECTION_7, CHANNEL_7, EXCHANGE_NAME) + with mock.patch.object( + PublishDecorator, "_get_publish_span" + ) as mock_get_publish_span: + mocked_not_recording_span = MagicMock() + mocked_not_recording_span.is_recording.return_value = False + mock_get_publish_span.return_value = mocked_not_recording_span + with mock.patch.object( + Exchange, "publish", return_value=asyncio.sleep(0) + ) as mock_publish: + with mock.patch( + "opentelemetry.instrumentation.aio_pika.publish_decorator.propagate.inject" + ) as mock_inject: + decorated_publish = PublishDecorator( + self.tracer, exchange + ).decorate(mock_publish) + self.loop.run_until_complete( + decorated_publish(MESSAGE, ROUTING_KEY) + ) + mock_publish.assert_called_once() + mock_get_publish_span.assert_called_once() + mock_inject.assert_called_once() + + def test_publish_works_with_not_recording_span(self): + self._test_publish_works_with_not_recording_span(Exchange) + + def test_publish_works_with_not_recording_span_robust(self): + self._test_publish_works_with_not_recording_span(RobustExchange) diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py index e9f819f2d6..881149dbac 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py @@ -113,12 +113,11 @@ def decorated_function( exchange, routing_key, body, properties, mandatory ) with trace.use_span(span, end_on_exit=True): - if span.is_recording(): - propagate.inject(properties.headers) - try: - publish_hook(span, body, properties) - except Exception as hook_exception: # pylint: disable=W0703 - _LOG.exception(hook_exception) + propagate.inject(properties.headers) + try: + publish_hook(span, body, properties) + except Exception as hook_exception: # pylint: disable=W0703 + _LOG.exception(hook_exception) retval = original_function( exchange, routing_key, body, properties, mandatory ) diff --git a/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py b/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py index 9b1aed7f49..ed33593389 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py +++ b/instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py @@ -292,7 +292,6 @@ def test_decorate_basic_publish( use_span.assert_called_once_with( get_span.return_value, end_on_exit=True ) - get_span.return_value.is_recording.assert_called_once() inject.assert_called_once_with(properties.headers) callback.assert_called_once_with( exchange_name, routing_key, mock_body, properties, False @@ -323,7 +322,6 @@ def test_decorate_basic_publish_no_properties( use_span.assert_called_once_with( get_span.return_value, end_on_exit=True ) - get_span.return_value.is_recording.assert_called_once() inject.assert_called_once_with(basic_properties.return_value.headers) self.assertEqual(retval, callback.return_value) @@ -393,7 +391,55 @@ def test_decorate_basic_publish_with_hook( use_span.assert_called_once_with( get_span.return_value, end_on_exit=True ) - get_span.return_value.is_recording.assert_called_once() + inject.assert_called_once_with(properties.headers) + publish_hook.assert_called_once_with( + get_span.return_value, mock_body, properties + ) + callback.assert_called_once_with( + exchange_name, routing_key, mock_body, properties, False + ) + self.assertEqual(retval, callback.return_value) + + @mock.patch("opentelemetry.instrumentation.pika.utils._get_span") + @mock.patch("opentelemetry.propagate.inject") + @mock.patch("opentelemetry.trace.use_span") + def test_decorate_basic_publish_when_span_is_not_recording( + self, + use_span: mock.MagicMock, + inject: mock.MagicMock, + get_span: mock.MagicMock, + ) -> None: + callback = mock.MagicMock() + tracer = mock.MagicMock() + channel = mock.MagicMock(spec=Channel) + exchange_name = "test-exchange" + routing_key = "test-routing-key" + properties = mock.MagicMock() + mock_body = b"mock_body" + publish_hook = mock.MagicMock() + + mocked_span = mock.MagicMock() + mocked_span.is_recording.return_value = False + get_span.return_value = mocked_span + + decorated_basic_publish = utils._decorate_basic_publish( + callback, channel, tracer, publish_hook + ) + retval = decorated_basic_publish( + exchange_name, routing_key, mock_body, properties + ) + get_span.assert_called_once_with( + tracer, + channel, + properties, + destination=exchange_name, + span_kind=SpanKind.PRODUCER, + task_name="(temporary)", + operation=None, + ) + use_span.assert_called_once_with( + get_span.return_value, end_on_exit=True + ) inject.assert_called_once_with(properties.headers) publish_hook.assert_called_once_with( get_span.return_value, mock_body, properties From 4336dc7330883f30cca31d0cfd7fc60b2dd77fc2 Mon Sep 17 00:00:00 2001 From: Sean Kenny Date: Tue, 28 Nov 2023 18:38:59 +0000 Subject: [PATCH 078/200] Fix arity of context.abort for AIO RPCs (#2066) --- CHANGELOG.md | 2 + .../instrumentation/grpc/_aio_server.py | 66 ++++++++++++++-- .../tests/test_aio_server_interceptor.py | 79 ++++++++++++++++++- 3 files changed, 136 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01d9411162..192f2ba373 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1987](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1987)) - `opentelemetry-instrumentation-httpx` Fix mixing async and non async hooks ([#1920](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1920)) +- `opentelemetry-instrument-grpc` Fix arity of context.abort for AIO RPCs + ([#2066](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2066)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py index 7c20de0cc0..0db4c36edf 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py @@ -12,13 +12,63 @@ # See the License for the specific language governing permissions and # limitations under the License. +import grpc import grpc.aio - -from ._server import ( - OpenTelemetryServerInterceptor, - _OpenTelemetryServicerContext, - _wrap_rpc_behavior, -) +import wrapt + +from opentelemetry.semconv.trace import SpanAttributes +from opentelemetry.trace.status import Status, StatusCode + +from ._server import OpenTelemetryServerInterceptor, _wrap_rpc_behavior + + +# pylint:disable=abstract-method +class _OpenTelemetryAioServicerContext(wrapt.ObjectProxy): + def __init__(self, servicer_context, active_span): + super().__init__(servicer_context) + self._self_active_span = active_span + self._self_code = grpc.StatusCode.OK + self._self_details = None + + async def abort(self, code, details="", trailing_metadata=tuple()): + self._self_code = code + self._self_details = details + self._self_active_span.set_attribute( + SpanAttributes.RPC_GRPC_STATUS_CODE, code.value[0] + ) + self._self_active_span.set_status( + Status( + status_code=StatusCode.ERROR, + description=f"{code}:{details}", + ) + ) + return await self.__wrapped__.abort(code, details, trailing_metadata) + + def set_code(self, code): + self._self_code = code + details = self._self_details or code.value[1] + self._self_active_span.set_attribute( + SpanAttributes.RPC_GRPC_STATUS_CODE, code.value[0] + ) + if code != grpc.StatusCode.OK: + self._self_active_span.set_status( + Status( + status_code=StatusCode.ERROR, + description=f"{code}:{details}", + ) + ) + return self.__wrapped__.set_code(code) + + def set_details(self, details): + self._self_details = details + if self._self_code != grpc.StatusCode.OK: + self._self_active_span.set_status( + Status( + status_code=StatusCode.ERROR, + description=f"{self._self_code}:{details}", + ) + ) + return self.__wrapped__.set_details(details) class OpenTelemetryAioServerInterceptor( @@ -66,7 +116,7 @@ async def _unary_interceptor(request_or_iterator, context): set_status_on_exception=False, ) as span: # wrap the context - context = _OpenTelemetryServicerContext(context, span) + context = _OpenTelemetryAioServicerContext(context, span) # And now we run the actual RPC. try: @@ -91,7 +141,7 @@ async def _stream_interceptor(request_or_iterator, context): context, set_status_on_exception=False, ) as span: - context = _OpenTelemetryServicerContext(context, span) + context = _OpenTelemetryAioServicerContext(context, span) try: async for response in behavior( diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py index 52391124b7..242295c08c 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py @@ -88,8 +88,11 @@ async def run_with_test_server( channel = grpc.aio.insecure_channel(f"localhost:{port:d}") await server.start() - resp = await runnable(channel) - await server.stop(1000) + + try: + resp = await runnable(channel) + finally: + await server.stop(1000) return resp @@ -514,9 +517,79 @@ async def request(channel): request = Request(client_id=1, request_data=failure_message) msg = request.SerializeToString() - with testcase.assertRaises(Exception): + with testcase.assertRaises(grpc.RpcError) as cm: + await channel.unary_unary(rpc_call)(msg) + + self.assertEqual( + cm.exception.code(), grpc.StatusCode.FAILED_PRECONDITION + ) + self.assertEqual(cm.exception.details(), failure_message) + + await run_with_test_server(request, servicer=AbortServicer()) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + self.assertEqual(span.name, rpc_call) + self.assertIs(span.kind, trace.SpanKind.SERVER) + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.grpc + ) + + # make sure this span errored, with the right status and detail + self.assertEqual(span.status.status_code, StatusCode.ERROR) + self.assertEqual( + span.status.description, + f"{grpc.StatusCode.FAILED_PRECONDITION}:{failure_message}", + ) + + # Check attributes + self.assertSpanHasAttributes( + span, + { + SpanAttributes.NET_PEER_IP: "[::1]", + SpanAttributes.NET_PEER_NAME: "localhost", + SpanAttributes.RPC_METHOD: "SimpleMethod", + SpanAttributes.RPC_SERVICE: "GRPCTestServer", + SpanAttributes.RPC_SYSTEM: "grpc", + SpanAttributes.RPC_GRPC_STATUS_CODE: grpc.StatusCode.FAILED_PRECONDITION.value[ + 0 + ], + }, + ) + + async def test_abort_with_trailing_metadata(self): + """Check that we can catch an abort properly when trailing_metadata provided""" + rpc_call = "/GRPCTestServer/SimpleMethod" + failure_message = "failure message" + + class AbortServicer(GRPCTestServerServicer): + # pylint:disable=C0103 + async def SimpleMethod(self, request, context): + metadata = (("meta", "data"),) + await context.abort( + grpc.StatusCode.FAILED_PRECONDITION, + failure_message, + trailing_metadata=metadata, + ) + + testcase = self + + async def request(channel): + request = Request(client_id=1, request_data=failure_message) + msg = request.SerializeToString() + + with testcase.assertRaises(grpc.RpcError) as cm: await channel.unary_unary(rpc_call)(msg) + self.assertEqual( + cm.exception.code(), grpc.StatusCode.FAILED_PRECONDITION + ) + self.assertEqual(cm.exception.details(), failure_message) + await run_with_test_server(request, servicer=AbortServicer()) spans_list = self.memory_exporter.get_finished_spans() From 4bf3577fb76480dacca12eecd8ed93cb9fccc274 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 29 Nov 2023 14:22:16 -0800 Subject: [PATCH 079/200] Requests instrumentation http semantic convention migration (#2002) --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 4 +- .../instrumentation/requests/__init__.py | 190 +++++++++--- .../tests/test_requests_integration.py | 286 +++++++++++++++++- .../opentelemetry/instrumentation/_semconv.py | 217 +++++++++++++ .../instrumentation/instrumentor.py | 6 +- .../opentelemetry/instrumentation/utils.py | 61 ---- 7 files changed, 651 insertions(+), 115 deletions(-) create mode 100644 opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 64c39745f2..4eba781aff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 9831afaff5b4d371fd9a14266ab47884546bd971 + CORE_REPO_SHA: 35a021194787359324c46f5ca99d31802e4c92bd jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index 192f2ba373..ff63814aa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,13 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1987](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1987)) - `opentelemetry-instrumentation-httpx` Fix mixing async and non async hooks ([#1920](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1920)) +- `opentelemetry-instrumentation-requests` Implement new semantic convention opt-in with stable http semantic conventions + ([#2002](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2002)) - `opentelemetry-instrument-grpc` Fix arity of context.abort for AIO RPCs ([#2066](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2066)) ### Fixed - `opentelemetry-instrumentation-urllib`/`opentelemetry-instrumentation-urllib3` Fix metric descriptions to match semantic conventions - ([#1959]((https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1959)) + ([#1959](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1959)) ## Version 1.21.0/0.42b0 (2023-11-01) diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py index 535b14285f..0a8e4ee729 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -62,6 +62,27 @@ # 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 opentelemetry.instrumentation._semconv import ( + _METRIC_ATTRIBUTES_CLIENT_DURATION_NAME, + _SPAN_ATTRIBUTES_ERROR_TYPE, + _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS, + _SPAN_ATTRIBUTES_NETWORK_PEER_PORT, + _filter_duration_attrs, + _get_schema_url, + _OpenTelemetrySemanticConventionStability, + _OpenTelemetryStabilityMode, + _OpenTelemetryStabilitySignalType, + _report_new, + _report_old, + _set_http_hostname, + _set_http_method, + _set_http_net_peer_name, + _set_http_network_protocol_version, + _set_http_port, + _set_http_scheme, + _set_http_status_code, + _set_http_url, +) from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.requests.package import _instruments from opentelemetry.instrumentation.requests.version import __version__ @@ -72,15 +93,15 @@ from opentelemetry.metrics import Histogram, get_meter from opentelemetry.propagate import inject from opentelemetry.semconv.metrics import MetricInstruments -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 opentelemetry.trace.status import StatusCode from opentelemetry.util.http import ( ExcludeList, get_excluded_urls, parse_excluded_urls, remove_url_credentials, + sanitize_method, ) from opentelemetry.util.http.httplib import set_ip_on_next_http_connection @@ -94,10 +115,12 @@ # pylint: disable=R0915 def _instrument( tracer: Tracer, - duration_histogram: Histogram, + duration_histogram_old: Histogram, + duration_histogram_new: Histogram, request_hook: _RequestHookT = None, response_hook: _ResponseHookT = None, excluded_urls: ExcludeList = None, + sem_conv_opt_in_mode: _OpenTelemetryStabilityMode = _OpenTelemetryStabilityMode.DEFAULT, ): """Enables tracing of all requests calls that go through :code:`requests.session.Session.request` (this includes @@ -132,31 +155,58 @@ def get_or_create_headers(): return wrapped_send(self, request, **kwargs) # See - # https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-client - method = request.method.upper() + # https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-client + method = request.method span_name = get_default_span_name(method) url = remove_url_credentials(request.url) - span_attributes = { - SpanAttributes.HTTP_METHOD: method, - SpanAttributes.HTTP_URL: url, - } + span_attributes = {} + _set_http_method( + span_attributes, method, span_name, sem_conv_opt_in_mode + ) + _set_http_url(span_attributes, url, sem_conv_opt_in_mode) - metric_labels = { - SpanAttributes.HTTP_METHOD: method, - } + metric_labels = {} + _set_http_method( + metric_labels, method, span_name, sem_conv_opt_in_mode + ) try: parsed_url = urlparse(url) - metric_labels[SpanAttributes.HTTP_SCHEME] = parsed_url.scheme + if parsed_url.scheme: + _set_http_scheme( + metric_labels, parsed_url.scheme, sem_conv_opt_in_mode + ) if parsed_url.hostname: - metric_labels[SpanAttributes.HTTP_HOST] = parsed_url.hostname - metric_labels[ - SpanAttributes.NET_PEER_NAME - ] = parsed_url.hostname + _set_http_hostname( + metric_labels, parsed_url.hostname, sem_conv_opt_in_mode + ) + _set_http_net_peer_name( + metric_labels, parsed_url.hostname, sem_conv_opt_in_mode + ) + if _report_new(sem_conv_opt_in_mode): + _set_http_hostname( + span_attributes, + parsed_url.hostname, + sem_conv_opt_in_mode, + ) + # Use semconv library when available + span_attributes[ + _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS + ] = parsed_url.hostname if parsed_url.port: - metric_labels[SpanAttributes.NET_PEER_PORT] = parsed_url.port + _set_http_port( + metric_labels, parsed_url.port, sem_conv_opt_in_mode + ) + if _report_new(sem_conv_opt_in_mode): + _set_http_port( + span_attributes, parsed_url.port, sem_conv_opt_in_mode + ) + # Use semconv library when available + span_attributes[ + _SPAN_ATTRIBUTES_NETWORK_PEER_PORT + ] = parsed_url.port except ValueError: pass @@ -182,35 +232,78 @@ def get_or_create_headers(): exception = exc result = getattr(exc, "response", None) finally: - elapsed_time = max( - round((default_timer() - start_time) * 1000), 0 - ) + elapsed_time = max(default_timer() - start_time, 0) context.detach(token) if isinstance(result, Response): + span_attributes = {} if span.is_recording(): - span.set_attribute( - SpanAttributes.HTTP_STATUS_CODE, result.status_code + _set_http_status_code( + span_attributes, + result.status_code, + sem_conv_opt_in_mode, ) - span.set_status( - Status(http_status_to_status_code(result.status_code)) + _set_http_status_code( + metric_labels, result.status_code, sem_conv_opt_in_mode ) - - metric_labels[ - SpanAttributes.HTTP_STATUS_CODE - ] = result.status_code + status_code = http_status_to_status_code( + result.status_code + ) + span.set_status(status_code) + if ( + _report_new(sem_conv_opt_in_mode) + and status_code is StatusCode.ERROR + ): + span_attributes[_SPAN_ATTRIBUTES_ERROR_TYPE] = str( + result.status_code + ) + metric_labels[_SPAN_ATTRIBUTES_ERROR_TYPE] = str( + result.status_code + ) if result.raw is not None: version = getattr(result.raw, "version", None) if version: - metric_labels[SpanAttributes.HTTP_FLAVOR] = ( - "1.1" if version == 11 else "1.0" + # Only HTTP/1 is supported by requests + version_text = "1.1" if version == 11 else "1.0" + _set_http_network_protocol_version( + metric_labels, version_text, sem_conv_opt_in_mode ) + if _report_new(sem_conv_opt_in_mode): + _set_http_network_protocol_version( + span_attributes, + version_text, + sem_conv_opt_in_mode, + ) + for key, val in span_attributes.items(): + span.set_attribute(key, val) if callable(response_hook): response_hook(span, request, result) - duration_histogram.record(elapsed_time, attributes=metric_labels) + if exception is not None and _report_new(sem_conv_opt_in_mode): + span.set_attribute( + _SPAN_ATTRIBUTES_ERROR_TYPE, type(exception).__qualname__ + ) + metric_labels[_SPAN_ATTRIBUTES_ERROR_TYPE] = type( + exception + ).__qualname__ + + if duration_histogram_old is not None: + duration_attrs_old = _filter_duration_attrs( + metric_labels, _OpenTelemetryStabilityMode.DEFAULT + ) + duration_histogram_old.record( + max(round(elapsed_time * 1000), 0), + attributes=duration_attrs_old, + ) + if duration_histogram_new is not None: + duration_attrs_new = _filter_duration_attrs( + metric_labels, _OpenTelemetryStabilityMode.HTTP + ) + duration_histogram_new.record( + elapsed_time, attributes=duration_attrs_new + ) if exception is not None: raise exception.with_traceback(exception.__traceback__) @@ -254,7 +347,7 @@ def get_default_span_name(method): Returns: span name """ - return method.strip() + return sanitize_method(method.upper().strip()) class RequestsInstrumentor(BaseInstrumentor): @@ -276,12 +369,16 @@ def _instrument(self, **kwargs): ``excluded_urls``: A string containing a comma-delimited list of regexes used to exclude URLs from tracking """ + semconv_opt_in_mode = _OpenTelemetrySemanticConventionStability._get_opentelemetry_stability_opt_in_mode( + _OpenTelemetryStabilitySignalType.HTTP, + ) + schema_url = _get_schema_url(semconv_opt_in_mode) tracer_provider = kwargs.get("tracer_provider") tracer = get_tracer( __name__, __version__, tracer_provider, - schema_url="https://opentelemetry.io/schemas/1.11.0", + schema_url=schema_url, ) excluded_urls = kwargs.get("excluded_urls") meter_provider = kwargs.get("meter_provider") @@ -289,21 +386,32 @@ def _instrument(self, **kwargs): __name__, __version__, meter_provider, - schema_url="https://opentelemetry.io/schemas/1.11.0", - ) - duration_histogram = meter.create_histogram( - name=MetricInstruments.HTTP_CLIENT_DURATION, - unit="ms", - description="measures the duration of the outbound HTTP request", + schema_url=schema_url, ) + duration_histogram_old = None + if _report_old(semconv_opt_in_mode): + duration_histogram_old = meter.create_histogram( + name=MetricInstruments.HTTP_CLIENT_DURATION, + unit="ms", + description="measures the duration of the outbound HTTP request", + ) + duration_histogram_new = None + if _report_new(semconv_opt_in_mode): + duration_histogram_new = meter.create_histogram( + name=_METRIC_ATTRIBUTES_CLIENT_DURATION_NAME, + unit="s", + description="Duration of HTTP client requests.", + ) _instrument( tracer, - duration_histogram, + duration_histogram_old, + duration_histogram_new, 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), + sem_conv_opt_in_mode=semconv_opt_in_mode, ) def _uninstrument(self, **kwargs): diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py index 82fa4ed1e6..11eada2589 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py @@ -25,6 +25,13 @@ # 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 opentelemetry.instrumentation._semconv import ( + _OTEL_SEMCONV_STABILITY_OPT_IN_KEY, + _SPAN_ATTRIBUTES_ERROR_TYPE, + _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS, + _SPAN_ATTRIBUTES_NETWORK_PEER_PORT, + _OpenTelemetrySemanticConventionStability, +) from opentelemetry.instrumentation.requests import RequestsInstrumentor from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY from opentelemetry.propagate import get_global_textmap, set_global_textmap @@ -69,12 +76,24 @@ class RequestsIntegrationTestBase(abc.ABC): def setUp(self): super().setUp() + test_name = "" + if hasattr(self, "_testMethodName"): + test_name = self._testMethodName + sem_conv_mode = "default" + if "new_semconv" in test_name: + sem_conv_mode = "http" + elif "both_semconv" in test_name: + sem_conv_mode = "http/dup" self.env_patch = mock.patch.dict( "os.environ", { - "OTEL_PYTHON_REQUESTS_EXCLUDED_URLS": "http://localhost/env_excluded_arg/123,env_excluded_noarg" + "OTEL_PYTHON_REQUESTS_EXCLUDED_URLS": "http://localhost/env_excluded_arg/123,env_excluded_noarg", + _OTEL_SEMCONV_STABILITY_OPT_IN_KEY: sem_conv_mode, }, ) + + _OpenTelemetrySemanticConventionStability._initialized = False + self.env_patch.start() self.exclude_patch = mock.patch( @@ -118,6 +137,11 @@ def test_basic(self): self.assertIs(span.kind, trace.SpanKind.CLIENT) self.assertEqual(span.name, "GET") + self.assertEqual( + span.instrumentation_scope.schema_url, + "https://opentelemetry.io/schemas/1.11.0", + ) + self.assertEqual( span.attributes, { @@ -133,6 +157,84 @@ def test_basic(self): span, opentelemetry.instrumentation.requests ) + def test_basic_new_semconv(self): + url_with_port = "http://mock:80/status/200" + httpretty.register_uri( + httpretty.GET, url_with_port, status=200, body="Hello!" + ) + result = self.perform_request(url_with_port) + self.assertEqual(result.text, "Hello!") + span = self.assert_span() + + self.assertIs(span.kind, trace.SpanKind.CLIENT) + self.assertEqual(span.name, "GET") + + self.assertEqual( + span.instrumentation_scope.schema_url, + SpanAttributes.SCHEMA_URL, + ) + self.assertEqual( + span.attributes, + { + SpanAttributes.HTTP_REQUEST_METHOD: "GET", + SpanAttributes.URL_FULL: url_with_port, + SpanAttributes.SERVER_ADDRESS: "mock", + _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS: "mock", + SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, + SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", + SpanAttributes.SERVER_PORT: 80, + _SPAN_ATTRIBUTES_NETWORK_PEER_PORT: 80, + }, + ) + + self.assertIs(span.status.status_code, trace.StatusCode.UNSET) + + self.assertEqualSpanInstrumentationScope( + span, opentelemetry.instrumentation.requests + ) + + def test_basic_both_semconv(self): + url_with_port = "http://mock:80/status/200" + httpretty.register_uri( + httpretty.GET, url_with_port, status=200, body="Hello!" + ) + result = self.perform_request(url_with_port) + self.assertEqual(result.text, "Hello!") + span = self.assert_span() + + self.assertIs(span.kind, trace.SpanKind.CLIENT) + self.assertEqual(span.name, "GET") + + self.assertEqual( + span.instrumentation_scope.schema_url, + SpanAttributes.SCHEMA_URL, + ) + self.assertEqual( + span.attributes, + { + SpanAttributes.HTTP_METHOD: "GET", + SpanAttributes.HTTP_REQUEST_METHOD: "GET", + SpanAttributes.HTTP_URL: url_with_port, + SpanAttributes.URL_FULL: url_with_port, + SpanAttributes.HTTP_HOST: "mock", + SpanAttributes.SERVER_ADDRESS: "mock", + _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS: "mock", + SpanAttributes.NET_PEER_PORT: 80, + SpanAttributes.HTTP_STATUS_CODE: 200, + SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, + SpanAttributes.HTTP_FLAVOR: "1.1", + SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", + SpanAttributes.SERVER_PORT: 80, + _SPAN_ATTRIBUTES_NETWORK_PEER_PORT: 80, + }, + ) + + self.assertIs(span.status.status_code, trace.StatusCode.UNSET) + + self.assertEqualSpanInstrumentationScope( + span, opentelemetry.instrumentation.requests + ) + def test_hooks(self): def request_hook(span, request_obj): span.update_name("name set from hook") @@ -214,6 +316,57 @@ def test_not_foundbasic(self): trace.StatusCode.ERROR, ) + def test_not_foundbasic_new_semconv(self): + url_404 = "http://mock/status/404" + httpretty.register_uri( + httpretty.GET, + url_404, + status=404, + ) + result = self.perform_request(url_404) + self.assertEqual(result.status_code, 404) + + span = self.assert_span() + + self.assertEqual( + span.attributes.get(SpanAttributes.HTTP_RESPONSE_STATUS_CODE), 404 + ) + self.assertEqual( + span.attributes.get(_SPAN_ATTRIBUTES_ERROR_TYPE), "404" + ) + + self.assertIs( + span.status.status_code, + trace.StatusCode.ERROR, + ) + + def test_not_foundbasic_both_semconv(self): + url_404 = "http://mock/status/404" + httpretty.register_uri( + httpretty.GET, + url_404, + status=404, + ) + result = self.perform_request(url_404) + self.assertEqual(result.status_code, 404) + + span = self.assert_span() + + self.assertEqual( + span.attributes.get(SpanAttributes.HTTP_STATUS_CODE), 404 + ) + self.assertEqual( + span.attributes.get(SpanAttributes.HTTP_RESPONSE_STATUS_CODE), 404 + ) + self.assertEqual( + span.attributes.get(_SPAN_ATTRIBUTES_ERROR_TYPE), "404" + ) + + self.assertIs( + span.status.status_code, + trace.StatusCode.ERROR, + ) + def test_uninstrument(self): RequestsInstrumentor().uninstrument() result = self.perform_request(self.URL) @@ -368,6 +521,34 @@ def test_requests_exception_without_response(self, *_, **__): ) self.assertEqual(span.status.status_code, StatusCode.ERROR) + @mock.patch( + "requests.adapters.HTTPAdapter.send", + side_effect=requests.RequestException, + ) + def test_requests_exception_new_semconv(self, *_, **__): + url_with_port = "http://mock:80/status/200" + httpretty.register_uri( + httpretty.GET, url_with_port, status=200, body="Hello!" + ) + with self.assertRaises(requests.RequestException): + self.perform_request(url_with_port) + + span = self.assert_span() + print(span.attributes) + self.assertEqual( + span.attributes, + { + SpanAttributes.HTTP_REQUEST_METHOD: "GET", + SpanAttributes.URL_FULL: url_with_port, + SpanAttributes.SERVER_ADDRESS: "mock", + SpanAttributes.SERVER_PORT: 80, + _SPAN_ATTRIBUTES_NETWORK_PEER_PORT: 80, + _SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS: "mock", + _SPAN_ATTRIBUTES_ERROR_TYPE: "RequestException", + }, + ) + self.assertEqual(span.status.status_code, StatusCode.ERROR) + mocked_response = requests.Response() mocked_response.status_code = 500 mocked_response.reason = "Internal Server Error" @@ -489,6 +670,22 @@ class TestRequestsIntergrationMetric(TestBase): def setUp(self): super().setUp() + test_name = "" + if hasattr(self, "_testMethodName"): + test_name = self._testMethodName + sem_conv_mode = "default" + if "new_semconv" in test_name: + sem_conv_mode = "http" + elif "both_semconv" in test_name: + sem_conv_mode = "http/dup" + self.env_patch = mock.patch.dict( + "os.environ", + { + _OTEL_SEMCONV_STABILITY_OPT_IN_KEY: sem_conv_mode, + }, + ) + self.env_patch.start() + _OpenTelemetrySemanticConventionStability._initialized = False RequestsInstrumentor().instrument(meter_provider=self.meter_provider) httpretty.enable() @@ -496,6 +693,7 @@ def setUp(self): def tearDown(self): super().tearDown() + self.env_patch.stop() RequestsInstrumentor().uninstrument() httpretty.disable() @@ -507,22 +705,94 @@ def test_basic_metric_success(self): self.perform_request(self.URL) expected_attributes = { - "http.status_code": 200, - "http.host": "examplehost", - "net.peer.port": 8000, - "net.peer.name": "examplehost", - "http.method": "GET", - "http.flavor": "1.1", - "http.scheme": "http", + SpanAttributes.HTTP_STATUS_CODE: 200, + SpanAttributes.HTTP_HOST: "examplehost", + SpanAttributes.NET_PEER_PORT: 8000, + SpanAttributes.NET_PEER_NAME: "examplehost", + SpanAttributes.HTTP_METHOD: "GET", + SpanAttributes.HTTP_FLAVOR: "1.1", + SpanAttributes.HTTP_SCHEME: "http", } for ( resource_metrics ) in self.memory_metrics_reader.get_metrics_data().resource_metrics: for scope_metrics in resource_metrics.scope_metrics: + self.assertEqual(len(scope_metrics.metrics), 1) + for metric in scope_metrics.metrics: + self.assertEqual(metric.unit, "ms") + self.assertEqual( + metric.description, + "measures the duration of the outbound HTTP request", + ) + for data_point in metric.data.data_points: + self.assertDictEqual( + expected_attributes, dict(data_point.attributes) + ) + self.assertEqual(data_point.count, 1) + + def test_basic_metric_new_semconv(self): + self.perform_request(self.URL) + + expected_attributes = { + SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, + SpanAttributes.SERVER_ADDRESS: "examplehost", + SpanAttributes.SERVER_PORT: 8000, + SpanAttributes.HTTP_REQUEST_METHOD: "GET", + SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", + } + for ( + resource_metrics + ) in self.memory_metrics_reader.get_metrics_data().resource_metrics: + for scope_metrics in resource_metrics.scope_metrics: + self.assertEqual(len(scope_metrics.metrics), 1) for metric in scope_metrics.metrics: + self.assertEqual(metric.unit, "s") + self.assertEqual( + metric.description, "Duration of HTTP client requests." + ) for data_point in metric.data.data_points: self.assertDictEqual( expected_attributes, dict(data_point.attributes) ) self.assertEqual(data_point.count, 1) + + def test_basic_metric_both_semconv(self): + self.perform_request(self.URL) + + expected_attributes_old = { + SpanAttributes.HTTP_STATUS_CODE: 200, + SpanAttributes.HTTP_HOST: "examplehost", + SpanAttributes.NET_PEER_PORT: 8000, + SpanAttributes.NET_PEER_NAME: "examplehost", + SpanAttributes.HTTP_METHOD: "GET", + SpanAttributes.HTTP_FLAVOR: "1.1", + SpanAttributes.HTTP_SCHEME: "http", + } + + expected_attributes_new = { + SpanAttributes.HTTP_RESPONSE_STATUS_CODE: 200, + SpanAttributes.SERVER_ADDRESS: "examplehost", + SpanAttributes.SERVER_PORT: 8000, + SpanAttributes.HTTP_REQUEST_METHOD: "GET", + SpanAttributes.NETWORK_PROTOCOL_VERSION: "1.1", + } + + for ( + resource_metrics + ) in self.memory_metrics_reader.get_metrics_data().resource_metrics: + for scope_metrics in resource_metrics.scope_metrics: + self.assertEqual(len(scope_metrics.metrics), 2) + for metric in scope_metrics.metrics: + for data_point in metric.data.data_points: + if metric.unit == "ms": + self.assertDictEqual( + expected_attributes_old, + dict(data_point.attributes), + ) + else: + self.assertDictEqual( + expected_attributes_new, + dict(data_point.attributes), + ) + self.assertEqual(data_point.count, 1) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py new file mode 100644 index 0000000000..fbfc92cf21 --- /dev/null +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py @@ -0,0 +1,217 @@ +# 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. + +import os +import threading +from enum import Enum + +from opentelemetry.semconv.trace import SpanAttributes + +# TODO: will come through semconv package once updated +_SPAN_ATTRIBUTES_ERROR_TYPE = "error.type" +_SPAN_ATTRIBUTES_NETWORK_PEER_ADDRESS = "network.peer.address" +_SPAN_ATTRIBUTES_NETWORK_PEER_PORT = "network.peer.port" +_METRIC_ATTRIBUTES_CLIENT_DURATION_NAME = "http.client.request.duration" + +_client_duration_attrs_old = [ + SpanAttributes.HTTP_STATUS_CODE, + SpanAttributes.HTTP_HOST, + SpanAttributes.NET_PEER_PORT, + SpanAttributes.NET_PEER_NAME, + SpanAttributes.HTTP_METHOD, + SpanAttributes.HTTP_FLAVOR, + SpanAttributes.HTTP_SCHEME, +] + +_client_duration_attrs_new = [ + _SPAN_ATTRIBUTES_ERROR_TYPE, + SpanAttributes.HTTP_REQUEST_METHOD, + SpanAttributes.HTTP_RESPONSE_STATUS_CODE, + SpanAttributes.NETWORK_PROTOCOL_VERSION, + SpanAttributes.SERVER_ADDRESS, + SpanAttributes.SERVER_PORT, + # TODO: Support opt-in for scheme in new semconv + # SpanAttributes.URL_SCHEME, +] + + +def _filter_duration_attrs(attrs, sem_conv_opt_in_mode): + filtered_attrs = {} + allowed_attributes = ( + _client_duration_attrs_new + if sem_conv_opt_in_mode == _OpenTelemetryStabilityMode.HTTP + else _client_duration_attrs_old + ) + for key, val in attrs.items(): + if key in allowed_attributes: + filtered_attrs[key] = val + return filtered_attrs + + +def set_string_attribute(result, key, value): + if value: + result[key] = value + + +def set_int_attribute(result, key, value): + if value: + try: + result[key] = int(value) + except ValueError: + return + + +def _set_http_method(result, original, normalized, sem_conv_opt_in_mode): + original = original.strip() + normalized = normalized.strip() + # See https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#common-attributes + # Method is case sensitive. "http.request.method_original" should not be sanitized or automatically capitalized. + if original != normalized and _report_new(sem_conv_opt_in_mode): + set_string_attribute( + result, SpanAttributes.HTTP_REQUEST_METHOD_ORIGINAL, original + ) + + if _report_old(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.HTTP_METHOD, normalized) + if _report_new(sem_conv_opt_in_mode): + set_string_attribute( + result, SpanAttributes.HTTP_REQUEST_METHOD, normalized + ) + + +def _set_http_url(result, url, sem_conv_opt_in_mode): + if _report_old(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.HTTP_URL, url) + if _report_new(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.URL_FULL, url) + + +def _set_http_scheme(result, scheme, sem_conv_opt_in_mode): + if _report_old(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.HTTP_SCHEME, scheme) + # TODO: Support opt-in for scheme in new semconv + # if _report_new(sem_conv_opt_in_mode): + # set_string_attribute(result, SpanAttributes.URL_SCHEME, scheme) + + +def _set_http_hostname(result, hostname, sem_conv_opt_in_mode): + if _report_old(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.HTTP_HOST, hostname) + if _report_new(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.SERVER_ADDRESS, hostname) + + +def _set_http_net_peer_name(result, peer_name, sem_conv_opt_in_mode): + if _report_old(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.NET_PEER_NAME, peer_name) + if _report_new(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.SERVER_ADDRESS, peer_name) + + +def _set_http_port(result, port, sem_conv_opt_in_mode): + if _report_old(sem_conv_opt_in_mode): + set_int_attribute(result, SpanAttributes.NET_PEER_PORT, port) + if _report_new(sem_conv_opt_in_mode): + set_int_attribute(result, SpanAttributes.SERVER_PORT, port) + + +def _set_http_status_code(result, code, sem_conv_opt_in_mode): + if _report_old(sem_conv_opt_in_mode): + set_int_attribute(result, SpanAttributes.HTTP_STATUS_CODE, code) + if _report_new(sem_conv_opt_in_mode): + set_int_attribute( + result, SpanAttributes.HTTP_RESPONSE_STATUS_CODE, code + ) + + +def _set_http_network_protocol_version(result, version, sem_conv_opt_in_mode): + if _report_old(sem_conv_opt_in_mode): + set_string_attribute(result, SpanAttributes.HTTP_FLAVOR, version) + if _report_new(sem_conv_opt_in_mode): + set_string_attribute( + result, SpanAttributes.NETWORK_PROTOCOL_VERSION, version + ) + + +_OTEL_SEMCONV_STABILITY_OPT_IN_KEY = "OTEL_SEMCONV_STABILITY_OPT_IN" + + +class _OpenTelemetryStabilitySignalType: + HTTP = "http" + + +class _OpenTelemetryStabilityMode(Enum): + # http - emit the new, stable HTTP and networking conventions ONLY + HTTP = "http" + # http/dup - emit both the old and the stable HTTP and networking conventions + HTTP_DUP = "http/dup" + # default - continue emitting old experimental HTTP and networking conventions + DEFAULT = "default" + + +def _report_new(mode): + return mode.name != _OpenTelemetryStabilityMode.DEFAULT.name + + +def _report_old(mode): + return mode.name != _OpenTelemetryStabilityMode.HTTP.name + + +class _OpenTelemetrySemanticConventionStability: + _initialized = False + _lock = threading.Lock() + _OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING = {} + + @classmethod + def _initialize(cls): + with _OpenTelemetrySemanticConventionStability._lock: + if not _OpenTelemetrySemanticConventionStability._initialized: + # Users can pass in comma delimited string for opt-in options + # Only values for http stability are supported for now + opt_in = os.environ.get(_OTEL_SEMCONV_STABILITY_OPT_IN_KEY, "") + opt_in_list = [] + if opt_in: + opt_in_list = [s.strip() for s in opt_in.split(",")] + http_opt_in = _OpenTelemetryStabilityMode.DEFAULT + if opt_in_list: + # Process http opt-in + # http/dup takes priority over http + if ( + _OpenTelemetryStabilityMode.HTTP_DUP.value + in opt_in_list + ): + http_opt_in = _OpenTelemetryStabilityMode.HTTP_DUP + elif _OpenTelemetryStabilityMode.HTTP.value in opt_in_list: + http_opt_in = _OpenTelemetryStabilityMode.HTTP + _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[ + _OpenTelemetryStabilitySignalType.HTTP + ] = http_opt_in + _OpenTelemetrySemanticConventionStability._initialized = True + + @classmethod + # Get OpenTelemetry opt-in mode based off of signal type (http, messaging, etc.) + def _get_opentelemetry_stability_opt_in_mode( + cls, + signal_type: _OpenTelemetryStabilitySignalType, + ) -> _OpenTelemetryStabilityMode: + return _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING.get( + signal_type, _OpenTelemetryStabilityMode.DEFAULT + ) + + +# Get schema version based off of opt-in mode +def _get_schema_url(mode: _OpenTelemetryStabilityMode) -> str: + if mode is _OpenTelemetryStabilityMode.DEFAULT: + return "https://opentelemetry.io/schemas/1.11.0" + return SpanAttributes.SCHEMA_URL diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py index 6c6f86fd51..c612bfeceb 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py @@ -21,13 +21,13 @@ from logging import getLogger from typing import Collection, Optional +from opentelemetry.instrumentation._semconv import ( + _OpenTelemetrySemanticConventionStability, +) from opentelemetry.instrumentation.dependencies import ( DependencyConflict, get_dependency_conflicts, ) -from opentelemetry.instrumentation.utils import ( - _OpenTelemetrySemanticConventionStability, -) _LOG = getLogger(__name__) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py index 71a0087149..35a55a1279 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import threading import urllib.parse -from enum import Enum from re import escape, sub from typing import Dict, Sequence @@ -155,61 +152,3 @@ def _python_path_without_directory(python_path, directory, path_separator): "", python_path, ) - - -_OTEL_SEMCONV_STABILITY_OPT_IN_KEY = "OTEL_SEMCONV_STABILITY_OPT_IN" - - -class _OpenTelemetryStabilitySignalType: - HTTP = "http" - - -class _OpenTelemetryStabilityMode(Enum): - # http - emit the new, stable HTTP and networking conventions ONLY - HTTP = "http" - # http/dup - emit both the old and the stable HTTP and networking conventions - HTTP_DUP = "http/dup" - # default - continue emitting old experimental HTTP and networking conventions - DEFAULT = "default" - - -class _OpenTelemetrySemanticConventionStability: - _initialized = False - _lock = threading.Lock() - _OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING = {} - - @classmethod - def _initialize(cls): - with _OpenTelemetrySemanticConventionStability._lock: - if not _OpenTelemetrySemanticConventionStability._initialized: - # Users can pass in comma delimited string for opt-in options - # Only values for http stability are supported for now - opt_in = os.environ.get(_OTEL_SEMCONV_STABILITY_OPT_IN_KEY, "") - opt_in_list = [] - if opt_in: - opt_in_list = [s.strip() for s in opt_in.split(",")] - http_opt_in = _OpenTelemetryStabilityMode.DEFAULT - if opt_in_list: - # Process http opt-in - # http/dup takes priority over http - if ( - _OpenTelemetryStabilityMode.HTTP_DUP.value - in opt_in_list - ): - http_opt_in = _OpenTelemetryStabilityMode.HTTP_DUP - elif _OpenTelemetryStabilityMode.HTTP.value in opt_in_list: - http_opt_in = _OpenTelemetryStabilityMode.HTTP - _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[ - _OpenTelemetryStabilitySignalType.HTTP - ] = http_opt_in - _OpenTelemetrySemanticConventionStability._initialized = True - - @classmethod - def _get_opentelemetry_stability_opt_in( - cls, - signal_type: _OpenTelemetryStabilitySignalType, - ) -> _OpenTelemetryStabilityMode: - with _OpenTelemetrySemanticConventionStability._lock: - return _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING.get( - signal_type, _OpenTelemetryStabilityMode.DEFAULT - ) From b6c11054b9f3237eab143d536b072ff3df8dc970 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 13 Dec 2023 20:58:54 -0600 Subject: [PATCH 080/200] Fix Falcon dependency (#2090) Fixes #2089 --- .../opentelemetry-instrumentation-falcon/pyproject.toml | 2 +- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 0d5114b4eb..214c5617e1 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "falcon >= 1.4.1, < 4.0.0", + "falcon >= 1.4.1, < 3.1.2", ] test = [ "opentelemetry-instrumentation-falcon[instruments]", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index dc386cf9cc..225004b51e 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -77,7 +77,7 @@ "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.43b0.dev", }, { - "library": "falcon >= 1.4.1, < 4.0.0", + "library": "falcon >= 1.4.1, < 3.1.2", "instrumentation": "opentelemetry-instrumentation-falcon==0.43b0.dev", }, { From 772063ca8a4ac47b45301837e5b3f6f0a8edbe0a Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Fri, 15 Dec 2023 23:54:11 +0100 Subject: [PATCH 081/200] Update version to 1.23.0.dev/0.44b0.dev (#2091) * Update version to 1.23.0.dev/0.44b0.dev * Update core SHA * Update generate --------- Co-authored-by: Diego Hurtado --- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + _template/version.py | 2 +- eachdist.ini | 4 +- .../prometheus_remote_write/version.py | 2 +- .../pyproject.toml | 2 +- .../exporter/richconsole/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/aio_pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_client/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_server/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/aiopg/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/asgi/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncpg/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aws_lambda/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto3sqs/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/botocore/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/cassandra/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/celery/version.py | 2 +- .../confluent_kafka/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/dbapi/version.py | 2 +- .../pyproject.toml | 12 +-- .../instrumentation/django/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/elasticsearch/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/falcon/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/fastapi/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/flask/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/grpc/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/httpx/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/jinja2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/kafka/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/logging/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysql/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysqlclient/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/psycopg2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymemcache/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymongo/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymysql/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/pyramid/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/redis/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/remoulade/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/requests/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sklearn/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlalchemy/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/sqlite3/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/starlette/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/system_metrics/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/tornado/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/tortoiseorm/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib3/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/wsgi/version.py | 2 +- .../pyproject.toml | 90 ++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 96 +++++++++---------- .../opentelemetry/instrumentation/version.py | 2 +- .../propagators/ot_trace/version.py | 2 +- .../resource/detector/container/version.py | 2 +- .../src/opentelemetry/util/http/version.py | 2 +- 105 files changed, 297 insertions(+), 295 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4eba781aff..3cf2e3c6b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 35a021194787359324c46f5ca99d31802e4c92bd + CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150 jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index ff63814aa1..9e39bc3090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## Version 1.22.0/0.43b0 (2023-12-14) + ### Added - `opentelemetry-instrumentation` Added Otel semantic convention opt-in mechanism diff --git a/_template/version.py b/_template/version.py index 2e4aa8c751..ff896307c3 100644 --- a/_template/version.py +++ b/_template/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/eachdist.ini b/eachdist.ini index 2884f8608d..5c6531ca65 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.22.0.dev +version=1.23.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.43b0.dev +version=0.44b0.dev packages= all diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py index 2e4aa8c751..ff896307c3 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index b2e7c7fc28..a01fe86280 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "rich>=10.0.0", ] diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py index 2e4aa8c751..ff896307c3 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index ee87d4303b..237c812215 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aio-pika[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index d35b3326fa..9ebd730766 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py index 0d568a8987..65fe1deedd 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index bc3372bfc6..d0d2d599fb 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index cddbf583ca..31115fe81f 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-dbapi == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-dbapi == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,8 +37,8 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index 2813274ace..89c0334b36 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -27,9 +27,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asgi[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 17be9fd807..5f39b7595c 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asyncpg[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index f1c17410f8..4ee7da2d15 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -22,15 +22,15 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 559fdc5cac..c4f1c7fe9b 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ test = [ "opentelemetry-instrumentation-boto[instruments]", "markupsafe==2.0.1", "moto~=2.0", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 21628ef70c..c582a77491 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-boto3sqs[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 702723015e..d7c9fd3968 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", ] @@ -40,7 +40,7 @@ test = [ "markupsafe==2.0.1", "botocore ~= 1.0, < 1.31.81", "moto[all] ~= 2.2.6", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index a9f6b76310..faace7671b 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-cassandra[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index ff39e54d8f..136d645394 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-celery[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "pytest", ] diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index 2f866514c8..a3bfeaf1a7 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py index 633040fa58..6ce2e661e7 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index d27e4a400c..9bae86cb03 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -26,22 +26,22 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-wsgi == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-wsgi == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.43b0.dev", + "opentelemetry-instrumentation-asgi == 0.44b0.dev", ] instruments = [ "django >= 1.10", ] test = [ "opentelemetry-instrumentation-django[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index 0d1bb6adcc..e56b3c5333 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-elasticsearch[instruments]", "elasticsearch-dsl >= 2.0", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 214c5617e1..04a57a918b 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-wsgi == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-wsgi == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", "packaging >= 20.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-falcon[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "parameterized == 0.7.4", ] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 7abead865e..73d65bb417 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-asgi == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-asgi == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-fastapi[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index abb9f7289d..015482c19c 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-wsgi == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-wsgi == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", "packaging >= 21.0", ] @@ -41,7 +41,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-flask[instruments]", "markupsafe==2.1.2", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 1fe1b6bea7..ef0579c59c 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-grpc[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "protobuf ~= 3.13", ] diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index 3d8eebfa9b..11dcf3e3fe 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-httpx[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index 8283b16c98..093dc90d81 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-jinja2[instruments]", "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index 23d9338b66..a5377d6ac4 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-kafka-python[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 93fc900e1f..61a7bd3227 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,13 +25,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py index 633040fa58..6ce2e661e7 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index 370dd9213f..d6d31f1c01 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-dbapi == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-dbapi == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysql[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index 4bee91321a..df4ab042ce 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-dbapi == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-dbapi == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysqlclient[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index 8d723bb0ea..55b60adfcd 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pika[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index df917b8917..b3ab088d31 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-dbapi == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-dbapi == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-psycopg2[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index 067ad618aa..e05f9a09d0 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymemcache[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index 5962545901..d8ae918579 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymongo[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 7e36fa65bd..2795fddd2c 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-dbapi == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-dbapi == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymysql[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 348d73abd7..7ce3554b78 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-wsgi == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-wsgi == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pyramid[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "werkzeug == 0.16.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index 3f32ae2f6d..ee26cedce7 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "wrapt >= 1.12.1", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-redis[instruments]", "opentelemetry-sdk ~= 1.3", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index 0c6995a752..a16fb5baa8 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-remoulade[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "opentelemetry-sdk ~= 1.10" ] diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index 075bb1f571..1947d7ec51 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-requests[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index c4864cbeb8..30712f7a1a 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-sklearn[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index 0d568a8987..65fe1deedd 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index a1ca23779e..0c585509dd 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", "packaging >= 21.0", "wrapt >= 1.11.2", ] diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index b67bb1d695..c7a6e56211 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -26,14 +26,14 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-dbapi == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-dbapi == 0.44b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py index 633040fa58..6ce2e661e7 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index a35920530c..7adab6245c 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -26,10 +26,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-instrumentation-asgi == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation-asgi == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-starlette[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 227069f584..55b091740e 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-system-metrics[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index 191c30d980..9169e38dea 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tornado[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", "http-server-mock" ] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 695bb6a219..0af56ce04f 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tortoiseorm[instruments]", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index 222f229a2d..dbc4ad43d0 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -26,16 +26,16 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] instruments = [] test = [ "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py index 633040fa58..6ce2e661e7 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index 965df9ea77..28635ed7e7 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-urllib3[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 70afad641c..73e00b3fac 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -26,15 +26,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", - "opentelemetry-semantic-conventions == 0.43b0.dev", - "opentelemetry-util-http == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.43b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py index 2e4aa8c751..ff896307c3 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index b4e1db321e..33d9aa4276 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -29,51 +29,51 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.43b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.43b0.dev", - "opentelemetry-instrumentation-aiohttp-server==0.43b0.dev", - "opentelemetry-instrumentation-aiopg==0.43b0.dev", - "opentelemetry-instrumentation-asgi==0.43b0.dev", - "opentelemetry-instrumentation-asyncpg==0.43b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.43b0.dev", - "opentelemetry-instrumentation-boto==0.43b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.43b0.dev", - "opentelemetry-instrumentation-botocore==0.43b0.dev", - "opentelemetry-instrumentation-cassandra==0.43b0.dev", - "opentelemetry-instrumentation-celery==0.43b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.43b0.dev", - "opentelemetry-instrumentation-dbapi==0.43b0.dev", - "opentelemetry-instrumentation-django==0.43b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.43b0.dev", - "opentelemetry-instrumentation-falcon==0.43b0.dev", - "opentelemetry-instrumentation-fastapi==0.43b0.dev", - "opentelemetry-instrumentation-flask==0.43b0.dev", - "opentelemetry-instrumentation-grpc==0.43b0.dev", - "opentelemetry-instrumentation-httpx==0.43b0.dev", - "opentelemetry-instrumentation-jinja2==0.43b0.dev", - "opentelemetry-instrumentation-kafka-python==0.43b0.dev", - "opentelemetry-instrumentation-logging==0.43b0.dev", - "opentelemetry-instrumentation-mysql==0.43b0.dev", - "opentelemetry-instrumentation-mysqlclient==0.43b0.dev", - "opentelemetry-instrumentation-pika==0.43b0.dev", - "opentelemetry-instrumentation-psycopg2==0.43b0.dev", - "opentelemetry-instrumentation-pymemcache==0.43b0.dev", - "opentelemetry-instrumentation-pymongo==0.43b0.dev", - "opentelemetry-instrumentation-pymysql==0.43b0.dev", - "opentelemetry-instrumentation-pyramid==0.43b0.dev", - "opentelemetry-instrumentation-redis==0.43b0.dev", - "opentelemetry-instrumentation-remoulade==0.43b0.dev", - "opentelemetry-instrumentation-requests==0.43b0.dev", - "opentelemetry-instrumentation-sklearn==0.43b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.43b0.dev", - "opentelemetry-instrumentation-sqlite3==0.43b0.dev", - "opentelemetry-instrumentation-starlette==0.43b0.dev", - "opentelemetry-instrumentation-system-metrics==0.43b0.dev", - "opentelemetry-instrumentation-tornado==0.43b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", - "opentelemetry-instrumentation-urllib==0.43b0.dev", - "opentelemetry-instrumentation-urllib3==0.43b0.dev", - "opentelemetry-instrumentation-wsgi==0.43b0.dev", + "opentelemetry-instrumentation-aio-pika==0.44b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.44b0.dev", + "opentelemetry-instrumentation-aiohttp-server==0.44b0.dev", + "opentelemetry-instrumentation-aiopg==0.44b0.dev", + "opentelemetry-instrumentation-asgi==0.44b0.dev", + "opentelemetry-instrumentation-asyncpg==0.44b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.44b0.dev", + "opentelemetry-instrumentation-boto==0.44b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.44b0.dev", + "opentelemetry-instrumentation-botocore==0.44b0.dev", + "opentelemetry-instrumentation-cassandra==0.44b0.dev", + "opentelemetry-instrumentation-celery==0.44b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.44b0.dev", + "opentelemetry-instrumentation-dbapi==0.44b0.dev", + "opentelemetry-instrumentation-django==0.44b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.44b0.dev", + "opentelemetry-instrumentation-falcon==0.44b0.dev", + "opentelemetry-instrumentation-fastapi==0.44b0.dev", + "opentelemetry-instrumentation-flask==0.44b0.dev", + "opentelemetry-instrumentation-grpc==0.44b0.dev", + "opentelemetry-instrumentation-httpx==0.44b0.dev", + "opentelemetry-instrumentation-jinja2==0.44b0.dev", + "opentelemetry-instrumentation-kafka-python==0.44b0.dev", + "opentelemetry-instrumentation-logging==0.44b0.dev", + "opentelemetry-instrumentation-mysql==0.44b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.44b0.dev", + "opentelemetry-instrumentation-pika==0.44b0.dev", + "opentelemetry-instrumentation-psycopg2==0.44b0.dev", + "opentelemetry-instrumentation-pymemcache==0.44b0.dev", + "opentelemetry-instrumentation-pymongo==0.44b0.dev", + "opentelemetry-instrumentation-pymysql==0.44b0.dev", + "opentelemetry-instrumentation-pyramid==0.44b0.dev", + "opentelemetry-instrumentation-redis==0.44b0.dev", + "opentelemetry-instrumentation-remoulade==0.44b0.dev", + "opentelemetry-instrumentation-requests==0.44b0.dev", + "opentelemetry-instrumentation-sklearn==0.44b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.44b0.dev", + "opentelemetry-instrumentation-sqlite3==0.44b0.dev", + "opentelemetry-instrumentation-starlette==0.44b0.dev", + "opentelemetry-instrumentation-system-metrics==0.44b0.dev", + "opentelemetry-instrumentation-tornado==0.44b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.44b0.dev", + "opentelemetry-instrumentation-urllib==0.44b0.dev", + "opentelemetry-instrumentation-urllib3==0.44b0.dev", + "opentelemetry-instrumentation-wsgi==0.44b0.dev", ] [project.optional-dependencies] diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py index 2e4aa8c751..ff896307c3 100644 --- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py +++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index 6d5e2228bf..6ad92aa71e 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -24,13 +24,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.43b0.dev", + "opentelemetry-instrumentation == 0.44b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.22.0.dev", + "opentelemetry-exporter-otlp == 1.23.0.dev", ] test = [] diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py index 2e4aa8c751..ff896307c3 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/version.py +++ b/opentelemetry-distro/src/opentelemetry/distro/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 225004b51e..097ed49ef7 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,178 +18,178 @@ libraries = [ { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.44b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.44b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.44b0.dev", }, { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.44b0.dev", }, { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.44b0.dev", }, { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.44b0.dev", }, { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.44b0.dev", }, { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.44b0.dev", }, { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.44b0.dev", }, { "library": "cassandra-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.44b0.dev", }, { "library": "scylla-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.44b0.dev", }, { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.44b0.dev", }, { "library": "confluent-kafka >= 1.8.2, <= 2.2.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.44b0.dev", }, { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.44b0.dev", }, { "library": "elasticsearch >= 2.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.44b0.dev", }, { "library": "falcon >= 1.4.1, < 3.1.2", - "instrumentation": "opentelemetry-instrumentation-falcon==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.44b0.dev", }, { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.44b0.dev", }, { "library": "flask >= 1.0, < 3.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.44b0.dev", }, { "library": "werkzeug < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.44b0.dev", }, { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.44b0.dev", }, { "library": "httpx >= 0.18.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.44b0.dev", }, { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.44b0.dev", }, { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.44b0.dev", }, { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.44b0.dev", }, { "library": "mysqlclient < 3", - "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.44b0.dev", }, { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.44b0.dev", }, { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.44b0.dev", }, { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.44b0.dev", }, { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.44b0.dev", }, { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.44b0.dev", }, { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.44b0.dev", }, { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.44b0.dev", }, { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.44b0.dev", }, { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.44b0.dev", }, { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.44b0.dev", }, { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.44b0.dev", }, { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.44b0.dev", }, { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.44b0.dev", }, { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.44b0.dev", }, { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.44b0.dev", }, { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.44b0.dev", }, { "library": "urllib3 >= 1.0.0, < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.43b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.44b0.dev", }, ] default_instrumentations = [ - "opentelemetry-instrumentation-aws-lambda==0.43b0.dev", - "opentelemetry-instrumentation-dbapi==0.43b0.dev", - "opentelemetry-instrumentation-logging==0.43b0.dev", - "opentelemetry-instrumentation-sqlite3==0.43b0.dev", - "opentelemetry-instrumentation-urllib==0.43b0.dev", - "opentelemetry-instrumentation-wsgi==0.43b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.44b0.dev", + "opentelemetry-instrumentation-dbapi==0.44b0.dev", + "opentelemetry-instrumentation-logging==0.44b0.dev", + "opentelemetry-instrumentation-sqlite3==0.44b0.dev", + "opentelemetry-instrumentation-urllib==0.44b0.dev", + "opentelemetry-instrumentation-wsgi==0.44b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index 2e4aa8c751..ff896307c3 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py index 2e4aa8c751..ff896307c3 100644 --- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py +++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py index 2e4aa8c751..ff896307c3 100644 --- a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py index 2e4aa8c751..ff896307c3 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.43b0.dev" +__version__ = "0.44b0.dev" From d7cc194609e7043e138482fea9dff7a77d842987 Mon Sep 17 00:00:00 2001 From: Jean Jordaan Date: Sat, 23 Dec 2023 04:23:38 +0700 Subject: [PATCH 082/200] `FlaskInstrumentation` doesn't exist (#2070) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- .../src/opentelemetry/instrumentation/flask/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index 18b4713eaf..5f16b14727 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -141,7 +141,7 @@ def response_hook(span: Span, status: str, response_headers: List): if span and span.is_recording(): span.set_attribute("custom_user_attribute_from_response_hook", "some-value") - FlaskInstrumentation().instrument(request_hook=request_hook, response_hook=response_hook) + FlaskInstrumentor().instrument(request_hook=request_hook, response_hook=response_hook) Flask Request object reference: https://flask.palletsprojects.com/en/2.1.x/api/#flask.Request From e5aa74ff7f01d2894fc7262ded3489ef759c91f6 Mon Sep 17 00:00:00 2001 From: Denis Otkidach Date: Sat, 23 Dec 2023 00:03:51 +0200 Subject: [PATCH 083/200] Remove URL credentials (httpx integration) (#2020) * Remove URL credentials (httpx) * Add CHANGELOG --- CHANGELOG.md | 2 ++ .../pyproject.toml | 1 + .../instrumentation/httpx/__init__.py | 3 ++- .../tests/test_httpx_integration.py | 14 ++++++++++++++ tox.ini | 2 +- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e39bc3090..840cfd565a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `opentelemetry-instrumentation-httpx` Remove URL credentials + ([#2020](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2020)) - `opentelemetry-instrumentation-urllib`/`opentelemetry-instrumentation-urllib3` Fix metric descriptions to match semantic conventions ([#1959](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1959)) diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index 11dcf3e3fe..fb86ff48c5 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -28,6 +28,7 @@ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-instrumentation == 0.44b0.dev", "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-util-http == 0.44b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py index 13b01b6ca3..53542e7ef3 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -206,6 +206,7 @@ async def async_response_hook(span, request, response): from opentelemetry.trace import SpanKind, TracerProvider, get_tracer from opentelemetry.trace.span import Span from opentelemetry.trace.status import Status +from opentelemetry.util.http import remove_url_credentials _logger = logging.getLogger(__name__) @@ -269,7 +270,7 @@ def _extract_parameters(args, kwargs): # In httpx >= 0.20.0, handle_request receives a Request object request: httpx.Request = args[0] method = request.method.encode() - url = request.url + url = remove_url_credentials(str(request.url)) headers = request.headers stream = request.stream extensions = request.extensions diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index db35ab2639..b8d7fbb6b6 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -604,6 +604,13 @@ def perform_request( return self.client.request(method, url, headers=headers) return client.request(method, url, headers=headers) + def test_credential_removal(self): + new_url = "http://username:password@mock/status/200" + self.perform_request(new_url) + span = self.assert_span() + + self.assertEqual(span.attributes[SpanAttributes.HTTP_URL], self.URL) + class TestAsyncIntegration(BaseTestCases.BaseManualTest): response_hook = staticmethod(_async_response_hook) @@ -664,6 +671,13 @@ def test_basic_multiple(self): ) self.assert_span(num_spans=2) + def test_credential_removal(self): + new_url = "http://username:password@mock/status/200" + self.perform_request(new_url) + span = self.assert_span() + + self.assertEqual(span.attributes[SpanAttributes.HTTP_URL], self.URL) + class TestSyncInstrumentationIntegration(BaseTestCases.BaseInstrumentorTest): def create_client( diff --git a/tox.ini b/tox.ini index e3d3a1fe16..9541599f95 100644 --- a/tox.ini +++ b/tox.ini @@ -386,7 +386,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,requests,urllib,urllib3v{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] + falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,httpx{18,21},requests,urllib,urllib3v{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] wsgi,falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] asgi,django{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] From 9563ee73ac5cab1387b41dd61e37b79da3433029 Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Fri, 22 Dec 2023 23:43:12 +0100 Subject: [PATCH 084/200] Clean up use of suppress_instrumentation in context and fix httpx bug (#2061) * Clean up use of suppress_instrumentation in context and fix httpx bug * Clean up use of suppress_instrumentation in context and fix httpx bug * changelog * fix tests * fix import * fmt * update dep * lint * remove unused imports * apply lint * Fix version for pika * Fix lint --------- --- CHANGELOG.md | 2 + .../pyproject.toml | 1 + .../aio_pika/callback_decorator.py | 4 +- .../instrumentation/aio_pika/span_builder.py | 4 +- .../instrumentation/aio_pika/utils.py | 9 ---- .../aiohttp_client/__init__.py | 6 +-- .../tests/test_aiohttp_client_integration.py | 17 ++----- .../instrumentation/boto3sqs/__init__.py | 6 +-- .../instrumentation/botocore/__init__.py | 36 +++++-------- .../tests/test_botocore_instrumentation.py | 21 +++----- .../instrumentation/grpc/_aio_client.py | 10 ++-- .../instrumentation/grpc/_client.py | 8 +-- .../tests/test_aio_client_interceptor.py | 32 +++--------- .../tests/test_client_interceptor.py | 32 +++--------- .../tests/test_client_interceptor_filter.py | 32 +++--------- .../instrumentation/pika/utils.py | 6 +-- .../instrumentation/pymongo/__init__.py | 15 ++---- .../tests/test_pymongo.py | 11 +--- .../instrumentation/requests/__init__.py | 38 ++++++-------- .../tests/test_requests_integration.py | 24 +++------ .../instrumentation/urllib/__init__.py | 32 +++++------- .../tests/test_urllib_integration.py | 24 +++------ .../instrumentation/urllib3/__init__.py | 30 ++--------- .../tests/test_urllib3_integration.py | 25 ++++----- .../opentelemetry/instrumentation/utils.py | 51 +++++++++++++++++-- 25 files changed, 175 insertions(+), 301 deletions(-) delete mode 100644 instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/utils.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 840cfd565a..1a7cbabbaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2002](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2002)) - `opentelemetry-instrument-grpc` Fix arity of context.abort for AIO RPCs ([#2066](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2066)) +- Consolidate instrumentation suppression mechanisms and fix bug in httpx instrumentation + ([#2061](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2061)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index 237c812215..35a538b7a1 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -26,6 +26,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", + "opentelemetry-instrumentation == 0.44b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/callback_decorator.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/callback_decorator.py index a2169b6d18..f10415bdd2 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/callback_decorator.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/callback_decorator.py @@ -18,9 +18,7 @@ from opentelemetry import context, propagate, trace from opentelemetry.instrumentation.aio_pika.span_builder import SpanBuilder -from opentelemetry.instrumentation.aio_pika.utils import ( - is_instrumentation_enabled, -) +from opentelemetry.instrumentation.utils import is_instrumentation_enabled from opentelemetry.semconv.trace import MessagingOperationValues from opentelemetry.trace import Span, Tracer diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/span_builder.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/span_builder.py index 056f3dab25..b73afa62b3 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/span_builder.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/span_builder.py @@ -15,9 +15,7 @@ from aio_pika.abc import AbstractChannel, AbstractMessage -from opentelemetry.instrumentation.aio_pika.utils import ( - is_instrumentation_enabled, -) +from opentelemetry.instrumentation.utils import is_instrumentation_enabled from opentelemetry.semconv.trace import ( MessagingOperationValues, SpanAttributes, diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/utils.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/utils.py deleted file mode 100644 index fb94ddf468..0000000000 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/utils.py +++ /dev/null @@ -1,9 +0,0 @@ -from opentelemetry import context - - -def is_instrumentation_enabled() -> bool: - if context.get_value("suppress_instrumentation") or context.get_value( - context._SUPPRESS_INSTRUMENTATION_KEY - ): - return False - return True diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py index ef3b667c98..9f842bde79 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py @@ -94,8 +94,8 @@ def response_hook(span: Span, params: typing.Union[ 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, + is_instrumentation_enabled, unwrap, ) from opentelemetry.propagate import inject @@ -179,7 +179,7 @@ async def on_request_start( trace_config_ctx: types.SimpleNamespace, params: aiohttp.TraceRequestStartParams, ): - if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY): + if not is_instrumentation_enabled(): trace_config_ctx.span = None return @@ -282,7 +282,7 @@ def _instrument( # pylint:disable=unused-argument def instrumented_init(wrapped, instance, args, kwargs): - if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY): + if not is_instrumentation_enabled(): return wrapped(*args, **kwargs) client_trace_configs = list(kwargs.get("trace_configs") or []) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py index 50330b05be..2fa97f40b0 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py @@ -27,13 +27,12 @@ from http_server_mock import HttpServerMock from pkg_resources import iter_entry_points -from opentelemetry import context from opentelemetry import trace as trace_api from opentelemetry.instrumentation import aiohttp_client from opentelemetry.instrumentation.aiohttp_client import ( AioHttpClientInstrumentor, ) -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import suppress_instrumentation from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase from opentelemetry.trace import Span, StatusCode @@ -512,25 +511,17 @@ async def uninstrument_request(server: aiohttp.test_utils.TestServer): self.assert_spans(1) def test_suppress_instrumentation(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): run_with_test_server( self.get_default_request(), self.URL, self.default_handler ) - finally: - context.detach(token) self.assert_spans(0) @staticmethod async def suppressed_request(server: aiohttp.test_utils.TestServer): async with aiohttp.test_utils.TestClient(server) as client: - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - await client.get(TestAioHttpClientInstrumentor.URL) - context.detach(token) + with suppress_instrumentation(): + await client.get(TestAioHttpClientInstrumentor.URL) def test_suppress_instrumentation_after_creation(self): run_with_test_server( diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py index 137c570ac6..ee7f4a59a6 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/__init__.py @@ -38,7 +38,7 @@ from opentelemetry import context, propagate, trace from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.utils import ( - _SUPPRESS_INSTRUMENTATION_KEY, + is_instrumentation_enabled, unwrap, ) from opentelemetry.propagators.textmap import CarrierT, Getter, Setter @@ -218,7 +218,7 @@ def _create_processing_span( def _wrap_send_message(self, sqs_class: type) -> None: def send_wrapper(wrapped, instance, args, kwargs): - if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY): + if not is_instrumentation_enabled(): return wrapped(*args, **kwargs) queue_url = kwargs.get("QueueUrl") # The method expect QueueUrl and Entries params, so if they are None, we call wrapped to receive the @@ -252,7 +252,7 @@ def send_batch_wrapper(wrapped, instance, args, kwargs): # The method expect QueueUrl and Entries params, so if they are None, we call wrapped to receive the # original exception if ( - context.get_value(_SUPPRESS_INSTRUMENTATION_KEY) + not is_instrumentation_enabled() or not queue_url or not entries ): diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py index 686b040b13..36b973e318 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/__init__.py @@ -86,10 +86,6 @@ def response_hook(span, service_name, operation_name, result): from botocore.exceptions import ClientError from wrapt import wrap_function_wrapper -from opentelemetry import context as context_api - -# 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 opentelemetry.instrumentation.botocore.extensions import _find_extension from opentelemetry.instrumentation.botocore.extensions.types import ( _AwsSdkCallContext, @@ -98,7 +94,8 @@ def response_hook(span, service_name, operation_name, result): from opentelemetry.instrumentation.botocore.version import __version__ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.utils import ( - _SUPPRESS_INSTRUMENTATION_KEY, + is_instrumentation_enabled, + suppress_http_instrumentation, unwrap, ) from opentelemetry.propagators.aws.aws_xray_propagator import AwsXRayPropagator @@ -171,7 +168,7 @@ def _patched_endpoint_prepare_request( # pylint: disable=too-many-branches def _patched_api_call(self, original_func, instance, args, kwargs): - if context_api.get_value(_SUPPRESS_INSTRUMENTATION_KEY): + if not is_instrumentation_enabled(): return original_func(*args, **kwargs) call_context = _determine_call_context(instance, args) @@ -200,25 +197,20 @@ def _patched_api_call(self, original_func, instance, args, kwargs): _safe_invoke(extension.before_service_call, span) self._call_request_hook(span, call_context) - token = context_api.attach( - context_api.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True) - ) - - result = None try: - result = original_func(*args, **kwargs) - except ClientError as error: - result = getattr(error, "response", None) - _apply_response_attributes(span, result) - _safe_invoke(extension.on_error, span, error) - raise - else: - _apply_response_attributes(span, result) - _safe_invoke(extension.on_success, span, result) + with suppress_http_instrumentation(): + result = None + try: + result = original_func(*args, **kwargs) + except ClientError as error: + result = getattr(error, "response", None) + _apply_response_attributes(span, result) + _safe_invoke(extension.on_error, span, error) + raise + _apply_response_attributes(span, result) + _safe_invoke(extension.on_success, span, result) finally: - context_api.detach(token) _safe_invoke(extension.after_service_call) - self._call_response_hook(span, call_context, result) return result diff --git a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py index 3d25dcbf2d..bb6d283399 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py @@ -27,14 +27,11 @@ ) from opentelemetry import trace as trace_api -from opentelemetry.context import ( - _SUPPRESS_HTTP_INSTRUMENTATION_KEY, - attach, - detach, - set_value, -) from opentelemetry.instrumentation.botocore import BotocoreInstrumentor -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import ( + suppress_http_instrumentation, + suppress_instrumentation, +) from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.propagators.aws.aws_xray_propagator import TRACE_HEADER_KEY from opentelemetry.semconv.trace import SpanAttributes @@ -341,23 +338,17 @@ def check_headers(**kwargs): @mock_xray def test_suppress_instrumentation_xray_client(self): xray_client = self._make_client("xray") - token = attach(set_value(_SUPPRESS_INSTRUMENTATION_KEY, True)) - try: + with suppress_instrumentation(): xray_client.put_trace_segments(TraceSegmentDocuments=["str1"]) xray_client.put_trace_segments(TraceSegmentDocuments=["str2"]) - finally: - detach(token) self.assertEqual(0, len(self.get_finished_spans())) @mock_xray def test_suppress_http_instrumentation_xray_client(self): xray_client = self._make_client("xray") - token = attach(set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True)) - try: + with suppress_http_instrumentation(): xray_client.put_trace_segments(TraceSegmentDocuments=["str1"]) xray_client.put_trace_segments(TraceSegmentDocuments=["str2"]) - finally: - detach(token) self.assertEqual(2, len(self.get_finished_spans())) @mock_s3 diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_client.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_client.py index 5d5a5ccc46..8fc992be73 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_client.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_client.py @@ -19,12 +19,11 @@ import grpc from grpc.aio import ClientCallDetails -from opentelemetry import context from opentelemetry.instrumentation.grpc._client import ( OpenTelemetryClientInterceptor, _carrier_setter, ) -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import is_instrumentation_enabled from opentelemetry.propagate import inject from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace.status import Status, StatusCode @@ -139,9 +138,10 @@ async def _wrap_stream_response(self, span, call): span.end() def tracing_skipped(self, client_call_details): - return context.get_value( - _SUPPRESS_INSTRUMENTATION_KEY - ) or not self.rpc_matches_filters(client_call_details) + return ( + not is_instrumentation_enabled() + or not self.rpc_matches_filters(client_call_details) + ) def rpc_matches_filters(self, client_call_details): return self._filter is None or self._filter(client_call_details) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py index b966fff4db..e27c9e826f 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py @@ -25,10 +25,10 @@ import grpc -from opentelemetry import context, trace +from opentelemetry import trace from opentelemetry.instrumentation.grpc import grpcext from opentelemetry.instrumentation.grpc._utilities import RpcInfo -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import is_instrumentation_enabled from opentelemetry.propagate import inject from opentelemetry.propagators.textmap import Setter from opentelemetry.semconv.trace import SpanAttributes @@ -123,7 +123,7 @@ def _trace_result(self, span, rpc_info, result): return result def _intercept(self, request, metadata, client_info, invoker): - if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY): + if not is_instrumentation_enabled(): return invoker(request, metadata) if not metadata: @@ -219,7 +219,7 @@ def _intercept_server_stream( def intercept_stream( self, request_or_iterator, metadata, client_info, invoker ): - if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY): + if not is_instrumentation_enabled(): return invoker(request_or_iterator, metadata) if self._filter is not None and not self._filter(client_info): diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py index 6ca5ce92d5..6b1006b8a3 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor.py @@ -31,7 +31,7 @@ def run(self, result=None): import pytest import opentelemetry.instrumentation.grpc -from opentelemetry import context, trace +from opentelemetry import trace from opentelemetry.instrumentation.grpc import ( GrpcAioInstrumentorClient, aio_client_interceptors, @@ -39,7 +39,7 @@ def run(self, result=None): from opentelemetry.instrumentation.grpc._aio_client import ( UnaryUnaryAioClientInterceptor, ) -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import suppress_instrumentation from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.mock_textmap import MockTextMapPropagator @@ -314,53 +314,33 @@ async def test_client_interceptor_trace_context_propagation(self): set_global_textmap(previous_propagator) async def test_unary_unary_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): response = await simple_method(self._stub) assert response.response_data == "data" spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) - finally: - context.detach(token) async def test_unary_stream_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): async for response in server_streaming_method(self._stub): self.assertEqual(response.response_data, "data") spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) - finally: - context.detach(token) async def test_stream_unary_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): response = await client_streaming_method(self._stub) assert response.response_data == "data" spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) - finally: - context.detach(token) async def test_stream_stream_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): async for response in bidirectional_streaming_method(self._stub): self.assertEqual(response.response_data, "data") spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) - finally: - context.detach(token) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py index 21d016d624..2436aca40c 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py @@ -19,7 +19,7 @@ ) import opentelemetry.instrumentation.grpc -from opentelemetry import context, trace +from opentelemetry import trace from opentelemetry.instrumentation.grpc import GrpcInstrumentorClient from opentelemetry.instrumentation.grpc._client import ( OpenTelemetryClientInterceptor, @@ -27,7 +27,7 @@ from opentelemetry.instrumentation.grpc.grpcext._interceptor import ( _UnaryClientInfo, ) -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import suppress_instrumentation from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.mock_textmap import MockTextMapPropagator @@ -307,45 +307,25 @@ def invoker(request, metadata): set_global_textmap(previous_propagator) def test_unary_unary_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): simple_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) def test_unary_stream_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): server_streaming_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) def test_stream_unary_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): client_streaming_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) def test_stream_stream_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): bidirectional_streaming_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py index bfa20592ba..9a9aefad59 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py @@ -22,7 +22,7 @@ ) import opentelemetry.instrumentation.grpc -from opentelemetry import context, trace +from opentelemetry import trace from opentelemetry.instrumentation.grpc import GrpcInstrumentorClient, filters from opentelemetry.instrumentation.grpc._client import ( OpenTelemetryClientInterceptor, @@ -30,7 +30,7 @@ from opentelemetry.instrumentation.grpc.grpcext._interceptor import ( _UnaryClientInfo, ) -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import suppress_instrumentation from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.mock_textmap import MockTextMapPropagator @@ -639,45 +639,25 @@ def invoker(request, metadata): set_global_textmap(previous_propagator) def test_unary_unary_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): simple_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) def test_unary_stream_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): server_streaming_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) def test_stream_unary_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): client_streaming_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) def test_stream_stream_with_suppress_key(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): bidirectional_streaming_method(self._stub) spans = self.memory_exporter.get_finished_spans() - finally: - context.detach(token) self.assertEqual(len(spans), 0) diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py index 881149dbac..6dab4fdfa9 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py @@ -5,7 +5,7 @@ from pika.spec import Basic, BasicProperties from opentelemetry import context, propagate, trace -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import is_instrumentation_enabled from opentelemetry.propagators.textmap import CarrierT, Getter from opentelemetry.semconv.trace import ( MessagingOperationValues, @@ -135,9 +135,7 @@ def _get_span( span_kind: SpanKind, operation: Optional[MessagingOperationValues] = None, ) -> Optional[Span]: - if context.get_value("suppress_instrumentation") or context.get_value( - _SUPPRESS_INSTRUMENTATION_KEY - ): + if not is_instrumentation_enabled(): return None task_name = properties.type if properties.type else task_name span = tracer.start_span( diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py index 041ff6b928..506669a5c6 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py @@ -79,14 +79,13 @@ def failed_hook(span, event): from pymongo import monitoring -from opentelemetry import context from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.pymongo.package import _instruments from opentelemetry.instrumentation.pymongo.utils import ( COMMAND_TO_ATTRIBUTE_MAPPING, ) from opentelemetry.instrumentation.pymongo.version import __version__ -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import is_instrumentation_enabled from opentelemetry.semconv.trace import DbSystemValues, SpanAttributes from opentelemetry.trace import SpanKind, get_tracer from opentelemetry.trace.span import Span @@ -122,9 +121,7 @@ def __init__( def started(self, event: monitoring.CommandStartedEvent): """Method to handle a pymongo CommandStartedEvent""" - if not self.is_enabled or context.get_value( - _SUPPRESS_INSTRUMENTATION_KEY - ): + if not self.is_enabled or not is_instrumentation_enabled(): return command_name = event.command_name span_name = f"{event.database_name}.{command_name}" @@ -167,9 +164,7 @@ def started(self, event: monitoring.CommandStartedEvent): def succeeded(self, event: monitoring.CommandSucceededEvent): """Method to handle a pymongo CommandSucceededEvent""" - if not self.is_enabled or context.get_value( - _SUPPRESS_INSTRUMENTATION_KEY - ): + if not self.is_enabled or not is_instrumentation_enabled(): return span = self._pop_span(event) if span is None: @@ -185,9 +180,7 @@ def succeeded(self, event: monitoring.CommandSucceededEvent): def failed(self, event: monitoring.CommandFailedEvent): """Method to handle a pymongo CommandFailedEvent""" - if not self.is_enabled or context.get_value( - _SUPPRESS_INSTRUMENTATION_KEY - ): + if not (self.is_enabled and is_instrumentation_enabled()): return span = self._pop_span(event) if span is None: diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/tests/test_pymongo.py b/instrumentation/opentelemetry-instrumentation-pymongo/tests/test_pymongo.py index 8eab3b701c..5a8acfda31 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/tests/test_pymongo.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/tests/test_pymongo.py @@ -14,13 +14,12 @@ from unittest import mock -from opentelemetry import context from opentelemetry import trace as trace_api from opentelemetry.instrumentation.pymongo import ( CommandTracer, PymongoInstrumentor, ) -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import suppress_instrumentation from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase @@ -112,16 +111,10 @@ def test_suppression_key(self): mock_event.command.get = mock.Mock() mock_event.command.get.return_value = "dummy" - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - - try: + with suppress_instrumentation(): command_tracer = CommandTracer(mock_tracer) command_tracer.started(event=mock_event) command_tracer.succeeded(event=mock_event) - finally: - context.detach(token) # if suppression key is set, CommandTracer methods return immediately, so command.get is not invoked. self.assertFalse( diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py index 0a8e4ee729..4c198596a2 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -58,10 +58,6 @@ from requests.sessions import Session from requests.structures import CaseInsensitiveDict -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 opentelemetry.instrumentation._semconv import ( _METRIC_ATTRIBUTES_CLIENT_DURATION_NAME, _SPAN_ATTRIBUTES_ERROR_TYPE, @@ -87,8 +83,9 @@ from opentelemetry.instrumentation.requests.package import _instruments from opentelemetry.instrumentation.requests.version import __version__ from opentelemetry.instrumentation.utils import ( - _SUPPRESS_INSTRUMENTATION_KEY, http_status_to_status_code, + is_http_instrumentation_enabled, + suppress_http_instrumentation, ) from opentelemetry.metrics import Histogram, get_meter from opentelemetry.propagate import inject @@ -149,9 +146,7 @@ def get_or_create_headers(): ) return request.headers - if context.get_value( - _SUPPRESS_INSTRUMENTATION_KEY - ) or context.get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY): + if not is_http_instrumentation_enabled(): return wrapped_send(self, request, **kwargs) # See @@ -220,20 +215,19 @@ def get_or_create_headers(): headers = get_or_create_headers() inject(headers) - token = context.attach( - context.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True) - ) - - start_time = default_timer() - - try: - result = wrapped_send(self, request, **kwargs) # *** PROCEED - except Exception as exc: # pylint: disable=W0703 - exception = exc - result = getattr(exc, "response", None) - finally: - elapsed_time = max(default_timer() - start_time, 0) - context.detach(token) + with suppress_http_instrumentation(): + start_time = default_timer() + try: + result = wrapped_send( + self, request, **kwargs + ) # *** PROCEED + except Exception as exc: # pylint: disable=W0703 + exception = exc + result = getattr(exc, "response", None) + finally: + elapsed_time = max( + round((default_timer() - start_time) * 1000), 0 + ) if isinstance(result, Response): span_attributes = {} diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py index 11eada2589..8817053068 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py @@ -21,10 +21,7 @@ from requests.models import Response import opentelemetry.instrumentation.requests -from opentelemetry import context, trace - -# 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 opentelemetry import trace from opentelemetry.instrumentation._semconv import ( _OTEL_SEMCONV_STABILITY_OPT_IN_KEY, _SPAN_ATTRIBUTES_ERROR_TYPE, @@ -33,7 +30,10 @@ _OpenTelemetrySemanticConventionStability, ) from opentelemetry.instrumentation.requests import RequestsInstrumentor -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import ( + suppress_http_instrumentation, + suppress_instrumentation, +) from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.sdk import resources from opentelemetry.semconv.trace import SpanAttributes @@ -397,26 +397,16 @@ def test_uninstrument_session(self): self.assert_span() def test_suppress_instrumentation(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): result = self.perform_request(self.URL) self.assertEqual(result.text, "Hello!") - finally: - context.detach(token) self.assert_span(num_spans=0) def test_suppress_http_instrumentation(self): - token = context.attach( - context.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_http_instrumentation(): result = self.perform_request(self.URL) self.assertEqual(result.text, "Hello!") - finally: - context.detach(token) self.assert_span(num_spans=0) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py index eca8fbda77..3738c4d2c6 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/__init__.py @@ -85,16 +85,13 @@ def response_hook(span, request_obj, response) Request, ) -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 opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.urllib.package import _instruments from opentelemetry.instrumentation.urllib.version import __version__ from opentelemetry.instrumentation.utils import ( - _SUPPRESS_INSTRUMENTATION_KEY, http_status_to_status_code, + is_http_instrumentation_enabled, + suppress_http_instrumentation, ) from opentelemetry.metrics import Histogram, get_meter from opentelemetry.propagate import inject @@ -206,9 +203,7 @@ def call_wrapped(): def _instrumented_open_call( _, request, call_wrapped, get_or_create_headers ): # pylint: disable=too-many-locals - if context.get_value( - _SUPPRESS_INSTRUMENTATION_KEY - ) or context.get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY): + if not is_http_instrumentation_enabled(): return call_wrapped() url = request.full_url @@ -236,18 +231,15 @@ def _instrumented_open_call( headers = get_or_create_headers() inject(headers) - token = context.attach( - context.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True) - ) - start_time = default_timer() - try: - result = call_wrapped() # *** PROCEED - except Exception as exc: # pylint: disable=W0703 - exception = exc - result = getattr(exc, "file", None) - finally: - elapsed_time = round((default_timer() - start_time) * 1000) - context.detach(token) + with suppress_http_instrumentation(): + start_time = default_timer() + try: + result = call_wrapped() # *** PROCEED + except Exception as exc: # pylint: disable=W0703 + exception = exc + result = getattr(exc, "file", None) + finally: + elapsed_time = round((default_timer() - start_time) * 1000) if result is not None: code_ = result.getcode() diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py index f27f594a30..36189e12c1 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py @@ -24,14 +24,14 @@ import httpretty import opentelemetry.instrumentation.urllib # pylint: disable=no-name-in-module,import-error -from opentelemetry import context, trace - -# 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 opentelemetry import trace from opentelemetry.instrumentation.urllib import ( # pylint: disable=no-name-in-module,import-error URLLibInstrumentor, ) -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import ( + suppress_http_instrumentation, + suppress_instrumentation, +) from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.sdk import resources from opentelemetry.semconv.trace import SpanAttributes @@ -255,26 +255,16 @@ def test_uninstrument_session(self): self.assert_span() def test_suppress_instrumentation(self): - token = context.attach( - context.set_value(_SUPPRESS_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_instrumentation(): result = self.perform_request(self.URL) self.assertEqual(result.read(), b"Hello!") - finally: - context.detach(token) self.assert_span(num_spans=0) def test_suppress_http_instrumentation(self): - token = context.attach( - context.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True) - ) - try: + with suppress_http_instrumentation(): result = self.perform_request(self.URL) self.assertEqual(result.read(), b"Hello!") - finally: - context.detach(token) self.assert_span(num_spans=0) diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py index 5580cb529f..985f291199 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py @@ -79,7 +79,6 @@ def response_hook(span, request, response): """ import collections.abc -import contextlib import io import typing from timeit import default_timer @@ -88,16 +87,13 @@ def response_hook(span, request, response): import urllib3.connectionpool import wrapt -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 opentelemetry.instrumentation.instrumentor import BaseInstrumentor 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, + is_http_instrumentation_enabled, + suppress_http_instrumentation, unwrap, ) from opentelemetry.metrics import Histogram, get_meter @@ -224,7 +220,7 @@ def _instrument( excluded_urls: ExcludeList = None, ): def instrumented_urlopen(wrapped, instance, args, kwargs): - if _is_instrumentation_suppressed(): + if not is_http_instrumentation_enabled(): return wrapped(*args, **kwargs) url = _get_url(instance, args, kwargs, url_filter) @@ -248,7 +244,7 @@ def instrumented_urlopen(wrapped, instance, args, kwargs): request_hook(span, instance, headers, body) inject(headers) - with _suppress_further_instrumentation(): + with suppress_http_instrumentation(): start_time = default_timer() response = wrapped(*args, **kwargs) elapsed_time = round((default_timer() - start_time) * 1000) @@ -352,13 +348,6 @@ def _apply_response(span: Span, response: urllib3.response.HTTPResponse): span.set_status(Status(http_status_to_status_code(response.status))) -def _is_instrumentation_suppressed() -> bool: - return bool( - context.get_value(_SUPPRESS_INSTRUMENTATION_KEY) - or context.get_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY) - ) - - def _create_metric_attributes( instance: urllib3.connectionpool.HTTPConnectionPool, response: urllib3.response.HTTPResponse, @@ -382,16 +371,5 @@ def _create_metric_attributes( return metric_attributes -@contextlib.contextmanager -def _suppress_further_instrumentation(): - token = context.attach( - context.set_value(_SUPPRESS_HTTP_INSTRUMENTATION_KEY, True) - ) - try: - yield - finally: - context.detach(token) - - def _uninstrument(): unwrap(urllib3.connectionpool.HTTPConnectionPool, "urlopen") diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py index 27e1b81269..23124ea590 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_integration.py @@ -19,12 +19,12 @@ import urllib3 import urllib3.exceptions -from opentelemetry import context, trace - -# 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 opentelemetry import trace from opentelemetry.instrumentation.urllib3 import URLLib3Instrumentor -from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY +from opentelemetry.instrumentation.utils import ( + suppress_http_instrumentation, + suppress_instrumentation, +) from opentelemetry.propagate import get_global_textmap, set_global_textmap from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.mock_textmap import MockTextMapPropagator @@ -225,20 +225,17 @@ def test_uninstrument(self): URLLib3Instrumentor().instrument() def test_suppress_instrumentation(self): - suppression_keys = ( - _SUPPRESS_HTTP_INSTRUMENTATION_KEY, - _SUPPRESS_INSTRUMENTATION_KEY, + suppression_cms = ( + suppress_instrumentation, + suppress_http_instrumentation, ) - for key in suppression_keys: + for cm in suppression_cms: self.memory_exporter.clear() - with self.subTest(key=key): - token = context.attach(context.set_value(key, True)) - try: + with self.subTest(cm=cm): + with cm(): response = self.perform_request(self.HTTP_URL) self.assertEqual(b"Hello!", response.data) - finally: - context.detach(token) self.assert_span(num_spans=0) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py index 35a55a1279..318aaeaa74 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py @@ -13,16 +13,22 @@ # limitations under the License. import urllib.parse +from contextlib import contextmanager from re import escape, sub -from typing import Dict, Sequence +from typing import Dict, Iterable, Sequence from wrapt import ObjectProxy from opentelemetry import context, trace -# pylint: disable=unused-import # pylint: disable=E0611 -from opentelemetry.context import _SUPPRESS_INSTRUMENTATION_KEY # noqa: F401 +# FIXME: fix the importing of these private attributes when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY is defined.= +from opentelemetry.context import ( + _SUPPRESS_HTTP_INSTRUMENTATION_KEY, + _SUPPRESS_INSTRUMENTATION_KEY, +) + +# pylint: disable=E0611 from opentelemetry.propagate import extract from opentelemetry.trace import StatusCode from opentelemetry.trace.propagation.tracecontext import ( @@ -152,3 +158,42 @@ def _python_path_without_directory(python_path, directory, path_separator): "", python_path, ) + + +def is_instrumentation_enabled() -> bool: + if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY): + return False + return True + + +def is_http_instrumentation_enabled() -> bool: + return is_instrumentation_enabled() and not context.get_value( + _SUPPRESS_HTTP_INSTRUMENTATION_KEY + ) + + +@contextmanager +def _suppress_instrumentation(*keys: str) -> Iterable[None]: + """Suppress instrumentation within the context.""" + ctx = context.get_current() + for key in keys: + ctx = context.set_value(key, True, ctx) + token = context.attach(ctx) + try: + yield + finally: + context.detach(token) + + +@contextmanager +def suppress_instrumentation() -> Iterable[None]: + """Suppress instrumentation within the context.""" + with _suppress_instrumentation(_SUPPRESS_INSTRUMENTATION_KEY): + yield + + +@contextmanager +def suppress_http_instrumentation() -> Iterable[None]: + """Suppress instrumentation within the context.""" + with _suppress_instrumentation(_SUPPRESS_HTTP_INSTRUMENTATION_KEY): + yield From 7c12ad9844ac179e3f6a493491707a9bafd06f6b Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Fri, 22 Dec 2023 15:40:32 -0800 Subject: [PATCH 085/200] Fix dependency for azure resource detector (#2072) --- CHANGELOG.md | 2 ++ resource/opentelemetry-resource-detector-azure/pyproject.toml | 2 +- .../src/opentelemetry/resource/detector/azure/vm.py | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a7cbabbaa..26425b40a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2020](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2020)) - `opentelemetry-instrumentation-urllib`/`opentelemetry-instrumentation-urllib3` Fix metric descriptions to match semantic conventions ([#1959](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1959)) +- `opentelemetry-resource-detector-azure` Added dependency for Cloud Resource ID attribute + ([#2072](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2072)) ## Version 1.21.0/0.42b0 (2023-11-01) diff --git a/resource/opentelemetry-resource-detector-azure/pyproject.toml b/resource/opentelemetry-resource-detector-azure/pyproject.toml index c4ae6fc191..403553be3d 100644 --- a/resource/opentelemetry-resource-detector-azure/pyproject.toml +++ b/resource/opentelemetry-resource-detector-azure/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-sdk ~= 1.19", + "opentelemetry-sdk ~= 1.21", ] [project.optional-dependencies] diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index fd14b482ed..8dd741b901 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -24,7 +24,6 @@ ResourceAttributes, ) -# TODO: Remove when cloud resource id is no longer missing in Resource Attributes _AZURE_VM_METADATA_ENDPOINT = "http://169.254.169.254/metadata/instance/compute?api-version=2021-12-13&format=json" _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = "azure.vm.scaleset.name" _AZURE_VM_SKU_ATTRIBUTE = "azure.vm.sku" From 14d7779366ec99800f1e9a1f7137c01bc1aff617 Mon Sep 17 00:00:00 2001 From: Kenny Guo <110429254+kennykguo@users.noreply.github.com> Date: Fri, 5 Jan 2024 15:05:58 -0500 Subject: [PATCH 086/200] Update README.rst (#2060) --- _template/README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/_template/README.rst b/_template/README.rst index 7eb48e6b15..78226bba43 100644 --- a/_template/README.rst +++ b/_template/README.rst @@ -11,6 +11,7 @@ This library allows tracing requests made by the library. Installation ------------ + :: pip install opentelemetry-instrumentation- From 588d5d70037a2c023b95bf99925e4b703e1b2145 Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Tue, 9 Jan 2024 15:02:09 -0800 Subject: [PATCH 087/200] Add 10 second timeout to VM Resource Detector (#2119) --- CHANGELOG.md | 3 +++ .../src/opentelemetry/resource/detector/azure/vm.py | 4 ++-- .../tests/test_vm.py | 12 ++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26425b40a9..11363cc165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector + ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) + ## Version 1.22.0/0.43b0 (2023-12-14) ### Added diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index 8dd741b901..e90fec5a8d 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -68,8 +68,8 @@ def get_azure_vm_metadata(self): # pylint: disable=no-self-use request = Request(_AZURE_VM_METADATA_ENDPOINT) request.add_header("Metadata", "True") try: - with urlopen(request).read() as response: - return loads(response) + with urlopen(request, timeout=10) as response: + return loads(response.read()) except URLError: # Not on Azure VM return None diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py index 13ec225c82..fd443aa3be 100644 --- a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py +++ b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py @@ -363,18 +363,18 @@ class TestAzureVMResourceDetector(unittest.TestCase): @patch("opentelemetry.resource.detector.azure.vm.urlopen") def test_linux(self, mock_urlopen): - mock_open = Mock() - mock_urlopen.return_value = mock_open - mock_open.read.return_value = LINUX_JSON + mock_response = Mock() + mock_urlopen.return_value = mock_response + mock_response.read.return_value = LINUX_JSON attributes = AzureVMResourceDetector().detect().attributes for attribute_key, attribute_value in LINUX_ATTRIBUTES.items(): self.assertEqual(attributes[attribute_key], attribute_value) @patch("opentelemetry.resource.detector.azure.vm.urlopen") def test_windows(self, mock_urlopen): - mock_open = Mock() - mock_urlopen.return_value = mock_open - mock_open.read.return_value = WINDOWS_JSON + mock_response = Mock() + mock_urlopen.return_value = mock_response + mock_response.read.return_value = WINDOWS_JSON attributes = AzureVMResourceDetector().detect().attributes for attribute_key, attribute_value in LINUX_ATTRIBUTES.items(): self.assertEqual(attributes[attribute_key], attribute_value) From c2691e049b0019892fffd1a75f6b1686a33a73b9 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 10 Jan 2024 12:41:44 -0800 Subject: [PATCH 088/200] Update version.py for release (#2120) --- .../src/opentelemetry/resource/detector/azure/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py index 5fd301e2e6..7b936f07f0 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.1.0" +__version__ = "0.1.1" From 42faa1a34a711c35576833e56d0e28ea0cae4993 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 11 Jan 2024 13:03:28 -0600 Subject: [PATCH 089/200] Separate jobs per instrumentation (#2121) * Separate jobs per instrumentation Fixes #2036 * Separate in 2 workflows * Added explanation for separation --- .github/workflows/instrumentations_0.yml | 95 ++++++++++++++++++++++++ .github/workflows/instrumentations_1.yml | 57 ++++++++++++++ .github/workflows/test.yml | 83 --------------------- 3 files changed, 152 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/instrumentations_0.yml create mode 100644 .github/workflows/instrumentations_1.yml diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml new file mode 100644 index 0000000000..be5e3f7cb8 --- /dev/null +++ b/.github/workflows/instrumentations_0.yml @@ -0,0 +1,95 @@ +name: Contrib Repo Tests + +on: + push: + branches-ignore: + - 'release/*' + pull_request: +env: + CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150 + +jobs: + instrumentations-0: + env: + # We use these variables to convert between tox and GHA version literals + py37: 3.7 + py38: 3.8 + py39: 3.9 + py310: "3.10" + py311: "3.11" + pypy3: pypy-3.7 + RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails + matrix: + python-version: [py37, py38, py39, py310, py311, pypy3] + package: + # Do not add more instrumentations here, add them in instrumentations_1.yml. + # The reason for this separation of instrumentations into more than one YAML file is + # the limit of jobs that can be run from a Github actions matrix: + # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs + # "A matrix will generate a maximum of 256 jobs per workflow run. This limit applies + # to both GitHub-hosted and self-hosted runners." + - "aiohttp-client" + - "aiohttp-server" + - "aiopg" + - "aio-pika" + - "asgi" + - "asyncpg" + - "aws-lambda" + - "boto" + - "boto3sqs" + - "botocore" + - "cassandra" + - "celery" + - "confluent-kafka" + - "dbapi" + - "django" + - "elasticsearch" + - "falcon" + - "fastapi" + - "flask" + - "grpc" + - "httpx" + - "jinja2" + - "kafka-python" + - "logging" + - "mysql" + - "mysqlclient" + - "pika" + - "psycopg2" + - "pymemcache" + - "pymongo" + - "pymysql" + - "pyramid" + - "redis" + - "remoulade" + - "requests" + - "sklearn" + - "sqlalchemy" + - "sqlite3" + - "starlette" + - "system-metrics" + - "tornado" + - "tortoiseorm" + os: [ubuntu-20.04] + steps: + - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} + uses: actions/checkout@v2 + - name: Set up Python ${{ env[matrix.python-version] }} + uses: actions/setup-python@v4 + with: + python-version: ${{ env[matrix.python-version] }} + - name: Install tox + run: pip install tox==3.27.1 tox-factor + - name: Cache tox environment + # Preserves .tox directory between runs for faster installs + uses: actions/cache@v1 + with: + path: | + .tox + ~/.cache/pip + key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }} + - name: run tox + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml new file mode 100644 index 0000000000..d85897251b --- /dev/null +++ b/.github/workflows/instrumentations_1.yml @@ -0,0 +1,57 @@ +name: Contrib Repo Tests + +on: + push: + branches-ignore: + - 'release/*' + pull_request: +env: + CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150 + +jobs: + instrumentations-1: + env: + # We use these variables to convert between tox and GHA version literals + py37: 3.7 + py38: 3.8 + py39: 3.9 + py310: "3.10" + py311: "3.11" + pypy3: pypy-3.7 + RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails + matrix: + python-version: [py37, py38, py39, py310, py311, pypy3] + package: + - "urllib" + - "urllib3" + - "wsgi" + - "distro" + - "richconsole" + - "prometheus-remote-write" + - "sdkextension-aws" + - "propagator-aws-xray" + - "propagator-ot-trace" + - "resource-detector-container" + os: [ubuntu-20.04] + steps: + - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} + uses: actions/checkout@v2 + - name: Set up Python ${{ env[matrix.python-version] }} + uses: actions/setup-python@v4 + with: + python-version: ${{ env[matrix.python-version] }} + - name: Install tox + run: pip install tox==3.27.1 tox-factor + - name: Cache tox environment + # Preserves .tox directory between runs for faster installs + uses: actions/cache@v1 + with: + path: | + .tox + ~/.cache/pip + key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }} + - name: run tox + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cf2e3c6b9..517e7e332d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,89 +9,6 @@ env: CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150 jobs: - build: - env: - # We use these variables to convert between tox and GHA version literals - py37: 3.7 - py38: 3.8 - py39: 3.9 - py310: "3.10" - py311: "3.11" - pypy3: "pypy3.7" - RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false # ensures the entire test matrix is run, even if one permutation fails - matrix: - python-version: [ py37, py38, py39, py310, py311, pypy3 ] - package: ["instrumentation", "distro", "exporter", "sdkextension", "propagator", "resource"] - os: [ ubuntu-20.04 ] - steps: - - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} - uses: actions/checkout@v2 - - name: Set up Python ${{ env[matrix.python-version] }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env[matrix.python-version] }} - - name: Install tox - run: pip install tox==3.27.1 tox-factor - - name: Cache tox environment - # Preserves .tox directory between runs for faster installs - uses: actions/cache@v1 - with: - path: | - .tox - ~/.cache/pip - key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }} - - name: run tox - run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json - # - name: Find and merge ${{ matrix.package }} benchmarks - # # TODO: Add at least one benchmark to every package type to remove this (#249) - # if: matrix.package == 'sdkextension' || matrix.package == 'propagator' - # run: >- - # mkdir -p benchmarks; - # jq -s '.[0].benchmarks = ([.[].benchmarks] | add) - # | if .[0].benchmarks == null then null else .[0] end' - # **/**/tests/*${{ matrix.package }}*-benchmark.json > benchmarks/output_${{ matrix.package }}.json - # - name: Upload all benchmarks under same key as an artifact - # if: ${{ success() }} - # uses: actions/upload-artifact@v2 - # with: - # name: benchmarks - # path: benchmarks/output_${{ matrix.package }}.json - # combine-benchmarks: - # runs-on: ubuntu-latest - # needs: build - # if: ${{ always() }} - # name: Combine benchmarks from previous build job - # steps: - # - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} - # uses: actions/checkout@v2 - # - name: Download all benchmarks as artifact using key - # uses: actions/download-artifact@v2 - # with: - # name: benchmarks - # path: benchmarks - # - name: Find and merge all benchmarks - # run: >- - # jq -s '.[0].benchmarks = ([.[].benchmarks] | add) - # | if .[0].benchmarks == null then null else .[0] end' - # benchmarks/output_*.json > output.json; - # - name: Report on benchmark results - # uses: benchmark-action/github-action-benchmark@v1 - # with: - # name: OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package }} - # tool: pytest - # output-file-path: output.json - # github-token: ${{ secrets.GITHUB_TOKEN }} - # max-items-in-chart: 100 - # # Alert with a commit comment on possible performance regression - # alert-threshold: 200% - # fail-on-alert: true - # # Make a commit on `gh-pages` with benchmarks from previous step - # auto-push: ${{ github.ref == 'refs/heads/main' }} - # gh-pages-branch: gh-pages - # benchmark-data-dir-path: benchmarks misc: strategy: fail-fast: false From c9d709a5c455e5c645a4dbe14af2d6a2af3ab41f Mon Sep 17 00:00:00 2001 From: Allen Kim Date: Wed, 17 Jan 2024 06:45:12 +0900 Subject: [PATCH 090/200] Feature/support for flask 3.0.0 (#2013) * support flask 3.0.0 * support flask 3.0.0 * support flask 3.0.0 * modify tox.ini * modify Werkzeug version * modify Werkzeug version * modify flask test version * modify flask version * modify flask version * modify CHANGELOG.md * include feedback * include feedback * Fix lint and generate --------- Co-authored-by: Diego Hurtado --- CHANGELOG.md | 2 ++ instrumentation/README.md | 2 +- .../pyproject.toml | 4 ++-- .../instrumentation/flask/__init__.py | 14 ++++++++++++-- .../instrumentation/flask/package.py | 2 +- .../instrumentation/bootstrap_gen.py | 4 ++-- tox.ini | 15 ++++++++++----- 7 files changed, 30 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11363cc165..8ed9a4c205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-resource-detector-azure` Add resource detectors for Azure App Service and VM ([#1901](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1901)) +- `opentelemetry-instrumentation-flask` Add support for Flask 3.0.0 + ([#152](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2013)) ## Version 1.19.0/0.40b0 (2023-07-13) - `opentelemetry-instrumentation-asgi` Add `http.server.request.size` metric diff --git a/instrumentation/README.md b/instrumentation/README.md index cc5ea02def..b3abf387bc 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -19,7 +19,7 @@ | [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No | [opentelemetry-instrumentation-falcon](./opentelemetry-instrumentation-falcon) | falcon >= 1.4.1, < 4.0.0 | Yes | [opentelemetry-instrumentation-fastapi](./opentelemetry-instrumentation-fastapi) | fastapi ~= 0.58 | Yes -| [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0, < 3.0 | Yes +| [opentelemetry-instrumentation-flask](./opentelemetry-instrumentation-flask) | flask >= 1.0 | Yes | [opentelemetry-instrumentation-grpc](./opentelemetry-instrumentation-grpc) | grpcio ~= 1.27 | No | [opentelemetry-instrumentation-httpx](./opentelemetry-instrumentation-httpx) | httpx >= 0.18.0 | No | [opentelemetry-instrumentation-jinja2](./opentelemetry-instrumentation-jinja2) | jinja2 >= 2.7, < 4.0 | No diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 015482c19c..528e08a313 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -35,8 +35,8 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "flask >= 1.0, < 3.0", - "werkzeug < 3.0.0" + "werkzeug < 3.0.0", + "flask >= 1.0", ] test = [ "opentelemetry-instrumentation-flask[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index 5f16b14727..5e81cc5abe 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -251,6 +251,16 @@ def response_hook(span: Span, status: str, response_headers: List): from opentelemetry import context, trace from opentelemetry.instrumentation.flask.package import _instruments from opentelemetry.instrumentation.flask.version import __version__ + +try: + flask_version = flask.__version__ +except AttributeError: + try: + from importlib import metadata + except ImportError: + import importlib_metadata as metadata + flask_version = metadata.version("flask") + from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.propagators import ( get_global_response_propagator, @@ -271,7 +281,7 @@ def response_hook(span: Span, status: str, response_headers: List): _excluded_urls_from_env = get_excluded_urls("FLASK") -if package_version.parse(flask.__version__) >= package_version.parse("2.2.0"): +if package_version.parse(flask_version) >= package_version.parse("2.2.0"): def _request_ctx_ref() -> weakref.ReferenceType: return weakref.ref(flask.globals.request_ctx._get_current_object()) @@ -420,7 +430,7 @@ def _before_request(): # https://flask.palletsprojects.com/en/1.1.x/api/#flask.has_request_context if flask and flask.request: if commenter_options.get("framework", True): - flask_info["framework"] = f"flask:{flask.__version__}" + flask_info["framework"] = f"flask:{flask_version}" if ( commenter_options.get("controller", True) and flask.request.endpoint diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/package.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/package.py index 33bfe4ccba..d83adbede0 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/package.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/package.py @@ -13,6 +13,6 @@ # limitations under the License. -_instruments = ("flask >= 1.0, < 3.0",) +_instruments = ("flask >= 1.0",) _supports_metrics = True diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 097ed49ef7..59c9c5e4df 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -85,11 +85,11 @@ "instrumentation": "opentelemetry-instrumentation-fastapi==0.44b0.dev", }, { - "library": "flask >= 1.0, < 3.0", + "library": "werkzeug < 3.0.0", "instrumentation": "opentelemetry-instrumentation-flask==0.44b0.dev", }, { - "library": "werkzeug < 3.0.0", + "library": "flask >= 1.0", "instrumentation": "opentelemetry-instrumentation-flask==0.44b0.dev", }, { diff --git a/tox.ini b/tox.ini index 9541599f95..013b74e45d 100644 --- a/tox.ini +++ b/tox.ini @@ -89,6 +89,7 @@ envlist = ; opentelemetry-instrumentation-flask py3{7,8,9,10,11}-test-instrumentation-flask{213,220} + py3{8,9,10,11}-test-instrumentation-flask{300} pypy3-test-instrumentation-flask{213,220} ; opentelemetry-instrumentation-urllib @@ -273,7 +274,11 @@ deps = falcon2: falcon >=2.0.0,<3.0.0 falcon3: falcon >=3.0.0,<4.0.0 flask213: Flask ==2.1.3 - flask220: Flask >=2.2.0 + flask213: Werkzeug <3.0.0 + flask220: Flask ==2.2.0 + flask220: Werkzeug <3.0.0 + flask300: Flask >=3.0.0 + flask300: Werkzeug >=3.0.0 grpc: pytest-asyncio sqlalchemy11: sqlalchemy>=1.1,<1.2 sqlalchemy14: aiosqlite @@ -324,7 +329,7 @@ changedir = test-instrumentation-elasticsearch{2,5,6}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests test-instrumentation-falcon{1,2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests - test-instrumentation-flask{213,220}: instrumentation/opentelemetry-instrumentation-flask/tests + test-instrumentation-flask{213,220,300}: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests test-instrumentation-urllib3v{1,2}: instrumentation/opentelemetry-instrumentation-urllib3/tests test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests @@ -386,8 +391,8 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,httpx{18,21},requests,urllib,urllib3v{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] - wsgi,falcon{1,2,3},flask{213,220},django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + falcon{1,2,3},flask{213,220,300},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,httpx{18,21},requests,urllib,urllib3v{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] + wsgi,falcon{1,2,3},flask{213,220,300},django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] asgi,django{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -401,7 +406,7 @@ commands_pre = falcon{1,2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] - flask{213,220}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] + flask{213,220,300}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] urllib: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] From f2c536ed823c1cd6df0be5136112ded7384fa105 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 17 Jan 2024 17:14:43 -0600 Subject: [PATCH 091/200] Fix tox factor matching (#2129) * Fix tox factor matching Fixes #2128 * Add missing fixes for several test envs * Fix django --- .github/workflows/instrumentations_0.yml | 2 +- .github/workflows/instrumentations_1.yml | 2 +- tox.ini | 202 +++++++++++------------ 3 files changed, 100 insertions(+), 106 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index be5e3f7cb8..f4d82498ce 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -57,7 +57,7 @@ jobs: - "logging" - "mysql" - "mysqlclient" - - "pika" + - "sio-pika" - "psycopg2" - "pymemcache" - "pymongo" diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index d85897251b..a920f34dca 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -26,7 +26,7 @@ jobs: python-version: [py37, py38, py39, py310, py311, pypy3] package: - "urllib" - - "urllib3" + - "urllib3v" - "wsgi" - "distro" - "richconsole" diff --git a/tox.ini b/tox.ini index 013b74e45d..ccf1cc0c14 100644 --- a/tox.ini +++ b/tox.ini @@ -22,9 +22,6 @@ envlist = py3{7,8,9,10,11}-test-opentelemetry-instrumentation pypy3-test-opentelemetry-instrumentation - py3{7,8,9,10,11}-test-instrumentation-aio-pika - pypy3-test-instrumentation-aio-pika - ; opentelemetry-instrumentation-aiohttp-client py3{7,8,9,10,11}-test-instrumentation-aiohttp-client pypy3-test-instrumentation-aiohttp-client @@ -54,11 +51,11 @@ envlist = ; Only officially supported Python versions are tested for each Django ; major release. Updated list can be found at: ; https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django - py3{7}-test-instrumentation-django1 - py3{7,8,9}-test-instrumentation-django2 - py3{7,8,9,10,11}-test-instrumentation-django3 - py3{8,9,10,11}-test-instrumentation-django4 - pypy3-test-instrumentation-django{1,2,3} + py3{7}-test-instrumentation-django-1 + py3{7,8,9}-test-instrumentation-django-2 + py3{7,8,9,10,11}-test-instrumentation-django-3 + py3{8,9,10,11}-test-instrumentation-django-4 + pypy3-test-instrumentation-django-{1,2,3} ; opentelemetry-instrumentation-dbapi py3{7,8,9,10,11}-test-instrumentation-dbapi @@ -70,41 +67,39 @@ envlist = ; pypy3-test-instrumentation-boto ; opentelemetry-instrumentation-elasticsearch - py3{7,8,9,10,11}-test-instrumentation-elasticsearch{2,6} - pypy3-test-instrumentation-elasticsearch{2,6} - - ; opentelemetry-instrumentation-elasticsearch5 - py3{7,8,9}-test-instrumentation-elasticsearch5 - pypy3-test-instrumentation-elasticsearch5 + py3{7,8,9,10,11}-test-instrumentation-elasticsearch-{2,6} + pypy3-test-instrumentation-elasticsearch-{2,6} + py3{7,8,9}-test-instrumentation-elasticsearch-5 + pypy3-test-instrumentation-elasticsearch-5 ; opentelemetry-instrumentation-falcon ; py310 does not work with falcon 1 - py3{7,8,9}-test-instrumentation-falcon1 - py3{7,8,9,10,11}-test-instrumentation-falcon{2,3} - pypy3-test-instrumentation-falcon{1,2,3} + py3{7,8,9}-test-instrumentation-falcon-1 + py3{7,8,9,10,11}-test-instrumentation-falcon-{2,3} + pypy3-test-instrumentation-falcon-{1,2,3} ; opentelemetry-instrumentation-fastapi py3{7,8,9,10,11}-test-instrumentation-fastapi pypy3-test-instrumentation-fastapi ; opentelemetry-instrumentation-flask - py3{7,8,9,10,11}-test-instrumentation-flask{213,220} - py3{8,9,10,11}-test-instrumentation-flask{300} - pypy3-test-instrumentation-flask{213,220} + py3{7,8,9,10,11}-test-instrumentation-flask-{213,220} + py3{8,9,10,11}-test-instrumentation-flask-{300} + pypy3-test-instrumentation-flask-{213,220} ; opentelemetry-instrumentation-urllib py3{7,8,9,10,11}-test-instrumentation-urllib pypy3-test-instrumentation-urllib ; opentelemetry-instrumentation-urllib3 - py3{7,8,9,10,11}-test-instrumentation-urllib3v{1,2} - ;pypy3-test-instrumentation-urllib3v{1,2} + py3{7,8,9,10,11}-test-instrumentation-urllib3v-{1,2} + ;pypy3-test-instrumentation-urllib3v-{1,2} ; opentelemetry-instrumentation-requests py3{7,8,9,10,11}-test-instrumentation-requests ;pypy3-test-instrumentation-requests - ; opentelemetry-instrumentation-starlette. + ; opentelemetry-instrumentation-starlette py3{7,8,9,10,11}-test-instrumentation-starlette pypy3-test-instrumentation-starlette @@ -135,8 +130,8 @@ envlist = ; ext-psycopg2 intentionally excluded from pypy3 ; opentelemetry-instrumentation-pymemcache - py3{7,8,9,10,11}-test-instrumentation-pymemcache{135,200,300,342,400} - pypy3-test-instrumentation-pymemcache{135,200,300,342,400} + py3{7,8,9,10,11}-test-instrumentation-pymemcache-{135,200,300,342,400} + pypy3-test-instrumentation-pymemcache-{135,200,300,342,400} ; opentelemetry-instrumentation-pymongo py3{7,8,9,10,11}-test-instrumentation-pymongo @@ -170,9 +165,9 @@ envlist = py3{7,8,9,10,11}-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy - py3{7}-test-instrumentation-sqlalchemy{11} - py3{7,8,9,10,11}-test-instrumentation-sqlalchemy{14} - pypy3-test-instrumentation-sqlalchemy{11,14} + py3{7}-test-instrumentation-sqlalchemy-{11} + py3{7,8,9,10,11}-test-instrumentation-sqlalchemy-{14} + pypy3-test-instrumentation-sqlalchemy-{11,14} ; opentelemetry-instrumentation-redis py3{7,8,9,10,11}-test-instrumentation-redis @@ -206,8 +201,8 @@ envlist = pypy3-test-instrumentation-tortoiseorm ; opentelemetry-instrumentation-httpx - py3{7,8,9,10,11}-test-instrumentation-httpx{18,21} - pypy3-test-instrumentation-httpx{18,21} + py3{7,8,9,10,11}-test-instrumentation-httpx-{18,21} + pypy3-test-instrumentation-httpx-{18,21} ; opentelemetry-util-http py3{7,8,9,10,11}-test-util-http @@ -221,13 +216,13 @@ envlist = py3{7,8,9,10,11}-test-propagator-ot-trace pypy3-test-propagator-ot-trace - ; opentelemetry-instrumentation-pika - py3{7,8,9,10,11}-test-instrumentation-pika{0,1} - pypy3-test-instrumentation-pika{0,1} + ; opentelemetry-instrumentation-sio-pika + py3{7,8,9,10,11}-test-instrumentation-sio-pika-{0,1} + pypy3-test-instrumentation-sio-pika-{0,1} ; opentelemetry-instrumentation-aio-pika - py3{7,8,9,10,11}-test-instrumentation-aio-pika{7,8,9} - pypy3-test-instrumentation-aio-pika{7,8,9} + py3{7,8,9,10,11}-test-instrumentation-aio-pika-{7,8,9} + pypy3-test-instrumentation-aio-pika-{7,8,9} ; opentelemetry-instrumentation-kafka-python py3{7,8,9,10,11}-test-instrumentation-kafka-python @@ -255,50 +250,50 @@ deps = test: pytest-benchmark coverage: pytest coverage: pytest-cov - django1: django~=1.0 - django2: django~=2.0 - django3: django~=3.0 - django4: django>=4.0b1,<5.0 - elasticsearch2: elasticsearch-dsl>=2.0,<3.0 - elasticsearch2: elasticsearch>=2.0,<3.0 - elasticsearch5: elasticsearch-dsl>=5.0,<6.0 - elasticsearch5: elasticsearch>=5.0,<6.0 - elasticsearch6: elasticsearch-dsl>=6.0,<7.0 - elasticsearch6: elasticsearch>=6.0,<7.0 + django-1: django~=1.0 + django-2: django~=2.0 + django-3: django~=3.0 + django-4: django>=4.0b1,<5.0 + elasticsearch-2: elasticsearch-dsl>=2.0,<3.0 + elasticsearch-2: elasticsearch>=2.0,<3.0 + elasticsearch-5: elasticsearch-dsl>=5.0,<6.0 + elasticsearch-5: elasticsearch>=5.0,<6.0 + elasticsearch-6: elasticsearch-dsl>=6.0,<7.0 + elasticsearch-6: elasticsearch>=6.0,<7.0 ; FIXME: Elasticsearch >=7 causes CI workflow tests to hang, see open-telemetry/opentelemetry-python-contrib#620 - ; elasticsearch7: elasticsearch-dsl>=7.0,<8.0 - ; elasticsearch7: elasticsearch>=7.0,<8.0 - ; elasticsearch8: elasticsearch-dsl>=8.0,<9.0 - ; elasticsearch8: elasticsearch>=8.0,<9.0 - falcon1: falcon ==1.4.1 - falcon2: falcon >=2.0.0,<3.0.0 - falcon3: falcon >=3.0.0,<4.0.0 - flask213: Flask ==2.1.3 - flask213: Werkzeug <3.0.0 - flask220: Flask ==2.2.0 - flask220: Werkzeug <3.0.0 - flask300: Flask >=3.0.0 - flask300: Werkzeug >=3.0.0 + ; elasticsearch-7: elasticsearch-dsl>=7.0,<8.0 + ; elasticsearch-7: elasticsearch>=7.0,<8.0 + ; elasticsearch-8: elasticsearch-dsl>=8.0,<9.0 + ; elasticsearch-8: elasticsearch>=8.0,<9.0 + falcon-1: falcon ==1.4.1 + falcon-2: falcon >=2.0.0,<3.0.0 + falcon-3: falcon >=3.0.0,<4.0.0 + flask-213: Flask ==2.1.3 + flask-213: Werkzeug <3.0.0 + flask-220: Flask ==2.2.0 + flask-220: Werkzeug <3.0.0 + flask-300: Flask >=3.0.0 + flask-300: Werkzeug >=3.0.0 grpc: pytest-asyncio - sqlalchemy11: sqlalchemy>=1.1,<1.2 - sqlalchemy14: aiosqlite - sqlalchemy14: sqlalchemy~=1.4 - pika0: pika>=0.12.0,<1.0.0 - pika1: pika>=1.0.0 - aio-pika7: aio_pika~=7.2.0 - aio-pika8: aio_pika>=8.0.0,<9.0.0 - aio-pika9: aio_pika>=9.0.0,<10.0.0 - pymemcache135: pymemcache ==1.3.5 - pymemcache200: pymemcache >2.0.0,<3.0.0 - pymemcache300: pymemcache >3.0.0,<3.4.2 - pymemcache342: pymemcache ==3.4.2 - pymemcache400: pymemcache ==4.0.0 - httpx18: httpx>=0.18.0,<0.19.0 - httpx18: respx~=0.17.0 - httpx21: httpx>=0.19.0 - httpx21: respx~=0.20.1 - urllib3v1: urllib3 >=1.0.0,<2.0.0 - urllib3v2: urllib3 >=2.0.0,<3.0.0 + sqlalchemy-11: sqlalchemy>=1.1,<1.2 + sqlalchemy-14: aiosqlite + sqlalchemy-14: sqlalchemy~=1.4 + sio-pika-0: pika>=0.12.0,<1.0.0 + sio-pika-1: pika>=1.0.0 + aio-pika-7: aio_pika~=7.2.0 + aio-pika-8: aio_pika>=8.0.0,<9.0.0 + aio-pika-9: aio_pika>=9.0.0,<10.0.0 + pymemcache-135: pymemcache ==1.3.5 + pymemcache-200: pymemcache >2.0.0,<3.0.0 + pymemcache-300: pymemcache >3.0.0,<3.4.2 + pymemcache-342: pymemcache ==3.4.2 + pymemcache-400: pymemcache ==4.0.0 + httpx-18: httpx>=0.18.0,<0.19.0 + httpx-18: respx~=0.17.0 + httpx-21: httpx>=0.19.0 + httpx-21: respx~=0.20.1 + urllib3v-1: urllib3 >=1.0.0,<2.0.0 + urllib3v-2: urllib3 >=2.0.0,<3.0.0 ; FIXME: add coverage testing ; FIXME: add mypy testing @@ -312,7 +307,6 @@ setenv = changedir = test-distro: opentelemetry-distro/tests test-opentelemetry-instrumentation: opentelemetry-instrumentation/tests - test-instrumentation-aio-pika: instrumentation/opentelemetry-instrumentation-aio-pika/tests test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests test-instrumentation-aiohttp-server: instrumentation/opentelemetry-instrumentation-aiohttp-server/tests test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests @@ -325,13 +319,13 @@ changedir = test-instrumentation-cassandra: instrumentation/opentelemetry-instrumentation-cassandra/tests test-instrumentation-celery: instrumentation/opentelemetry-instrumentation-celery/tests test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests - test-instrumentation-django{1,2,3,4}: instrumentation/opentelemetry-instrumentation-django/tests - test-instrumentation-elasticsearch{2,5,6}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests - test-instrumentation-falcon{1,2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests + test-instrumentation-django-{1,2,3,4}: instrumentation/opentelemetry-instrumentation-django/tests + test-instrumentation-elasticsearch-{2,5,6}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests + test-instrumentation-falcon-{1,2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests - test-instrumentation-flask{213,220,300}: instrumentation/opentelemetry-instrumentation-flask/tests + test-instrumentation-flask-{213,220,300}: instrumentation/opentelemetry-instrumentation-flask/tests test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests - test-instrumentation-urllib3v{1,2}: instrumentation/opentelemetry-instrumentation-urllib3/tests + test-instrumentation-urllib3v-{1,2}: instrumentation/opentelemetry-instrumentation-urllib3/tests test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests test-instrumentation-jinja2: instrumentation/opentelemetry-instrumentation-jinja2/tests test-instrumentation-kafka-python: instrumentation/opentelemetry-instrumentation-kafka-python/tests @@ -339,10 +333,10 @@ changedir = test-instrumentation-logging: instrumentation/opentelemetry-instrumentation-logging/tests test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests test-instrumentation-mysqlclient: instrumentation/opentelemetry-instrumentation-mysqlclient/tests - test-instrumentation-pika{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests - test-instrumentation-aio-pika{7,8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests + test-instrumentation-sio-pika-{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests + test-instrumentation-aio-pika-{7,8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests - test-instrumentation-pymemcache{135,200,300,342,400}: instrumentation/opentelemetry-instrumentation-pymemcache/tests + test-instrumentation-pymemcache-{135,200,300,342,400}: instrumentation/opentelemetry-instrumentation-pymemcache/tests test-instrumentation-pymongo: instrumentation/opentelemetry-instrumentation-pymongo/tests test-instrumentation-pymysql: instrumentation/opentelemetry-instrumentation-pymysql/tests test-instrumentation-pyramid: instrumentation/opentelemetry-instrumentation-pyramid/tests @@ -350,14 +344,14 @@ changedir = test-instrumentation-remoulade: instrumentation/opentelemetry-instrumentation-remoulade/tests test-instrumentation-requests: instrumentation/opentelemetry-instrumentation-requests/tests test-instrumentation-sklearn: instrumentation/opentelemetry-instrumentation-sklearn/tests - test-instrumentation-sqlalchemy{11,14}: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests + test-instrumentation-sqlalchemy-{11,14}: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests test-instrumentation-sqlite3: instrumentation/opentelemetry-instrumentation-sqlite3/tests test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests test-instrumentation-system-metrics: instrumentation/opentelemetry-instrumentation-system-metrics/tests test-instrumentation-tornado: instrumentation/opentelemetry-instrumentation-tornado/tests test-instrumentation-tortoiseorm: instrumentation/opentelemetry-instrumentation-tortoiseorm/tests test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests - test-instrumentation-httpx{18,21}: instrumentation/opentelemetry-instrumentation-httpx/tests + test-instrumentation-httpx-{18,21}: instrumentation/opentelemetry-instrumentation-httpx/tests test-util-http: util/opentelemetry-util-http/tests test-sdkextension-aws: sdk-extension/opentelemetry-sdk-extension-aws/tests test-resource-detector-container: resource/opentelemetry-resource-detector-container/tests @@ -381,9 +375,9 @@ commands_pre = celery: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] - pika{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] + sio-pika-{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] - aio-pika{7,8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + aio-pika-{7,8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] kafka-python: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] @@ -391,9 +385,9 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon{1,2,3},flask{213,220,300},django{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,httpx{18,21},requests,urllib,urllib3v{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http[test] - wsgi,falcon{1,2,3},flask{213,220,300},django{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] - asgi,django{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] + falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http + wsgi,falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + asgi,django-{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -404,13 +398,13 @@ commands_pre = boto3sqs: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] - falcon{1,2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] + falcon-{1,2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] - flask{213,220,300}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] + flask-{213,220,300}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] urllib: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] - urllib3v{1,2}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] + urllib3v-{1,2}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] @@ -418,7 +412,7 @@ commands_pre = dbapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] - django{1,2,3,4}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] + django-{1,2,3,4}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] @@ -426,7 +420,7 @@ commands_pre = mysqlclient: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] - pymemcache{135,200,300,342,400}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] + pymemcache-{135,200,300,342,400}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] @@ -456,7 +450,7 @@ commands_pre = logging: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] - aio-pika: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + aio-pika-{7,8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] aiohttp-client: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] @@ -470,17 +464,17 @@ commands_pre = sklearn: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] - sqlalchemy{11,14}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] + sqlalchemy-{11,14}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] - elasticsearch{2,5,6}: pip install {toxinidir}/opentelemetry-instrumentation[test] {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] + elasticsearch-{2,5,6}: pip install {toxinidir}/opentelemetry-instrumentation[test] {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] - httpx{18,21}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] + httpx-{18,21}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] sdkextension-aws: pip install {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] resource-detector-container: pip install {toxinidir}/resource/opentelemetry-resource-detector-container[test] - http: pip install {toxinidir}/util/opentelemetry-util-http[test] + http: pip install {toxinidir}/util/opentelemetry-util-http ; In order to get a health coverage report, propagator-ot-trace: pip install {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] @@ -531,7 +525,7 @@ commands_pre = python -m pip install "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" python -m pip install "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" python -m pip install "{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" - python -m pip install -e {toxinidir}/util/opentelemetry-util-http[test] + python -m pip install -e {toxinidir}/util/opentelemetry-util-http python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] From 743c2fe2d8a413d2a5f12216edc6ffd6c28e856f Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Wed, 24 Jan 2024 10:10:51 -0800 Subject: [PATCH 092/200] Update azure resource detector timeout to 4 seconds (#2136) --- CHANGELOG.md | 2 ++ .../src/opentelemetry/resource/detector/azure/version.py | 2 +- .../src/opentelemetry/resource/detector/azure/vm.py | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed9a4c205..024c8473d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) +- `opentelemetry-resource-detector-azure` Changed timeout to 4 seconds due to [timeout bug](https://github.com/open-telemetry/opentelemetry-python/issues/3644) + ([#2136](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2136)) ## Version 1.22.0/0.43b0 (2023-12-14) diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py index 7b936f07f0..97109f529b 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.1.1" +__version__ = "0.1.2" diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index e90fec5a8d..b0e0f4d45b 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -68,7 +68,10 @@ def get_azure_vm_metadata(self): # pylint: disable=no-self-use request = Request(_AZURE_VM_METADATA_ENDPOINT) request.add_header("Metadata", "True") try: - with urlopen(request, timeout=10) as response: + # TODO: Changed to 4s to fit into OTel SDK's 5 second timeout. + # Lengthen or allow user input if issue is resolved. + # See https://github.com/open-telemetry/opentelemetry-python/issues/3644 + with urlopen(request, timeout=4) as response: return loads(response.read()) except URLError: # Not on Azure VM From a93bd74dc3969c13db1d6f603689ee8d9650ce66 Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Thu, 25 Jan 2024 10:05:40 -0800 Subject: [PATCH 093/200] Increment resource detector version (#2137) From 4b1a9c75db469a061d0a61f1f861e3121e75f37a Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Wed, 31 Jan 2024 00:11:00 -0300 Subject: [PATCH 094/200] feat: configure header extraction for ASGI middleware via constructor params (#2026) * feat: configure header extraction for ASGI middleware via constructor params * fix django middleware * lint * remove import * Fix lint * Update instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py --- CHANGELOG.md | 2 + .../instrumentation/asgi/__init__.py | 118 +++++++++++------- .../tests/test_asgi_custom_headers.py | 74 +++++++++-- .../tests/test_asgi_middleware.py | 14 +-- .../django/middleware/otel_middleware.py | 39 ++++-- .../tests/test_starlette_instrumentation.py | 38 +++--- .../src/opentelemetry/util/http/__init__.py | 21 ++-- 7 files changed, 208 insertions(+), 98 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 024c8473d4..710947c18b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1948](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1948)) - Added schema_url (`"https://opentelemetry.io/schemas/1.11.0"`) to all metrics and traces ([#1977](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1977)) +- Add support for configuring ASGI middleware header extraction via runtime constructor parameters + ([#2026](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2026)) ### Fixed diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index 6ae6ce1790..dba7414cb1 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -189,11 +189,13 @@ def client_response_hook(span: Span, message: dict): --- """ +from __future__ import annotations + import typing import urllib from functools import wraps from timeit import default_timer -from typing import Tuple +from typing import Any, Awaitable, Callable, Tuple, cast from asgiref.compatibility import guarantee_single_callable @@ -332,55 +334,28 @@ def collect_request_attributes(scope): return result -def collect_custom_request_headers_attributes(scope): - """returns custom HTTP request headers to be added into SERVER span as span attributes - Refer specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-request-and-response-headers +def collect_custom_headers_attributes( + scope_or_response_message: dict[str, Any], + sanitize: SanitizeValue, + header_regexes: list[str], + normalize_names: Callable[[str], str], +) -> dict[str, str]: """ + Returns custom HTTP request or response headers to be added into SERVER span as span attributes. - sanitize = SanitizeValue( - get_custom_headers( - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS - ) - ) - - # Decode headers before processing. - headers = { - _key.decode("utf8"): _value.decode("utf8") - for (_key, _value) in scope.get("headers") - } - - return sanitize.sanitize_header_values( - headers, - get_custom_headers( - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST - ), - normalise_request_header_name, - ) - - -def collect_custom_response_headers_attributes(message): - """returns custom HTTP response headers to be added into SERVER span as span attributes - Refer specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-request-and-response-headers + Refer specifications: + - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-request-and-response-headers """ - - sanitize = SanitizeValue( - get_custom_headers( - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS - ) - ) - # Decode headers before processing. - headers = { + headers: dict[str, str] = { _key.decode("utf8"): _value.decode("utf8") - for (_key, _value) in message.get("headers") + for (_key, _value) in scope_or_response_message.get("headers") + or cast("list[tuple[bytes, bytes]]", []) } - return sanitize.sanitize_header_values( headers, - get_custom_headers( - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE - ), - normalise_response_header_name, + header_regexes, + normalize_names, ) @@ -493,6 +468,9 @@ def __init__( tracer_provider=None, meter_provider=None, meter=None, + http_capture_headers_server_request: list[str] | None = None, + http_capture_headers_server_response: list[str] | None = None, + http_capture_headers_sanitize_fields: list[str] | None = None, ): self.app = guarantee_single_callable(app) self.tracer = trace.get_tracer( @@ -540,7 +518,41 @@ def __init__( self.client_response_hook = client_response_hook self.content_length_header = None - async def __call__(self, scope, receive, send): + # Environment variables as constructor parameters + self.http_capture_headers_server_request = ( + http_capture_headers_server_request + or ( + get_custom_headers( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST + ) + ) + or None + ) + self.http_capture_headers_server_response = ( + http_capture_headers_server_response + or ( + get_custom_headers( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE + ) + ) + or None + ) + self.http_capture_headers_sanitize_fields = SanitizeValue( + http_capture_headers_sanitize_fields + or ( + get_custom_headers( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS + ) + ) + or [] + ) + + async def __call__( + self, + scope: dict[str, Any], + receive: Callable[[], Awaitable[dict[str, Any]]], + send: Callable[[dict[str, Any]], Awaitable[None]], + ) -> None: """The ASGI application Args: @@ -583,7 +595,14 @@ async def __call__(self, scope, receive, send): if current_span.kind == trace.SpanKind.SERVER: custom_attributes = ( - collect_custom_request_headers_attributes(scope) + collect_custom_headers_attributes( + scope, + self.http_capture_headers_sanitize_fields, + self.http_capture_headers_server_request, + normalise_request_header_name, + ) + if self.http_capture_headers_server_request + else {} ) if len(custom_attributes) > 0: current_span.set_attributes(custom_attributes) @@ -658,7 +677,7 @@ def _get_otel_send( expecting_trailers = False @wraps(send) - async def otel_send(message): + async def otel_send(message: dict[str, Any]): nonlocal expecting_trailers with self.tracer.start_as_current_span( " ".join((server_span_name, scope["type"], "send")) @@ -685,7 +704,14 @@ async def otel_send(message): and "headers" in message ): custom_response_attributes = ( - collect_custom_response_headers_attributes(message) + collect_custom_headers_attributes( + message, + self.http_capture_headers_sanitize_fields, + self.http_capture_headers_server_response, + normalise_response_header_name, + ) + if self.http_capture_headers_server_response + else {} ) if len(custom_response_attributes) > 0: server_span.set_attributes( diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py index 2d50d0704f..c50839f72f 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py @@ -1,4 +1,4 @@ -from unittest import mock +import os import opentelemetry.instrumentation.asgi as otel_asgi from opentelemetry.test.asgitestutil import AsgiTestBase @@ -72,21 +72,22 @@ async def websocket_app_with_custom_headers(scope, receive, send): break -@mock.patch.dict( - "os.environ", - { - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS: ".*my-secret.*", - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*", - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*", - }, -) class TestCustomHeaders(AsgiTestBase, TestBase): + constructor_params = {} + __test__ = False + + def __init_subclass__(cls) -> None: + if cls is not TestCustomHeaders: + cls.__test__ = True + def setUp(self): super().setUp() self.tracer_provider, self.exporter = TestBase.create_tracer_provider() self.tracer = self.tracer_provider.get_tracer(__name__) self.app = otel_asgi.OpenTelemetryMiddleware( - simple_asgi, tracer_provider=self.tracer_provider + simple_asgi, + tracer_provider=self.tracer_provider, + **self.constructor_params, ) def test_http_custom_request_headers_in_span_attributes(self): @@ -148,7 +149,9 @@ def test_http_custom_request_headers_not_in_span_attributes(self): def test_http_custom_response_headers_in_span_attributes(self): self.app = otel_asgi.OpenTelemetryMiddleware( - http_app_with_custom_headers, tracer_provider=self.tracer_provider + http_app_with_custom_headers, + tracer_provider=self.tracer_provider, + **self.constructor_params, ) self.seed_app(self.app) self.send_default_request() @@ -175,7 +178,9 @@ def test_http_custom_response_headers_in_span_attributes(self): def test_http_custom_response_headers_not_in_span_attributes(self): self.app = otel_asgi.OpenTelemetryMiddleware( - http_app_with_custom_headers, tracer_provider=self.tracer_provider + http_app_with_custom_headers, + tracer_provider=self.tracer_provider, + **self.constructor_params, ) self.seed_app(self.app) self.send_default_request() @@ -277,6 +282,7 @@ def test_websocket_custom_response_headers_in_span_attributes(self): self.app = otel_asgi.OpenTelemetryMiddleware( websocket_app_with_custom_headers, tracer_provider=self.tracer_provider, + **self.constructor_params, ) self.seed_app(self.app) self.send_input({"type": "websocket.connect"}) @@ -317,6 +323,7 @@ def test_websocket_custom_response_headers_not_in_span_attributes(self): self.app = otel_asgi.OpenTelemetryMiddleware( websocket_app_with_custom_headers, tracer_provider=self.tracer_provider, + **self.constructor_params, ) self.seed_app(self.app) self.send_input({"type": "websocket.connect"}) @@ -333,3 +340,46 @@ def test_websocket_custom_response_headers_not_in_span_attributes(self): if span.kind == SpanKind.SERVER: for key, _ in not_expected.items(): self.assertNotIn(key, span.attributes) + + +SANITIZE_FIELDS_TEST_VALUE = ".*my-secret.*" +SERVER_REQUEST_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*" +SERVER_RESPONSE_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*" + + +class TestCustomHeadersEnv(TestCustomHeaders): + def setUp(self): + os.environ.update( + { + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS: SANITIZE_FIELDS_TEST_VALUE, + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST: SERVER_REQUEST_TEST_VALUE, + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: SERVER_RESPONSE_TEST_VALUE, + } + ) + super().setUp() + + def tearDown(self): + os.environ.pop( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS, None + ) + os.environ.pop( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST, None + ) + os.environ.pop( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE, None + ) + super().tearDown() + + +class TestCustomHeadersConstructor(TestCustomHeaders): + constructor_params = { + "http_capture_headers_sanitize_fields": SANITIZE_FIELDS_TEST_VALUE.split( + "," + ), + "http_capture_headers_server_request": SERVER_REQUEST_TEST_VALUE.split( + "," + ), + "http_capture_headers_server_response": SERVER_RESPONSE_TEST_VALUE.split( + "," + ), + } diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 4819f80630..0b2a844d96 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -983,18 +983,16 @@ class TestAsgiApplicationRaisingError(AsgiTestBase): def tearDown(self): pass - @mock.patch( - "opentelemetry.instrumentation.asgi.collect_custom_request_headers_attributes", - side_effect=ValueError("whatever"), - ) - def test_asgi_issue_1883( - self, mock_collect_custom_request_headers_attributes - ): + def test_asgi_issue_1883(self): """ Test that exception UnboundLocalError local variable 'start' referenced before assignment is not raised See https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1883 """ - app = otel_asgi.OpenTelemetryMiddleware(simple_asgi) + + async def bad_app(_scope, _receive, _send): + raise ValueError("whatever") + + app = otel_asgi.OpenTelemetryMiddleware(bad_app) self.seed_app(app) self.send_default_request() try: diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py index 491e78cab5..bc677a81cf 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/otel_middleware.py @@ -43,10 +43,17 @@ from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.trace import Span, SpanKind, use_span from 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, + SanitizeValue, _parse_active_request_count_attrs, _parse_duration_attrs, + get_custom_headers, get_excluded_urls, get_traced_request_attrs, + normalise_request_header_name, + normalise_response_header_name, ) try: @@ -91,10 +98,7 @@ def __call__(self, request): try: from opentelemetry.instrumentation.asgi import asgi_getter, asgi_setter from opentelemetry.instrumentation.asgi import ( - collect_custom_request_headers_attributes as asgi_collect_custom_request_attributes, - ) - from opentelemetry.instrumentation.asgi import ( - collect_custom_response_headers_attributes as asgi_collect_custom_response_attributes, + collect_custom_headers_attributes as asgi_collect_custom_headers_attributes, ) from opentelemetry.instrumentation.asgi import ( collect_request_attributes as asgi_collect_request_attributes, @@ -108,7 +112,6 @@ def __call__(self, request): set_status_code = None _is_asgi_supported = False - _logger = getLogger(__name__) _attributes_by_preference = [ [ @@ -249,7 +252,18 @@ def process_request(self, request): ) if span.is_recording() and span.kind == SpanKind.SERVER: attributes.update( - asgi_collect_custom_request_attributes(carrier) + asgi_collect_custom_headers_attributes( + carrier, + SanitizeValue( + get_custom_headers( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS + ) + ), + get_custom_headers( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST + ), + normalise_request_header_name, + ) ) else: if span.is_recording() and span.kind == SpanKind.SERVER: @@ -336,8 +350,17 @@ def process_response(self, request, response): for key, value in response.items(): asgi_setter.set(custom_headers, key, value) - custom_res_attributes = ( - asgi_collect_custom_response_attributes(custom_headers) + custom_res_attributes = asgi_collect_custom_headers_attributes( + custom_headers, + SanitizeValue( + get_custom_headers( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS + ) + ), + get_custom_headers( + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE + ), + normalise_response_header_name, ) for key, value in custom_res_attributes.items(): span.set_attribute(key, value) diff --git a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py index e1c77312a4..3784672fb5 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py @@ -467,15 +467,18 @@ async def _(websocket: WebSocket) -> None: return app -@patch.dict( - "os.environ", - { - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS: ".*my-secret.*", - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*", - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*", - }, -) class TestHTTPAppWithCustomHeaders(TestBaseWithCustomHeaders): + @patch.dict( + "os.environ", + { + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS: ".*my-secret.*", + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*", + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*", + }, + ) + def setUp(self) -> None: + super().setUp() + def test_custom_request_headers_in_span_attributes(self): expected = { "http.request.header.custom_test_header_1": ( @@ -590,15 +593,18 @@ def test_custom_response_headers_not_in_span_attributes(self): self.assertNotIn(key, server_span.attributes) -@patch.dict( - "os.environ", - { - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS: ".*my-secret.*", - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*", - OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*", - }, -) class TestWebSocketAppWithCustomHeaders(TestBaseWithCustomHeaders): + @patch.dict( + "os.environ", + { + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS: ".*my-secret.*", + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*", + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*", + }, + ) + def setUp(self) -> None: + super().setUp() + def test_custom_request_headers_in_span_attributes(self): expected = { "http.request.header.custom_test_header_1": ( diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py index 054ade6d27..523f9400b1 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import annotations + from os import environ from re import IGNORECASE as RE_IGNORECASE from re import compile as re_compile from re import search -from typing import Iterable, List, Optional +from typing import Callable, Iterable, Optional from urllib.parse import urlparse, urlunparse from opentelemetry.semconv.trace import SpanAttributes @@ -84,9 +86,12 @@ def sanitize_header_value(self, header: str, value: str) -> str: ) def sanitize_header_values( - self, headers: dict, header_regexes: list, normalize_function: callable - ) -> dict: - values = {} + self, + headers: dict[str, str], + header_regexes: list[str], + normalize_function: Callable[[str], str], + ) -> dict[str, str]: + values: dict[str, str] = {} if header_regexes: header_regexes_compiled = re_compile( @@ -216,14 +221,14 @@ def sanitize_method(method: Optional[str]) -> Optional[str]: return "UNKNOWN" -def get_custom_headers(env_var: str) -> List[str]: - custom_headers = environ.get(env_var, []) +def get_custom_headers(env_var: str) -> list[str]: + custom_headers = environ.get(env_var, None) if custom_headers: - custom_headers = [ + return [ custom_headers.strip() for custom_headers in custom_headers.split(",") ] - return custom_headers + return [] def _parse_active_request_count_attrs(req_attrs): From e88bf5f27a3fb3cbcdcfd8a6dffd6204ac580d2f Mon Sep 17 00:00:00 2001 From: Steve Flanders Date: Tue, 30 Jan 2024 23:01:46 -0500 Subject: [PATCH 095/200] Update opentelemetry-instrument README (#2108) * Update opentelemetry-instrument README - Clarify trace versus metric documentation - Add console exporter documentation - Add quotes to command to support zsh - Fix grammatical errors * fix typo * fix typo * Remove note on HTTP for trace only --------- --- opentelemetry-instrumentation/README.rst | 50 +++++++++++++----------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/opentelemetry-instrumentation/README.rst b/opentelemetry-instrumentation/README.rst index df21ce5b3d..6f66edb623 100644 --- a/opentelemetry-instrumentation/README.rst +++ b/opentelemetry-instrumentation/README.rst @@ -14,7 +14,7 @@ Installation pip install opentelemetry-instrumentation -This package provides a couple of commands that help automatically instruments a program: +This package provides commands that help automatically instrument a program: .. note:: You need to install a distro package to get auto instrumentation working. The ``opentelemetry-distro`` @@ -22,7 +22,7 @@ This package provides a couple of commands that help automatically instruments a For more info about ``opentelemetry-distro`` check `here `__ :: - pip install opentelemetry-distro[otlp] + pip install "opentelemetry-distro[otlp]" When creating a custom distro and/or configurator, be sure to add entry points for each under `opentelemetry_distro` and `opentelemetry_configurator` respectfully. If you have entry points for multiple distros or configurators present in your environment, you should specify the entry point name of the distro and configurator you want to be used via the `OTEL_PYTHON_DISTRO` and `OTEL_PYTHON_CONFIGURATOR` environment variables. @@ -33,13 +33,14 @@ opentelemetry-bootstrap :: - opentelemetry-bootstrap --action=install|requirements + opentelemetry-bootstrap [-a |--action=][install|requirements] -This commands inspects the active Python site-packages and figures out which -instrumentation packages the user might want to install. By default it prints out -a list of the suggested instrumentation packages which can be added to a requirements.txt -file. It also supports installing the suggested packages when run with :code:`--action=install` -flag. +This command install default instrumentation packages and detects active Python site-packages +to figure out which instrumentation packages the user might want to install. By default, it +prints out a list of the default and detected instrumentation packages that can be added to a +requirements.txt file. It also supports installing the packages when run with +:code:`--action=install` or :code:`-a install` flag. All default and detectable +instrumentation packages are defined `here `. opentelemetry-instrument @@ -51,12 +52,12 @@ opentelemetry-instrument The instrument command will try to automatically detect packages used by your python program and when possible, apply automatic tracing instrumentation on them. This means your program -will get automatic distributed tracing for free without having to make any code changes -at all. This will also configure a global tracer and tracing exporter without you having to -make any code changes. By default, the instrument command will use the OTLP exporter but -this can be overridden when needed. +will get automatic distributed tracing without having to make any code changes. This will +also configure a global tracer and tracing exporter as well as a meter and meter exporter. +By default, the instrument command will use the OTLP exporter but this can be overridden. -The command supports the following configuration options as CLI arguments and environment vars: +The command supports the following configuration options as CLI arguments and environment +variables: * ``--traces_exporter`` or ``OTEL_TRACES_EXPORTER`` @@ -64,27 +65,32 @@ The command supports the following configuration options as CLI arguments and en * ``--distro`` or ``OTEL_PYTHON_DISTRO`` * ``--configurator`` or ``OTEL_PYTHON_CONFIGURATOR`` -Used to specify which trace exporter to use. Can be set to one or more of the well-known exporter -names (see below). +The exporter options define what exporter destination to use and can be set to one or more +exporter names (see below). You can pass multiple values to configure multiple exporters +(e.g., ``zipkin_json,otlp``). - Defaults to `otlp`. - Can be set to `none` to disable automatic tracer initialization. + - Can be set to 'console` to display JSON results locally. -You can pass multiple values to configure multiple exporters e.g, ``zipkin,prometheus`` - -Well known trace exporter names: +Trace exporter names: - jaeger_proto - jaeger_thrift - opencensus + - otlp + - otlp_proto_grpc (`deprecated`) + - otlp_proto_http (`deprecated`) - zipkin_json - zipkin_proto + +Metric exporter names: + - otlp - otlp_proto_grpc (`deprecated`) - - otlp_proto_http (`deprecated`) + - prometheus Note: The default transport protocol for ``otlp`` is gRPC. -HTTP is currently supported for traces only, and should be set using ``OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf`` * ``--id-generator`` or ``OTEL_PYTHON_ID_GENERATOR`` @@ -106,9 +112,9 @@ Examples :: - opentelemetry-instrument --traces_exporter otlp flask run --port=3000 + opentelemetry-instrument --traces_exporter console flask run --port=3000 -The above command will pass ``--traces_exporter otlp`` to the instrument command and ``--port=3000`` to ``flask run``. +The above command will pass ``--traces_exporter console`` to the instrument command and ``--port=3000`` to ``flask run``. :: From 3400ecea5d9e6c96c950cbf2183feeb3a84b3e91 Mon Sep 17 00:00:00 2001 From: Ben Beasley Date: Tue, 30 Jan 2024 23:24:33 -0500 Subject: [PATCH 096/200] Remove useless shebangs (#2135) These files do not have the executable bit set in their filesystem permissions (so the shebang line, `#!`, is useless), and they are not script-like (do not have `if __name__ == "__main__"` or interesting side-effects), so making them executable would not make sense. --- .../django/middleware/sqlcommenter_middleware.py | 2 -- .../instrumentation/auto_instrumentation/__init__.py | 2 -- .../src/opentelemetry/instrumentation/bootstrap.py | 2 -- 3 files changed, 6 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/sqlcommenter_middleware.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/sqlcommenter_middleware.py index 89d8a9b776..30492a8be5 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/sqlcommenter_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware/sqlcommenter_middleware.py @@ -1,5 +1,3 @@ -#!/usr/bin/python -# # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/__init__.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/__init__.py index 5758ef1834..a09334432d 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/__init__.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py index afd5a045d9..0c8f0aa3c4 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); From c68d0fd1923f9b37d425a76a1ec24897f3c335fe Mon Sep 17 00:00:00 2001 From: Sofiia Tesliuk <33581458+sofiia-tesliuk@users.noreply.github.com> Date: Wed, 31 Jan 2024 04:48:45 +0000 Subject: [PATCH 097/200] Add support for confluent_kafka until 2.3.0 version; (#2132) * Updated version of supported confluent kafka to 2.3; * Updated CHANGELOG.md; --------- --- CHANGELOG.md | 2 ++ docs-requirements.txt | 2 +- instrumentation/README.md | 2 +- .../pyproject.toml | 2 +- .../opentelemetry/instrumentation/confluent_kafka/package.py | 2 +- .../src/opentelemetry/instrumentation/bootstrap_gen.py | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 710947c18b..369d7d7c62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) +- `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions until 2.3.0 of confluent_kafka + ([#2132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2132)) - `opentelemetry-resource-detector-azure` Changed timeout to 4 seconds due to [timeout bug](https://github.com/open-telemetry/opentelemetry-python/issues/3644) ([#2136](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2136)) diff --git a/docs-requirements.txt b/docs-requirements.txt index 965ea850c2..b3f2998862 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -27,7 +27,7 @@ botocore~=1.0 boto3~=1.0 cassandra-driver~=3.25 celery>=4.0 -confluent-kafka>= 1.8.2,<= 2.2.0 +confluent-kafka>= 1.8.2,<= 2.3.0 elasticsearch>=2.0,<9.0 flask~=2.0 falcon~=2.0 diff --git a/instrumentation/README.md b/instrumentation/README.md index b3abf387bc..2d77e806c5 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -13,7 +13,7 @@ | [opentelemetry-instrumentation-botocore](./opentelemetry-instrumentation-botocore) | botocore ~= 1.0 | No | [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No | [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No -| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.2.0 | No +| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.3.0 | No | [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No | [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 2.0 | No diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 2ef1fd6b49..69a334b2a1 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "confluent-kafka >= 1.8.2, <= 2.2.0", + "confluent-kafka >= 1.8.2, <= 2.3.0", ] test = [ "opentelemetry-instrumentation-confluent-kafka[instruments]", diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py index 21d37ebfae..bbc900c1dd 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/package.py @@ -13,4 +13,4 @@ # limitations under the License. -_instruments = ("confluent-kafka >= 1.8.2, <= 2.2.0",) +_instruments = ("confluent-kafka >= 1.8.2, <= 2.3.0",) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 59c9c5e4df..bf94b44d25 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -65,7 +65,7 @@ "instrumentation": "opentelemetry-instrumentation-celery==0.44b0.dev", }, { - "library": "confluent-kafka >= 1.8.2, <= 2.2.0", + "library": "confluent-kafka >= 1.8.2, <= 2.3.0", "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.44b0.dev", }, { From 6c13a5eddce4c8446805759bf099a3e79dcd9083 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Sat, 3 Feb 2024 11:57:08 -0600 Subject: [PATCH 098/200] Drop support for 3.7 (#2152) * Drop support for 3.7 Fixes #2151 * Remove 37 --- .github/workflows/instrumentations_0.yml | 5 +- .github/workflows/instrumentations_1.yml | 5 +- .github/workflows/release.yml | 4 +- CHANGELOG.md | 2 + CONTRIBUTING.md | 2 +- _template/pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 2 +- .../pyproject.toml | 3 +- .../pyproject.toml | 2 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../tests/test_redis.py | 19 +-- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- opentelemetry-distro/pyproject.toml | 3 +- opentelemetry-instrumentation/pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- .../pyproject.toml | 3 +- tox.ini | 130 +++++++++--------- util/opentelemetry-util-http/pyproject.toml | 3 +- 64 files changed, 129 insertions(+), 207 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index f4d82498ce..c0df94171d 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -12,18 +12,17 @@ jobs: instrumentations-0: env: # We use these variables to convert between tox and GHA version literals - py37: 3.7 py38: 3.8 py39: 3.9 py310: "3.10" py311: "3.11" - pypy3: pypy-3.7 + pypy3: pypy-3.8 RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: - python-version: [py37, py38, py39, py310, py311, pypy3] + python-version: [py38, py39, py310, py311, pypy3] package: # Do not add more instrumentations here, add them in instrumentations_1.yml. # The reason for this separation of instrumentations into more than one YAML file is diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index a920f34dca..5b57472076 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -12,18 +12,17 @@ jobs: instrumentations-1: env: # We use these variables to convert between tox and GHA version literals - py37: 3.7 py38: 3.8 py39: 3.9 py310: "3.10" py311: "3.11" - pypy3: pypy-3.7 + pypy3: pypy-3.8 RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: - python-version: [py37, py38, py39, py310, py311, pypy3] + python-version: [py38, py39, py310, py311, pypy3] package: - "urllib" - "urllib3v" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e3c0c6f30..3346d64245 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: # next few steps publish to pypi - uses: actions/setup-python@v1 with: - python-version: '3.7' + python-version: '3.8' - name: Build wheels run: ./scripts/build.sh @@ -202,4 +202,4 @@ jobs: gh pr create --title "$message" \ --body "$body" \ --head $branch \ - --base main \ No newline at end of file + --base main diff --git a/CHANGELOG.md b/CHANGELOG.md index 369d7d7c62..c0d73faa6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Drop uspport for 3.7 + ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151)) - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) - `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions until 2.3.0 of confluent_kafka diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b79d25492a..eb5f649e13 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,7 @@ You can run `tox` with the following arguments: - `tox` to run all existing tox commands, including unit tests for all packages under multiple Python versions - `tox -e docs` to regenerate the API docs -- `tox -e py37-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific +- `tox -e py311-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific Python version - `tox -e spellcheck` to run a spellcheck on all the code - `tox -e lint` to run lint checks on all code diff --git a/_template/pyproject.toml b/_template/pyproject.toml index f088661c3a..55607cc9b1 100644 --- a/_template/pyproject.toml +++ b/_template/pyproject.toml @@ -12,7 +12,7 @@ dynamic = ["version"] description = "" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -22,7 +22,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml b/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml index 49ae48d397..a6dea9a9de 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml @@ -9,7 +9,7 @@ dynamic = ["version"] description = "Prometheus Remote Write Metrics Exporter for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -19,7 +19,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index a01fe86280..dc43484520 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Rich Console Exporter for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index 35a538b7a1..e645bd42ee 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Aio-pika instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index 9ebd730766..bbb44b6cb5 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry aiohttp client instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index d0d2d599fb..55aad6ef61 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Aiohttp server instrumentation for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io"} ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index 31115fe81f..bd1c415226 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry aiopg instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index 89c0334b36..9e02da3210 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "ASGI instrumentation for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index 5f39b7595c..f9879a993a 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry instrumentation for AsyncPG" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 4ee7da2d15..13729c8b56 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry AWS Lambda instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", ] dependencies = [ diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index c4f1c7fe9b..86fccf3411 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Boto instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index c582a77491..8cad706028 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Boto3 SQS service tracing for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index d7c9fd3968..44f3c3b0f1 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Botocore instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index faace7671b..b6ec60bfcd 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Cassandra instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index 136d645394..1875421547 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Celery Instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 69a334b2a1..83dcb82a6f 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Confluent Kafka instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index a3bfeaf1a7..782d599c07 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Database API instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 9bae86cb03..9f964faae0 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Instrumentation for Django" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index e56b3c5333..9037560513 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry elasticsearch instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 04a57a918b..8d935cceb1 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Falcon instrumentation for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 73d65bb417..e118df1ed7 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry FastAPI Instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 528e08a313..180e401333 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Flask instrumentation for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index ef0579c59c..44bcbbad01 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry gRPC instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index fb86ff48c5..cba9e4d84b 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry HTTPX Instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index 093dc90d81..c8f91cffb0 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -8,6 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry jinja2 instrumentation" readme = "README.rst" license = "Apache-2.0" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -17,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index a5377d6ac4..a8d8a066a0 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Kafka-Python instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 61a7bd3227..8251dffa5d 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -8,6 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Logging instrumentation" readme = "README.rst" license = "Apache-2.0" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -17,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index d6d31f1c01..bf5d63acc3 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry MySQL instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index df4ab042ce..4489c96950 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry mysqlclient instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index 55b60adfcd..75efcd8400 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry pika instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index b3ab088d31..3c7c177eaa 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry psycopg2 instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index e05f9a09d0..2ec603af87 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry pymemcache instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index d8ae918579..e4abdacc56 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry pymongo instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 2795fddd2c..0a23003473 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry PyMySQL instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 7ce3554b78..fa6f64a24f 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Pyramid instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index ee26cedce7..532728e911 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Redis instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py index 11e56ad953..2d2670fee3 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py +++ b/instrumentation/opentelemetry-instrumentation-redis/tests/test_redis.py @@ -13,6 +13,7 @@ # limitations under the License. import asyncio from unittest import mock +from unittest.mock import AsyncMock import redis import redis.asyncio @@ -23,24 +24,6 @@ from opentelemetry.trace import SpanKind -class AsyncMock: - """A sufficient async mock implementation. - - Python 3.7 doesn't have an inbuilt async mock class, so this is used. - """ - - def __init__(self): - self.mock = mock.Mock() - - async def __call__(self, *args, **kwargs): - future = asyncio.Future() - future.set_result("random") - return future - - def __getattr__(self, item): - return AsyncMock() - - class TestRedis(TestBase): def setUp(self): super().setUp() diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index a16fb5baa8..d442e05073 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Remoulade instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index 1947d7ec51..81bcca9760 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry requests instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index 30712f7a1a..a0639d6c3e 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry sklearn instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 0c585509dd..159c47f2d6 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry SQLAlchemy instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index c7a6e56211..751f7423f2 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry SQLite3 instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index 7adab6245c..cd8e96bc2d 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Starlette Instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 55b091740e..00d6aba476 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry System Metrics Instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index 9169e38dea..eb1d3b2edb 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Tornado instrumentation for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -17,7 +17,6 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 0af56ce04f..503acbb784 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Instrumentation for Tortoise ORM" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index dbc4ad43d0..15c1cf29aa 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry urllib instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index 28635ed7e7..a718e128af 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry urllib3 instrumentation" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 73e00b3fac..8b90dde000 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "WSGI Middleware for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 33d9aa4276..b954212b98 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -12,7 +12,7 @@ dynamic = [ description = "OpenTelemetry Contrib Instrumentation Packages" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -22,7 +22,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index 6ad92aa71e..63d4d34a02 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OpenTelemetry Python Distro" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Typing :: Typed", ] diff --git a/opentelemetry-instrumentation/pyproject.toml b/opentelemetry-instrumentation/pyproject.toml index b781f51542..db389544c9 100644 --- a/opentelemetry-instrumentation/pyproject.toml +++ b/opentelemetry-instrumentation/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Instrumentation Tools & Auto Instrumentation for OpenTelemetry Python" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml index ee74713310..4ece31fc53 100644 --- a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml +++ b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "AWS X-Ray Propagator for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/propagator/opentelemetry-propagator-ot-trace/pyproject.toml b/propagator/opentelemetry-propagator-ot-trace/pyproject.toml index 77cb23b42b..4b73034617 100644 --- a/propagator/opentelemetry-propagator-ot-trace/pyproject.toml +++ b/propagator/opentelemetry-propagator-ot-trace/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "OT Trace Propagator for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/resource/opentelemetry-resource-detector-azure/pyproject.toml b/resource/opentelemetry-resource-detector-azure/pyproject.toml index 403553be3d..ea4be96948 100644 --- a/resource/opentelemetry-resource-detector-azure/pyproject.toml +++ b/resource/opentelemetry-resource-detector-azure/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Azure Resource Detector for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/resource/opentelemetry-resource-detector-container/pyproject.toml b/resource/opentelemetry-resource-detector-container/pyproject.toml index 87fa4c83a8..9cb6685a2a 100644 --- a/resource/opentelemetry-resource-detector-container/pyproject.toml +++ b/resource/opentelemetry-resource-detector-container/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Container Resource Detector for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml index dbb777cae6..252f9bb6f7 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml +++ b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "AWS SDK extension for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/tox.ini b/tox.ini index ccf1cc0c14..447d1a5bcb 100644 --- a/tox.ini +++ b/tox.ini @@ -7,43 +7,43 @@ envlist = ; for specifying supported Python versions per package. ; opentelemetry-resource-detector-container - py3{7,8,9,10,11}-test-resource-detector-container + py3{8,9,10,11}-test-resource-detector-container pypy3-test-resource-detector-container ; opentelemetry-sdk-extension-aws - py3{7,8,9,10,11}-test-sdkextension-aws + py3{8,9,10,11}-test-sdkextension-aws pypy3-test-sdkextension-aws ; opentelemetry-distro - py3{7,8,9,10,11}-test-distro + py3{8,9,10,11}-test-distro pypy3-test-distro ; opentelemetry-instrumentation - py3{7,8,9,10,11}-test-opentelemetry-instrumentation + py3{8,9,10,11}-test-opentelemetry-instrumentation pypy3-test-opentelemetry-instrumentation ; opentelemetry-instrumentation-aiohttp-client - py3{7,8,9,10,11}-test-instrumentation-aiohttp-client + py3{8,9,10,11}-test-instrumentation-aiohttp-client pypy3-test-instrumentation-aiohttp-client ; opentelemetry-instrumentation-aiohttp-server - py3{6,7,8,9,10,11}-test-instrumentation-aiohttp-server + py3{6,8,9,10,11}-test-instrumentation-aiohttp-server pypy3-test-instrumentation-aiohttp-server ; opentelemetry-instrumentation-aiopg - py3{7,8,9,10,11}-test-instrumentation-aiopg + py3{8,9,10,11}-test-instrumentation-aiopg ; instrumentation-aiopg intentionally excluded from pypy3 ; opentelemetry-instrumentation-aws-lambda - py3{7,8,9}-test-instrumentation-aws-lambda + py3{8,9}-test-instrumentation-aws-lambda ; opentelemetry-instrumentation-botocore - py3{7,8,9,10,11}-test-instrumentation-botocore + py3{8,9,10,11}-test-instrumentation-botocore ; FIXME: see https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1736 ; pypy3-test-instrumentation-botocore ; opentelemetry-instrumentation-boto3sqs - py3{6,7,8,9,10,11}-test-instrumentation-boto3sqs + py3{6,8,9,10,11}-test-instrumentation-boto3sqs ; FIXME: see https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1736 ; pypy3-test-instrumentation-boto3sqs @@ -51,189 +51,184 @@ envlist = ; Only officially supported Python versions are tested for each Django ; major release. Updated list can be found at: ; https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django - py3{7}-test-instrumentation-django-1 - py3{7,8,9}-test-instrumentation-django-2 - py3{7,8,9,10,11}-test-instrumentation-django-3 + py3{8,9}-test-instrumentation-django-2 + py3{8,9,10,11}-test-instrumentation-django-3 py3{8,9,10,11}-test-instrumentation-django-4 - pypy3-test-instrumentation-django-{1,2,3} + pypy3-test-instrumentation-django-{2,3} ; opentelemetry-instrumentation-dbapi - py3{7,8,9,10,11}-test-instrumentation-dbapi + py3{8,9,10,11}-test-instrumentation-dbapi pypy3-test-instrumentation-dbapi ; opentelemetry-instrumentation-boto - py3{7,8,9,10,11}-test-instrumentation-boto + py3{8,9,10,11}-test-instrumentation-boto ; FIXME: see https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1736 ; pypy3-test-instrumentation-boto ; opentelemetry-instrumentation-elasticsearch - py3{7,8,9,10,11}-test-instrumentation-elasticsearch-{2,6} + py3{8,9,10,11}-test-instrumentation-elasticsearch-{2,6} pypy3-test-instrumentation-elasticsearch-{2,6} - py3{7,8,9}-test-instrumentation-elasticsearch-5 + py3{8,9}-test-instrumentation-elasticsearch-5 pypy3-test-instrumentation-elasticsearch-5 ; opentelemetry-instrumentation-falcon ; py310 does not work with falcon 1 - py3{7,8,9}-test-instrumentation-falcon-1 - py3{7,8,9,10,11}-test-instrumentation-falcon-{2,3} + py3{8,9}-test-instrumentation-falcon-1 + py3{8,9,10,11}-test-instrumentation-falcon-{2,3} pypy3-test-instrumentation-falcon-{1,2,3} ; opentelemetry-instrumentation-fastapi - py3{7,8,9,10,11}-test-instrumentation-fastapi + py3{8,9,10,11}-test-instrumentation-fastapi pypy3-test-instrumentation-fastapi ; opentelemetry-instrumentation-flask - py3{7,8,9,10,11}-test-instrumentation-flask-{213,220} + py3{8,9,10,11}-test-instrumentation-flask-{213,220} py3{8,9,10,11}-test-instrumentation-flask-{300} pypy3-test-instrumentation-flask-{213,220} ; opentelemetry-instrumentation-urllib - py3{7,8,9,10,11}-test-instrumentation-urllib + py3{8,9,10,11}-test-instrumentation-urllib pypy3-test-instrumentation-urllib ; opentelemetry-instrumentation-urllib3 - py3{7,8,9,10,11}-test-instrumentation-urllib3v-{1,2} + py3{8,9,10,11}-test-instrumentation-urllib3v-{1,2} ;pypy3-test-instrumentation-urllib3v-{1,2} ; opentelemetry-instrumentation-requests - py3{7,8,9,10,11}-test-instrumentation-requests + py3{8,9,10,11}-test-instrumentation-requests ;pypy3-test-instrumentation-requests ; opentelemetry-instrumentation-starlette - py3{7,8,9,10,11}-test-instrumentation-starlette + py3{8,9,10,11}-test-instrumentation-starlette pypy3-test-instrumentation-starlette ; opentelemetry-instrumentation-jinja2 - py3{7,8,9,10,11}-test-instrumentation-jinja2 + py3{8,9,10,11}-test-instrumentation-jinja2 pypy3-test-instrumentation-jinja2 ; opentelemetry-instrumentation-logging - py3{7,8,9,10,11}-test-instrumentation-logging + py3{8,9,10,11}-test-instrumentation-logging pypy3-test-instrumentation-logging ; opentelemetry-exporter-richconsole - py3{7,8,9,10,11}-test-exporter-richconsole + py3{8,9,10,11}-test-exporter-richconsole ; opentelemetry-exporter-prometheus-remote-write - py3{6,7,8,9,10}-test-exporter-prometheus-remote-write + py3{6,8,9,10}-test-exporter-prometheus-remote-write ; opentelemetry-instrumentation-mysql - py3{7,8,9,10,11}-test-instrumentation-mysql + py3{8,9,10,11}-test-instrumentation-mysql pypy3-test-instrumentation-mysql ; opentelemetry-instrumentation-mysqlclient - py3{7,8,9,10,11}-test-instrumentation-mysqlclient + py3{8,9,10,11}-test-instrumentation-mysqlclient pypy3-test-instrumentation-mysqlclient ; opentelemetry-instrumentation-psycopg2 - py3{7,8,9,10,11}-test-instrumentation-psycopg2 + py3{8,9,10,11}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 ; opentelemetry-instrumentation-pymemcache - py3{7,8,9,10,11}-test-instrumentation-pymemcache-{135,200,300,342,400} + py3{8,9,10,11}-test-instrumentation-pymemcache-{135,200,300,342,400} pypy3-test-instrumentation-pymemcache-{135,200,300,342,400} ; opentelemetry-instrumentation-pymongo - py3{7,8,9,10,11}-test-instrumentation-pymongo + py3{8,9,10,11}-test-instrumentation-pymongo pypy3-test-instrumentation-pymongo ; opentelemetry-instrumentation-pymysql - py3{7,8,9,10,11}-test-instrumentation-pymysql + py3{8,9,10,11}-test-instrumentation-pymysql pypy3-test-instrumentation-pymysql ; opentelemetry-instrumentation-pyramid - py3{7,8,9,10,11}-test-instrumentation-pyramid + py3{8,9,10,11}-test-instrumentation-pyramid pypy3-test-instrumentation-pyramid ; opentelemetry-instrumentation-asgi - py3{7,8,9,10,11}-test-instrumentation-asgi + py3{8,9,10,11}-test-instrumentation-asgi pypy3-test-instrumentation-asgi ; opentelemetry-instrumentation-asyncpg - py3{7,8,9,10,11}-test-instrumentation-asyncpg + py3{8,9,10,11}-test-instrumentation-asyncpg ; ext-asyncpg intentionally excluded from pypy3 ; opentelemetry-instrumentation-sqlite3 - py3{7,8,9,10,11}-test-instrumentation-sqlite3 + py3{8,9,10,11}-test-instrumentation-sqlite3 pypy3-test-instrumentation-sqlite3 ; opentelemetry-instrumentation-wsgi - py3{7,8,9,10,11}-test-instrumentation-wsgi + py3{8,9,10,11}-test-instrumentation-wsgi pypy3-test-instrumentation-wsgi ; opentelemetry-instrumentation-grpc - py3{7,8,9,10,11}-test-instrumentation-grpc + py3{8,9,10,11}-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy py3{7}-test-instrumentation-sqlalchemy-{11} - py3{7,8,9,10,11}-test-instrumentation-sqlalchemy-{14} + py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14} pypy3-test-instrumentation-sqlalchemy-{11,14} ; opentelemetry-instrumentation-redis - py3{7,8,9,10,11}-test-instrumentation-redis + py3{8,9,10,11}-test-instrumentation-redis pypy3-test-instrumentation-redis ; opentelemetry-instrumentation-remoulade - ; remoulade only supports 3.7 and above - py3{7,8,9,10,11}-test-instrumentation-remoulade + py3{8,9,10,11}-test-instrumentation-remoulade ; instrumentation-remoulade intentionally excluded from pypy3 ; opentelemetry-instrumentation-celery - ; celery tests don't run on 3.7 because our opentelemetry-api requires importlib-metadata >= 5.0.0 - ; but celery requires importlib-metadata < 5.0.0 - ; see https://github.com/celery/celery/issues/7783 for more details py3{8,9,10,11}-test-instrumentation-celery ; pypy3-test-instrumentation-celery ; opentelemetry-instrumentation-sklearn - py3{7,8}-test-instrumentation-sklearn + py3{8}-test-instrumentation-sklearn ; opentelemetry-instrumentation-system-metrics - py3{6,7,8,9,10,11}-test-instrumentation-system-metrics + py3{6,8,9,10,11}-test-instrumentation-system-metrics pypy3-test-instrumentation-system-metrics ; opentelemetry-instrumentation-tornado - py3{7,8,9,10,11}-test-instrumentation-tornado + py3{8,9,10,11}-test-instrumentation-tornado pypy3-test-instrumentation-tornado ; opentelemetry-instrumentation-tortoiseorm - py3{7,8,9,10,11}-test-instrumentation-tortoiseorm + py3{8,9,10,11}-test-instrumentation-tortoiseorm pypy3-test-instrumentation-tortoiseorm ; opentelemetry-instrumentation-httpx - py3{7,8,9,10,11}-test-instrumentation-httpx-{18,21} + py3{8,9,10,11}-test-instrumentation-httpx-{18,21} pypy3-test-instrumentation-httpx-{18,21} ; opentelemetry-util-http - py3{7,8,9,10,11}-test-util-http + py3{8,9,10,11}-test-util-http pypy3-test-util-http ; opentelemetry-propagator-aws-xray - py3{7,8,9,10,11}-test-propagator-aws-xray + py3{8,9,10,11}-test-propagator-aws-xray pypy3-test-propagator-aws-xray ; opentelemetry-propagator-ot-trace - py3{7,8,9,10,11}-test-propagator-ot-trace + py3{8,9,10,11}-test-propagator-ot-trace pypy3-test-propagator-ot-trace ; opentelemetry-instrumentation-sio-pika - py3{7,8,9,10,11}-test-instrumentation-sio-pika-{0,1} + py3{8,9,10,11}-test-instrumentation-sio-pika-{0,1} pypy3-test-instrumentation-sio-pika-{0,1} ; opentelemetry-instrumentation-aio-pika - py3{7,8,9,10,11}-test-instrumentation-aio-pika-{7,8,9} - pypy3-test-instrumentation-aio-pika-{7,8,9} + py3{8,9,10,11}-test-instrumentation-aio-pika-{8,9} + pypy3-test-instrumentation-aio-pika-{8,9} ; opentelemetry-instrumentation-kafka-python - py3{7,8,9,10,11}-test-instrumentation-kafka-python + py3{8,9,10,11}-test-instrumentation-kafka-python pypy3-test-instrumentation-kafka-python ; opentelemetry-instrumentation-confluent-kafka ; // FIXME: Enable support for python 3.11 when https://github.com/confluentinc/confluent-kafka-python/issues/1452 is fixed - py3{7,8,9,10}-test-instrumentation-confluent-kafka + py3{8,9,10}-test-instrumentation-confluent-kafka ; opentelemetry-instrumentation-cassandra - py3{7,8,9,10,11}-test-instrumentation-cassandra + py3{8,9,10,11}-test-instrumentation-cassandra pypy3-test-instrumentation-cassandra lint @@ -250,7 +245,6 @@ deps = test: pytest-benchmark coverage: pytest coverage: pytest-cov - django-1: django~=1.0 django-2: django~=2.0 django-3: django~=3.0 django-4: django>=4.0b1,<5.0 @@ -334,7 +328,7 @@ changedir = test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests test-instrumentation-mysqlclient: instrumentation/opentelemetry-instrumentation-mysqlclient/tests test-instrumentation-sio-pika-{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests - test-instrumentation-aio-pika-{7,8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests + test-instrumentation-aio-pika-{8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests test-instrumentation-pymemcache-{135,200,300,342,400}: instrumentation/opentelemetry-instrumentation-pymemcache/tests test-instrumentation-pymongo: instrumentation/opentelemetry-instrumentation-pymongo/tests @@ -362,7 +356,7 @@ changedir = commands_pre = ; Install without -e to test the actual installation - py3{7,8,9,10,11}: python -m pip install -U pip setuptools wheel + py3{8,9,10,11}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. test: pip install "opentelemetry-api[test] @ {env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" @@ -377,7 +371,7 @@ commands_pre = sio-pika-{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] - aio-pika-{7,8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + aio-pika-{8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] kafka-python: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] @@ -450,7 +444,7 @@ commands_pre = logging: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] - aio-pika-{7,8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + aio-pika-{8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] aiohttp-client: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] diff --git a/util/opentelemetry-util-http/pyproject.toml b/util/opentelemetry-util-http/pyproject.toml index 285697e868..88724caf1a 100644 --- a/util/opentelemetry-util-http/pyproject.toml +++ b/util/opentelemetry-util-http/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Web util for OpenTelemetry" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, ] @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", From 13ce910f143fdebf21c8bdf307b3d236d867ecf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Guimar=C3=A3es?= Date: Sun, 4 Feb 2024 06:26:49 -0300 Subject: [PATCH 099/200] Fix link to OpenTelemetry kafka-python Instrumentation (#2147) Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- .../opentelemetry-instrumentation-kafka-python/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/README.rst b/instrumentation/opentelemetry-instrumentation-kafka-python/README.rst index 426a371908..2d20e5c6d7 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/README.rst +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/README.rst @@ -17,6 +17,6 @@ Installation References ---------- -* `OpenTelemetry kafka-python Instrumentation `_ +* `OpenTelemetry kafka-python Instrumentation `_ * `OpenTelemetry Project `_ * `OpenTelemetry Python Examples `_ From 47caeab7aff47070c565cd90536a39ec5eb06f34 Mon Sep 17 00:00:00 2001 From: Marcus Lim <42759889+marcuslimdw@users.noreply.github.com> Date: Mon, 5 Feb 2024 19:55:24 +0800 Subject: [PATCH 100/200] Stop multiple calls to AsyncPGInstrumentor.__init__ from clobbering instance attributes (#1791) * Stop multiple calls to AsyncPGInstrumentor.__init__ from clobbering instance tracer attribute * Remove class-level initialisation of _tracer * Fix regex * Add to changelog * Fix lint errors * Update CHANGELOG.md Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> * Set tracer in class definition to avoid lint error --------- Co-authored-by: Srikanth Chekuri Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 ++ .../opentelemetry/instrumentation/asyncpg/__init__.py | 6 ++++-- .../tests/test_asyncpg_wrapper.py | 10 +++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d73faa6a..3157bca33e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151)) - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) +- `opentelemetry-instrumentation-asyncpg` Allow AsyncPGInstrumentor to be instantiated multiple times +([#1791](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1791)) - `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions until 2.3.0 of confluent_kafka ([#2132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2132)) - `opentelemetry-resource-detector-azure` Changed timeout to 4 seconds due to [timeout bug](https://github.com/open-telemetry/opentelemetry-python/issues/3644) diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py index a8c0eab2ac..11c579f96a 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py @@ -96,11 +96,13 @@ def _hydrate_span_from_args(connection, query, parameters) -> dict: class AsyncPGInstrumentor(BaseInstrumentor): + + _leading_comment_remover = re.compile(r"^/\*.*?\*/") + _tracer = None + def __init__(self, capture_parameters=False): super().__init__() self.capture_parameters = capture_parameters - self._tracer = None - self._leading_comment_remover = re.compile(r"^/\*.*?\*/") def instrumentation_dependencies(self) -> Collection[str]: return _instruments diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/tests/test_asyncpg_wrapper.py b/instrumentation/opentelemetry-instrumentation-asyncpg/tests/test_asyncpg_wrapper.py index a3cbbfcecb..12aad0c6dc 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/tests/test_asyncpg_wrapper.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/tests/test_asyncpg_wrapper.py @@ -5,7 +5,7 @@ class TestAsyncPGInstrumentation(TestBase): - def test_duplicated_instrumentation(self): + def test_duplicated_instrumentation_can_be_uninstrumented(self): AsyncPGInstrumentor().instrument() AsyncPGInstrumentor().instrument() AsyncPGInstrumentor().instrument() @@ -16,6 +16,14 @@ def test_duplicated_instrumentation(self): hasattr(method, "_opentelemetry_ext_asyncpg_applied") ) + def test_duplicated_instrumentation_works(self): + first = AsyncPGInstrumentor() + first.instrument() + second = AsyncPGInstrumentor() + second.instrument() + self.assertIsNotNone(first._tracer) + self.assertIsNotNone(second._tracer) + def test_duplicated_uninstrumentation(self): AsyncPGInstrumentor().instrument() AsyncPGInstrumentor().uninstrument() From 8fd2105ceae604cf39a67f1c4dd154753b43fcd1 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Sat, 10 Feb 2024 07:02:35 -0600 Subject: [PATCH 101/200] Update core SHA (#2163) Fxes #2162 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 517e7e332d..1d6b03d74b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150 + CORE_REPO_SHA: d829e375202d0106d45d7a2441409be82086b423 jobs: misc: From d167ef7b43941a74378d625fea74628dd7572efa Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 12 Feb 2024 17:54:32 -0600 Subject: [PATCH 102/200] Fix celery and urllib tests (#2170) * Update core SHA Fixes #2173 * Fix celery and urllib tests Fixes #2164 --- .github/workflows/instrumentations_0.yml | 2 +- .github/workflows/instrumentations_1.yml | 2 +- .github/workflows/test.yml | 2 +- .../tests/test_metrics.py | 42 ++++- .../tests/test_metrics_instrumentation.py | 150 ++++++++++++++++-- 5 files changed, 183 insertions(+), 15 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index c0df94171d..d6a1d688e6 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150 + CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f jobs: instrumentations-0: diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 5b57472076..7b1a0925cf 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150 + CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f jobs: instrumentations-1: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d6b03d74b..33791db4cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: d829e375202d0106d45d7a2441409be82086b423 + CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f jobs: misc: diff --git a/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py index e290362e77..01c9487ea8 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py @@ -64,8 +64,44 @@ def test_basic_metric(self): def test_metric_uninstrument(self): CeleryInstrumentor().instrument() - metrics = self.get_metrics() - self.assertEqual(len(metrics), 1) + + self.get_metrics() + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[0] + .data.data_points[0] + .bucket_counts[1] + ), + 1, + ) + + self.get_metrics() + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[0] + .data.data_points[0] + .bucket_counts[1] + ), + 2, + ) + CeleryInstrumentor().uninstrument() - self.assertIsNone(self.memory_metrics_reader.get_metrics_data()) + self.get_metrics() + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[0] + .data.data_points[0] + .bucket_counts[1] + ), + 2, + ) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py index 087607e606..e544feaaef 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py @@ -194,15 +194,147 @@ def test_basic_metric_request_not_empty(self): ) def test_metric_uninstrument(self): with request.urlopen(self.URL): - metrics = self.get_sorted_metrics() - self.assertEqual(len(metrics), 3) - self.assertEqual(metrics[0].data.data_points[0].sum, 1) - self.assertEqual(metrics[1].data.data_points[0].sum, 0) - self.assertEqual(metrics[2].data.data_points[0].sum, 6) + self.assertEqual( + len( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics + ) + ), + 3, + ) + + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[0] + .data.data_points[0] + .bucket_counts[1] + ), + 1, + ) + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[1] + .data.data_points[0] + .bucket_counts[0] + ), + 1, + ) + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[2] + .data.data_points[0] + .bucket_counts[2] + ), + 1, + ) + + with request.urlopen(self.URL): + + self.assertEqual( + len( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics + ) + ), + 3, + ) + + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[0] + .data.data_points[0] + .bucket_counts[1] + ), + 2, + ) + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[1] + .data.data_points[0] + .bucket_counts[0] + ), + 2, + ) + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[2] + .data.data_points[0] + .bucket_counts[2] + ), + 2, + ) + + URLLibInstrumentor().uninstrument() + + with request.urlopen(self.URL): + + self.assertEqual( + len( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics + ) + ), + 3, + ) - URLLibInstrumentor().uninstrument() - with request.urlopen(self.URL): - self.assertIsNone( + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[0] + .data.data_points[0] + .bucket_counts[1] + ), + 2, + ) + self.assertEqual( + ( self.memory_metrics_reader.get_metrics_data() - ) + .resource_metrics[0] + .scope_metrics[0] + .metrics[1] + .data.data_points[0] + .bucket_counts[0] + ), + 2, + ) + self.assertEqual( + ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics[2] + .data.data_points[0] + .bucket_counts[2] + ), + 2, + ) From 03fcc1742d845ddd9a2869e0993366395867762a Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 13 Feb 2024 12:55:45 -0600 Subject: [PATCH 103/200] Remove references to 3.7 (#2172) Fixes #2171 --- .../tests/test_metrics_instrumentation.py | 4 +--- tox.ini | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py index e544feaaef..f79749dfd8 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_metrics_instrumentation.py @@ -14,7 +14,6 @@ from platform import python_implementation -from sys import version_info from timeit import default_timer from urllib import request from urllib.parse import urlencode @@ -189,8 +188,7 @@ def test_basic_metric_request_not_empty(self): ) @mark.skipif( - python_implementation() == "PyPy" or version_info.minor == 7, - reason="Fails randomly in 3.7 and pypy", + python_implementation() == "PyPy", reason="Fails randomly in pypy" ) def test_metric_uninstrument(self): with request.urlopen(self.URL): diff --git a/tox.ini b/tox.ini index 447d1a5bcb..5c4645364d 100644 --- a/tox.ini +++ b/tox.ini @@ -164,7 +164,6 @@ envlist = py3{8,9,10,11}-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy - py3{7}-test-instrumentation-sqlalchemy-{11} py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14} pypy3-test-instrumentation-sqlalchemy-{11,14} From 1a984d3ba18d4080c58485b7d807dba241179d41 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Wed, 14 Feb 2024 01:33:14 -0300 Subject: [PATCH 104/200] Upgrade tox (#2118) * Upgrade tox * fixup! Upgrade tox * Add excludes --------- Co-authored-by: Diego Hurtado --- .github/workflows/instrumentations_0.yml | 31 +++++++++- .github/workflows/instrumentations_1.yml | 7 ++- .github/workflows/prepare-patch-release.yml | 2 +- .github/workflows/prepare-release-branch.yml | 4 +- .github/workflows/test.yml | 2 +- CONTRIBUTING.md | 6 +- README.md | 2 +- .../pyproject.toml | 3 - tox.ini | 57 +++++++++++-------- 9 files changed, 77 insertions(+), 37 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index d6a1d688e6..92ab15d4e0 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -73,6 +73,35 @@ jobs: - "tornado" - "tortoiseorm" os: [ubuntu-20.04] + exclude: + - python-version: py39 + package: "sklearn" + - python-version: py310 + package: "sklearn" + - python-version: py311 + package: "sklearn" + - python-version: pypy3 + package: "aiopg" + - python-version: pypy3 + package: "asyncpg" + - python-version: pypy3 + package: "boto" + - python-version: pypy3 + package: "boto3sqs" + - python-version: pypy3 + package: "botocore" + - python-version: pypy3 + package: "psycopg2" + - python-version: pypy3 + package: "remoulade" + - python-version: pypy3 + package: "requests" + - python-version: pypy3 + package: "sklearn" + - python-version: pypy3 + package: "confluent-kafka" + - python-version: pypy3 + package: "grpc" steps: - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} uses: actions/checkout@v2 @@ -81,7 +110,7 @@ jobs: with: python-version: ${{ env[matrix.python-version] }} - name: Install tox - run: pip install tox==3.27.1 tox-factor + run: pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v1 diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 7b1a0925cf..931ab5d68e 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -35,6 +35,11 @@ jobs: - "propagator-ot-trace" - "resource-detector-container" os: [ubuntu-20.04] + exclude: + - python-version: py311 + package: "prometheus-remote-write" + - python-version: pypy3 + package: "prometheus-remote-write" steps: - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} uses: actions/checkout@v2 @@ -43,7 +48,7 @@ jobs: with: python-version: ${{ env[matrix.python-version] }} - name: Install tox - run: pip install tox==3.27.1 tox-factor + run: pip install tox - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v1 diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index 42e287f981..49b9c89560 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -54,7 +54,7 @@ jobs: with: python-version: 3.9 - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: run tox run: tox -e generate diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index 229c8ac7e6..a4caf86ebe 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -81,7 +81,7 @@ jobs: with: python-version: 3.9 - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: run tox run: tox -e generate @@ -165,7 +165,7 @@ jobs: with: python-version: 3.9 - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: run tox run: tox -e generate diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33791db4cd..2c5a86922f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: with: python-version: "3.10" - name: Install tox - run: pip install tox==3.27.1 + run: pip install tox - name: Install libsnappy-dev if: ${{ matrix.tox-environment == 'lint' }} run: sudo apt-get install -y libsnappy-dev diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb5f649e13..329962955c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ some aspects of development, including testing against multiple Python versions. To install `tox`, run: ```console -$ pip install tox==3.27.1 +$ pip install tox ``` You can run `tox` with the following arguments: @@ -107,7 +107,7 @@ Run tests: ```sh # make sure you have all supported versions of Python installed -$ pip install tox==3.27.1 # only first time. +$ pip install tox # only first time. $ tox # execute in the root of the repository ``` @@ -177,7 +177,7 @@ For a deeper discussion, see: https://github.com/open-telemetry/opentelemetry-sp ## Running Tests Locally 1. Go to your Contrib repo directory. `git clone git@github.com:open-telemetry/opentelemetry-python-contrib.git && cd opentelemetry-python-contrib`. -2. Make sure you have `tox` installed. `pip install tox==3.27.1`. +2. Make sure you have `tox` installed. `pip install tox`. 3. Run `tox` without any arguments to run tests for all the packages. Read more about [tox](https://tox.readthedocs.io/en/latest/). ### Testing against a different Core repo branch/commit diff --git a/README.md b/README.md index ce1f8f3df4..0a3d37ab3f 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Emeritus Maintainers: 1. Go to your Contrib repo directory. `cd ~/git/opentelemetry-python-contrib`. 2. Create a virtual env in your Contrib repo directory. `python3 -m venv my_test_venv`. 3. Activate your virtual env. `source my_test_venv/bin/activate`. -4. Make sure you have `tox` installed. `pip install tox==3.27.1`. +4. Make sure you have `tox` installed. `pip install tox`. 5. Run tests for a package. (e.g. `tox -e test-instrumentation-flask`.) ### Thanks to all the people who already contributed! diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 83dcb82a6f..4ded0836b2 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -19,9 +19,6 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", ] dependencies = [ "opentelemetry-api ~= 1.12", diff --git a/tox.ini b/tox.ini index 5c4645364d..3b921b9be1 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,8 @@ envlist = ; instrumentation-aiopg intentionally excluded from pypy3 ; opentelemetry-instrumentation-aws-lambda - py3{8,9}-test-instrumentation-aws-lambda + py3{8,9,10,11}-test-instrumentation-aws-lambda + pypy3-test-instrumentation-aws-lambda ; opentelemetry-instrumentation-botocore py3{8,9,10,11}-test-instrumentation-botocore @@ -92,7 +93,7 @@ envlist = ; opentelemetry-instrumentation-urllib3 py3{8,9,10,11}-test-instrumentation-urllib3v-{1,2} - ;pypy3-test-instrumentation-urllib3v-{1,2} + pypy3-test-instrumentation-urllib3v-{1,2} ; opentelemetry-instrumentation-requests py3{8,9,10,11}-test-instrumentation-requests @@ -112,9 +113,11 @@ envlist = ; opentelemetry-exporter-richconsole py3{8,9,10,11}-test-exporter-richconsole + pypy3-test-exporter-richconsole ; opentelemetry-exporter-prometheus-remote-write - py3{6,8,9,10}-test-exporter-prometheus-remote-write + py3{6,8,9,10,11}-test-exporter-prometheus-remote-write + pypy3-test-exporter-prometheus-remote-write ; opentelemetry-instrumentation-mysql py3{8,9,10,11}-test-instrumentation-mysql @@ -162,6 +165,7 @@ envlist = ; opentelemetry-instrumentation-grpc py3{8,9,10,11}-test-instrumentation-grpc + pypy3-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14} @@ -177,7 +181,7 @@ envlist = ; opentelemetry-instrumentation-celery py3{8,9,10,11}-test-instrumentation-celery - ; pypy3-test-instrumentation-celery + pypy3-test-instrumentation-celery ; opentelemetry-instrumentation-sklearn py3{8}-test-instrumentation-sklearn @@ -223,8 +227,8 @@ envlist = pypy3-test-instrumentation-kafka-python ; opentelemetry-instrumentation-confluent-kafka - ; // FIXME: Enable support for python 3.11 when https://github.com/confluentinc/confluent-kafka-python/issues/1452 is fixed - py3{8,9,10}-test-instrumentation-confluent-kafka + py3{8,9,10,11}-test-instrumentation-confluent-kafka + pypy3-test-instrumentation-confluent-kafka ; opentelemetry-instrumentation-cassandra py3{8,9,10,11}-test-instrumentation-cassandra @@ -295,7 +299,7 @@ setenv = ; override CORE_REPO_SHA via env variable when testing other branches/commits than main ; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e CORE_REPO_SHA={env:CORE_REPO_SHA:main} - CORE_REPO="git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}" + CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA} changedir = test-distro: opentelemetry-distro/tests @@ -358,10 +362,10 @@ commands_pre = py3{8,9,10,11}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. - test: pip install "opentelemetry-api[test] @ {env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" - test: pip install "opentelemetry-semantic-conventions[test] @ {env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" - test: pip install "opentelemetry-sdk[test] @ {env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" - test: pip install "opentelemetry-test-utils[test] @ {env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" + test: pip install opentelemetry-api[test]@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api + test: pip install opentelemetry-semantic-conventions[test]@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions + test: pip install opentelemetry-sdk[test]@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk + test: pip install opentelemetry-test-utils[test]@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils test: pip install {toxinidir}/opentelemetry-instrumentation distro: pip install {toxinidir}/opentelemetry-distro @@ -487,9 +491,9 @@ deps = pytest commands_pre = - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk python -m pip install {toxinidir}/opentelemetry-instrumentation python -m pip install {toxinidir}/util/opentelemetry-util-http @@ -514,11 +518,11 @@ deps = -r dev-requirements.txt commands_pre = - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" - python -m pip install "{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" - python -m pip install -e {toxinidir}/util/opentelemetry-util-http + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk + python -m pip install {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils + python -m pip install -e {toxinidir}/util/opentelemetry-util-http[test] python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] @@ -609,10 +613,10 @@ changedir = tests/opentelemetry-docker-tests/tests commands_pre = - pip install "{env:CORE_REPO}#egg=opentelemetry-api&subdirectory=opentelemetry-api" \ - "{env:CORE_REPO}#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions" \ - "{env:CORE_REPO}#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk" \ - "{env:CORE_REPO}#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils" \ + pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api \ + {env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions \ + {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk \ + {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils \ -e {toxinidir}/opentelemetry-instrumentation \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery \ @@ -629,7 +633,7 @@ commands_pre = -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade \ - "{env:CORE_REPO}#egg=opentelemetry-exporter-opencensus&subdirectory=exporter/opentelemetry-exporter-opencensus" + {env:CORE_REPO}\#egg=opentelemetry-exporter-opencensus&subdirectory=exporter/opentelemetry-exporter-opencensus docker-compose up -d python check_availability.py @@ -643,6 +647,11 @@ commands_post = deps = -r {toxinidir}/gen-requirements.txt +allowlist_externals = + {toxinidir}/scripts/generate_instrumentation_bootstrap.py + {toxinidir}/scripts/generate_instrumentation_readme.py + {toxinidir}/scripts/generate_instrumentation_metapackage.py + commands = {toxinidir}/scripts/generate_instrumentation_bootstrap.py {toxinidir}/scripts/generate_instrumentation_readme.py From 02e38edc54f0e30b264f2eee2e2f8be1fbdf312b Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 14 Feb 2024 12:51:27 -0800 Subject: [PATCH 105/200] Fix azure vm resource detector tests/Suppress instrumentation for urllib call (#2178) --- CHANGELOG.md | 4 +- .../resource/detector/azure/vm.py | 106 +++++++++--------- .../tests/test_vm.py | 16 +-- 3 files changed, 65 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3157bca33e..868b4f3e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -- Drop uspport for 3.7 +- Drop support for 3.7 ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151)) - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2132)) - `opentelemetry-resource-detector-azure` Changed timeout to 4 seconds due to [timeout bug](https://github.com/open-telemetry/opentelemetry-python/issues/3644) ([#2136](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2136)) +- `opentelemetry-resource-detector-azure` Suppress instrumentation for `urllib` call + ([#2178](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2178)) ## Version 1.22.0/0.43b0 (2023-12-14) diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index b0e0f4d45b..a4ba295ab9 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -17,6 +17,12 @@ from urllib.error import URLError from urllib.request import Request, urlopen +from opentelemetry.context import ( + _SUPPRESS_INSTRUMENTATION_KEY, + attach, + detach, + set_value, +) from opentelemetry.sdk.resources import Resource, ResourceDetector from opentelemetry.semconv.resource import ( CloudPlatformValues, @@ -49,64 +55,60 @@ class AzureVMResourceDetector(ResourceDetector): # pylint: disable=no-self-use def detect(self) -> "Resource": attributes = {} - metadata_json = ( - _AzureVMMetadataServiceRequestor().get_azure_vm_metadata() - ) + token = attach(set_value(_SUPPRESS_INSTRUMENTATION_KEY, True)) + metadata_json = _get_azure_vm_metadata() if not metadata_json: return Resource(attributes) for attribute_key in EXPECTED_AZURE_AMS_ATTRIBUTES: - attributes[ - attribute_key - ] = _AzureVMMetadataServiceRequestor().get_attribute_from_metadata( + attributes[attribute_key] = _get_attribute_from_metadata( metadata_json, attribute_key ) + detach(token) return Resource(attributes) -class _AzureVMMetadataServiceRequestor: - def get_azure_vm_metadata(self): # pylint: disable=no-self-use - request = Request(_AZURE_VM_METADATA_ENDPOINT) - request.add_header("Metadata", "True") - try: - # TODO: Changed to 4s to fit into OTel SDK's 5 second timeout. - # Lengthen or allow user input if issue is resolved. - # See https://github.com/open-telemetry/opentelemetry-python/issues/3644 - with urlopen(request, timeout=4) as response: - return loads(response.read()) - except URLError: - # Not on Azure VM - return None - except Exception as e: # pylint: disable=broad-except,invalid-name - _logger.exception("Failed to receive Azure VM metadata: %s", e) - return None +def _get_azure_vm_metadata(): + request = Request(_AZURE_VM_METADATA_ENDPOINT) + request.add_header("Metadata", "True") + try: + # TODO: Changed to 4s to fit into OTel SDK's 5 second timeout. + # Lengthen or allow user input if issue is resolved. + # See https://github.com/open-telemetry/opentelemetry-python/issues/3644 + with urlopen(request, timeout=4) as response: + return loads(response.read()) + except URLError: + # Not on Azure VM + return None + except Exception as e: # pylint: disable=broad-except,invalid-name + _logger.exception("Failed to receive Azure VM metadata: %s", e) + return None + - def get_attribute_from_metadata( - self, metadata_json, attribute_key - ): # pylint: disable=no-self-use - ams_value = "" - if attribute_key == _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE: - ams_value = metadata_json["vmScaleSetName"] - elif attribute_key == _AZURE_VM_SKU_ATTRIBUTE: - ams_value = metadata_json["sku"] - elif attribute_key == ResourceAttributes.CLOUD_PLATFORM: - ams_value = CloudPlatformValues.AZURE_VM.value - elif attribute_key == ResourceAttributes.CLOUD_PROVIDER: - ams_value = CloudProviderValues.AZURE.value - elif attribute_key == ResourceAttributes.CLOUD_REGION: - ams_value = metadata_json["location"] - elif attribute_key == ResourceAttributes.CLOUD_RESOURCE_ID: - ams_value = metadata_json["resourceId"] - elif attribute_key in ( - ResourceAttributes.HOST_ID, - ResourceAttributes.SERVICE_INSTANCE_ID, - ): - ams_value = metadata_json["vmId"] - elif attribute_key == ResourceAttributes.HOST_NAME: - ams_value = metadata_json["name"] - elif attribute_key == ResourceAttributes.HOST_TYPE: - ams_value = metadata_json["vmSize"] - elif attribute_key == ResourceAttributes.OS_TYPE: - ams_value = metadata_json["osType"] - elif attribute_key == ResourceAttributes.OS_VERSION: - ams_value = metadata_json["version"] - return ams_value +def _get_attribute_from_metadata(metadata_json, attribute_key): + ams_value = "" + if attribute_key == _AZURE_VM_SCALE_SET_NAME_ATTRIBUTE: + ams_value = metadata_json["vmScaleSetName"] + elif attribute_key == _AZURE_VM_SKU_ATTRIBUTE: + ams_value = metadata_json["sku"] + elif attribute_key == ResourceAttributes.CLOUD_PLATFORM: + ams_value = CloudPlatformValues.AZURE_VM.value + elif attribute_key == ResourceAttributes.CLOUD_PROVIDER: + ams_value = CloudProviderValues.AZURE.value + elif attribute_key == ResourceAttributes.CLOUD_REGION: + ams_value = metadata_json["location"] + elif attribute_key == ResourceAttributes.CLOUD_RESOURCE_ID: + ams_value = metadata_json["resourceId"] + elif attribute_key in ( + ResourceAttributes.HOST_ID, + ResourceAttributes.SERVICE_INSTANCE_ID, + ): + ams_value = metadata_json["vmId"] + elif attribute_key == ResourceAttributes.HOST_NAME: + ams_value = metadata_json["name"] + elif attribute_key == ResourceAttributes.HOST_TYPE: + ams_value = metadata_json["vmSize"] + elif attribute_key == ResourceAttributes.OS_TYPE: + ams_value = metadata_json["osType"] + elif attribute_key == ResourceAttributes.OS_VERSION: + ams_value = metadata_json["version"] + return ams_value diff --git a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py index fd443aa3be..86aa373d3c 100644 --- a/resource/opentelemetry-resource-detector-azure/tests/test_vm.py +++ b/resource/opentelemetry-resource-detector-azure/tests/test_vm.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import unittest -from unittest.mock import Mock, patch +from unittest.mock import patch # pylint: disable=no-name-in-module from opentelemetry.resource.detector.azure.vm import AzureVMResourceDetector @@ -363,18 +363,18 @@ class TestAzureVMResourceDetector(unittest.TestCase): @patch("opentelemetry.resource.detector.azure.vm.urlopen") def test_linux(self, mock_urlopen): - mock_response = Mock() - mock_urlopen.return_value = mock_response - mock_response.read.return_value = LINUX_JSON + mock_urlopen.return_value.__enter__.return_value.read.return_value = ( + LINUX_JSON + ) attributes = AzureVMResourceDetector().detect().attributes for attribute_key, attribute_value in LINUX_ATTRIBUTES.items(): self.assertEqual(attributes[attribute_key], attribute_value) @patch("opentelemetry.resource.detector.azure.vm.urlopen") def test_windows(self, mock_urlopen): - mock_response = Mock() - mock_urlopen.return_value = mock_response - mock_response.read.return_value = WINDOWS_JSON + mock_urlopen.return_value.__enter__.return_value.read.return_value = ( + WINDOWS_JSON + ) attributes = AzureVMResourceDetector().detect().attributes - for attribute_key, attribute_value in LINUX_ATTRIBUTES.items(): + for attribute_key, attribute_value in WINDOWS_ATTRIBUTES.items(): self.assertEqual(attributes[attribute_key], attribute_value) From b6492a7999ebf5bdbad3ff71ceab6288b63e3233 Mon Sep 17 00:00:00 2001 From: Allen Kim Date: Thu, 15 Feb 2024 06:44:17 +0900 Subject: [PATCH 106/200] Feature/asyncio instrumentation (#1943) * add asyncio instrumentation * add asyncio instrumentation * modify test configure * modify test configure * modify tox generate result * modify tox generate result * add python version check * modify test code * add CHANGELOG.md * add docs * modify pyproject.toml * modify pyproject.toml * Add comments mentioned in an issue #1919 * Add comments mentioned in an issue #1919 * add asyncio component owner * - Add instrumentation-asyncio metric. - Configure coroutines/to_thread func to apply trace via environment variables. - Apply trace to future using a boolean environment variable. * modify docs * modify docs * modify docs * modify docs * modify docs * modify test_code * modify test_code * modify test_code * modify asyncio version * modify asyncio version * update dependency * modified lint results * modified lint results * modified lint results * modified lint results * modified lint results * modified lint results * modified lint results * include feedback * include feedback * include feedback * modify docs test results * Update instrumentation/opentelemetry-instrumentation-asyncio/README.rst Co-authored-by: Aaron Abbott * Update instrumentation/opentelemetry-instrumentation-asyncio/README.rst Co-authored-by: Aaron Abbott * Update instrumentation/opentelemetry-instrumentation-asyncio/README.rst Co-authored-by: Aaron Abbott * Update instrumentation/opentelemetry-instrumentation-asyncio/README.rst Co-authored-by: Aaron Abbott * Update instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py Co-authored-by: Aaron Abbott * Update instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py Co-authored-by: Aaron Abbott * include feedback * include feedback * drop python 3.7 support * drop python 3.7 support * Removed from default_instrumentations * Recover --------- Co-authored-by: Diego Hurtado Co-authored-by: Aaron Abbott --- .github/component_owners.yml | 3 + CHANGELOG.md | 3 +- CONTRIBUTING.md | 2 +- docs/instrumentation/asyncio/asyncio.rst | 7 + instrumentation/README.md | 1 + .../LICENSE | 201 ++++++++++ .../README.rst | 110 +++++ .../pyproject.toml | 59 +++ .../instrumentation/asyncio/__init__.py | 375 ++++++++++++++++++ .../asyncio/environment_variables.py | 34 ++ .../instrumentation/asyncio/package.py | 15 + .../instrumentation/asyncio/utils.py | 67 ++++ .../instrumentation/asyncio/version.py | 15 + .../tests/__init__.py | 13 + .../tests/common_test_func.py | 48 +++ .../tests/test_asyncio_cancellation.py | 78 ++++ .../tests/test_asyncio_create_task.py | 52 +++ .../tests/test_asyncio_ensure_future.py | 91 +++++ .../tests/test_asyncio_gather.py | 53 +++ .../tests/test_asyncio_integration.py | 49 +++ .../test_asyncio_run_coroutine_threadsafe.py | 61 +++ .../tests/test_asyncio_taskgroup.py | 63 +++ .../tests/test_asyncio_to_thread.py | 73 ++++ .../tests/test_asyncio_utils.py | 44 ++ .../tests/test_asyncio_wait.py | 88 ++++ .../pyproject.toml | 1 + .../instrumentation/bootstrap_gen.py | 1 + tox.ini | 7 + 28 files changed, 1612 insertions(+), 2 deletions(-) create mode 100644 docs/instrumentation/asyncio/asyncio.rst create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/LICENSE create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/README.rst create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/environment_variables.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/package.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/common_test_func.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_create_task.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_gather.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_integration.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_run_coroutine_threadsafe.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_taskgroup.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_utils.py create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_wait.py diff --git a/.github/component_owners.yml b/.github/component_owners.yml index e31fde9b48..3e8459ec59 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -67,3 +67,6 @@ components: instrumentation/opentelemetry-instrumentation-cassandra: - mattcontinisio + + instrumentation/opentelemetry-instrumentation-asyncio: + - bourbonkk diff --git a/CHANGELOG.md b/CHANGELOG.md index 868b4f3e0b..1a31f1a2d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Version 1.22.0/0.43b0 (2023-12-14) ### Added - +- `opentelemetry-instrumentation-asyncio` Add support for asyncio + ([#1919](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1943)) - `opentelemetry-instrumentation` Added Otel semantic convention opt-in mechanism ([#1987](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1987)) - `opentelemetry-instrumentation-httpx` Fix mixing async and non async hooks diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 329962955c..7c76634db7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -202,7 +202,7 @@ The continuation integration overrides that environment variable with as per the Below is a checklist of things to be mindful of when implementing a new instrumentation or working on a specific instrumentation. It is one of our goals as a community to keep the implementation specific details of instrumentations as similar across the board as possible for ease of testing and feature parity. It is also good to abstract as much common functionality as possible. - Follow semantic conventions - - The instrumentation should follow the semantic conventions defined [here](https://github.com/open-telemetry/opentelemetry-specification/tree/main/semantic_conventions) + - The instrumentation should follow the semantic conventions defined [here](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/semantic-conventions.md) - Extends from [BaseInstrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py#L26) - Supports auto-instrumentation - Add an entry point (ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/f045c43affff6ff1af8fa2f7514a4fdaca97dacf/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml#L44) diff --git a/docs/instrumentation/asyncio/asyncio.rst b/docs/instrumentation/asyncio/asyncio.rst new file mode 100644 index 0000000000..4cbcc70f09 --- /dev/null +++ b/docs/instrumentation/asyncio/asyncio.rst @@ -0,0 +1,7 @@ +OpenTelemetry asyncio Instrumentation +============================================== + +.. automodule:: opentelemetry.instrumentation.asyncio + :members: + :undoc-members: + :show-inheritance: diff --git a/instrumentation/README.md b/instrumentation/README.md index 2d77e806c5..d5e201b135 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -6,6 +6,7 @@ | [opentelemetry-instrumentation-aiohttp-server](./opentelemetry-instrumentation-aiohttp-server) | aiohttp ~= 3.0 | No | [opentelemetry-instrumentation-aiopg](./opentelemetry-instrumentation-aiopg) | aiopg >= 0.13.0, < 2.0.0 | No | [opentelemetry-instrumentation-asgi](./opentelemetry-instrumentation-asgi) | asgiref ~= 3.0 | No +| [opentelemetry-instrumentation-asyncio](./opentelemetry-instrumentation-asyncio) | asyncio | No | [opentelemetry-instrumentation-asyncpg](./opentelemetry-instrumentation-asyncpg) | asyncpg >= 0.12.0 | No | [opentelemetry-instrumentation-aws-lambda](./opentelemetry-instrumentation-aws-lambda) | aws_lambda | No | [opentelemetry-instrumentation-boto](./opentelemetry-instrumentation-boto) | boto~=2.0 | No diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/LICENSE b/instrumentation/opentelemetry-instrumentation-asyncio/LICENSE new file mode 100644 index 0000000000..1ef7dad2c5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + 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. diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/README.rst b/instrumentation/opentelemetry-instrumentation-asyncio/README.rst new file mode 100644 index 0000000000..d78e846793 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/README.rst @@ -0,0 +1,110 @@ +OpenTelemetry asyncio Instrumentation +====================================== + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-asyncio.svg + :target: https://pypi.org/project/opentelemetry-instrumentation-asyncio/ + +AsyncioInstrumentor: Tracing Requests Made by the Asyncio Library + + +The opentelemetry-instrumentation-asyncio package allows tracing asyncio applications. +It also includes metrics for duration and counts of coroutines and futures. Metrics are generated even if coroutines are not traced. + + +Set the names of coroutines you want to trace. +------------------------------------------------- +.. code:: bash + + export OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE=coro_name,coro_name2,coro_name3 + +If you want to trace specific blocking functions executed with the ``to_thread`` function of asyncio, set the name of the functions in ``OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE``. +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +.. code:: bash + + export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func_name,func_name2,func_name3 + +You can enable tracing futures with ``OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED`` +----------------------------------------------------------------------------------------------- +.. code:: bash + + export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true + +Run instrumented application +----------------------------- +1. coroutine +-------------------- +.. code:: python + + # export OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE=sleep + + import asyncio + from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor + + AsyncioInstrumentor().instrument() + + async def main(): + await asyncio.create_task(asyncio.sleep(0.1)) + + asyncio.run(main()) + +2. future +-------------------- +.. code:: python + + # export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true + + loop = asyncio.get_event_loop() + + future = asyncio.Future() + future.set_result(1) + task = asyncio.ensure_future(future) + loop.run_until_complete(task) + +3. to_thread +-------------------- +.. code:: python + + # export OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE=func + + import asyncio + from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor + + AsyncioInstrumentor().instrument() + + async def main(): + await asyncio.to_thread(func) + + def func(): + pass + + asyncio.run(main()) + + +asyncio metric types +---------------------- + +* `asyncio.process.duration` (seconds) - Duration of asyncio process +* `asyncio.process.count` (count) - Number of asyncio process + + +API +--- + + + +Installation +------------ + +:: + + pip install opentelemetry-instrumentation-asyncio + + +References +----------- + +* `OpenTelemetry asyncio/ Tracing `_ +* `OpenTelemetry Project `_ +* `OpenTelemetry Python Examples `_ diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml new file mode 100644 index 0000000000..0624714d99 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-instrumentation-asyncio" +dynamic = ["version"] +description = "OpenTelemetry instrumentation for asyncio" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.8" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "opentelemetry-api ~= 1.14", + "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-test-utils == 0.44b0.dev", + "wrapt >= 1.0.0, < 2.0.0", +] + +[project.optional-dependencies] +instruments = [] +test = [ + "opentelemetry-instrumentation-asyncio[instruments]", + "pytest", + "wrapt >= 1.0.0, < 2.0.0", + "pytest-asyncio", +] + +[project.entry-points.opentelemetry_instrumentor] +asyncio = "opentelemetry.instrumentation.asyncio:AsyncioInstrumentor" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-asyncio" + +[tool.hatch.version] +path = "src/opentelemetry/instrumentation/asyncio/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py new file mode 100644 index 0000000000..68e3d0839f --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/__init__.py @@ -0,0 +1,375 @@ +# 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. +""" +.. asyncio: https://github.com/python/asyncio + +The opentelemetry-instrumentation-asycnio package allows tracing asyncio applications. +The metric for coroutine, future, is generated even if there is no setting to generate a span. + +Run instrumented application +------------------------------ +1. coroutine +---------------- +.. code:: python + + # export OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE=sleep + + import asyncio + from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor + + AsyncioInstrumentor().instrument() + + async def main(): + await asyncio.create_task(asyncio.sleep(0.1)) + + asyncio.run(main()) + +2. future +------------ +.. code:: python + + # export OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED=true + + loop = asyncio.get_event_loop() + + future = asyncio.Future() + future.set_result(1) + task = asyncio.ensure_future(future) + loop.run_until_complete(task) + +3. to_thread +------------- +.. code:: python + + import asyncio + from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor + + AsyncioInstrumentor().instrument() + + async def main(): + await asyncio.to_thread(func) + + def func(): + pass + + asyncio.run(main()) + + +asyncio metric types +--------------------- + +* asyncio.process.duration (seconds) - Duration of asyncio process +* asyncio.process.count (count) - Number of asyncio process + + +API +--- +""" +import asyncio +import sys +from asyncio import futures +from timeit import default_timer +from typing import Collection + +from wrapt import wrap_function_wrapper as _wrap + +from opentelemetry.instrumentation.asyncio.package import _instruments +from opentelemetry.instrumentation.asyncio.utils import ( + get_coros_to_trace, + get_future_trace_enabled, + get_to_thread_to_trace, +) +from opentelemetry.instrumentation.asyncio.version import __version__ +from opentelemetry.instrumentation.instrumentor import BaseInstrumentor +from opentelemetry.instrumentation.utils import unwrap +from opentelemetry.metrics import get_meter +from opentelemetry.trace import get_tracer +from opentelemetry.trace.status import Status, StatusCode + +ASYNCIO_PREFIX = "asyncio" + + +class AsyncioInstrumentor(BaseInstrumentor): + """ + An instrumentor for asyncio + + See `BaseInstrumentor` + """ + + methods_with_coroutine = [ + "create_task", + "ensure_future", + "wait_for", + "wait", + "as_completed", + "run_coroutine_threadsafe", + ] + + def __init__(self): + super().__init__() + self.process_duration_histogram = None + self.process_created_counter = None + + self._tracer = None + self._meter = None + self._coros_name_to_trace: set = set() + self._to_thread_name_to_trace: set = set() + self._future_active_enabled: bool = False + + def instrumentation_dependencies(self) -> Collection[str]: + return _instruments + + def _instrument(self, **kwargs): + self._tracer = get_tracer( + __name__, __version__, kwargs.get("tracer_provider") + ) + self._meter = get_meter( + __name__, __version__, kwargs.get("meter_provider") + ) + + self._coros_name_to_trace = get_coros_to_trace() + self._future_active_enabled = get_future_trace_enabled() + self._to_thread_name_to_trace = get_to_thread_to_trace() + + self.process_duration_histogram = self._meter.create_histogram( + name="asyncio.process.duration", + description="Duration of asyncio process", + unit="s", + ) + self.process_created_counter = self._meter.create_counter( + name="asyncio.process.created", + description="Number of asyncio process", + unit="{process}", + ) + + for method in self.methods_with_coroutine: + self.instrument_method_with_coroutine(method) + + self.instrument_gather() + self.instrument_to_thread() + self.instrument_taskgroup_create_task() + + def _uninstrument(self, **kwargs): + for method in self.methods_with_coroutine: + uninstrument_method_with_coroutine(method) + uninstrument_gather() + uninstrument_to_thread() + uninstrument_taskgroup_create_task() + + def instrument_method_with_coroutine(self, method_name: str): + """ + Instruments specified asyncio method. + """ + + def wrap_coro_or_future(method, instance, args, kwargs): + + # If the first argument is a coroutine or future, + # we decorate it with a span and return the task. + if args and len(args) > 0: + first_arg = args[0] + # Check if it's a coroutine or future and wrap it + if asyncio.iscoroutine(first_arg) or futures.isfuture( + first_arg + ): + args = (self.trace_item(first_arg),) + args[1:] + # Check if it's a list and wrap each item + elif isinstance(first_arg, list): + args = ( + [self.trace_item(item) for item in first_arg], + ) + args[1:] + return method(*args, **kwargs) + + _wrap(asyncio, method_name, wrap_coro_or_future) + + def instrument_gather(self): + def wrap_coros_or_futures(method, instance, args, kwargs): + if args and len(args) > 0: + # Check if it's a coroutine or future and wrap it + wrapped_args = tuple(self.trace_item(item) for item in args) + return method(*wrapped_args, **kwargs) + return method(*args, **kwargs) + + _wrap(asyncio, "gather", wrap_coros_or_futures) + + def instrument_to_thread(self) -> None: + # to_thread was added in Python 3.9 + if sys.version_info < (3, 9): + return + + def wrap_to_thread(method, instance, args, kwargs) -> None: + if args: + first_arg = args[0] + # Wrap the first argument + wrapped_first_arg = self.trace_to_thread(first_arg) + wrapped_args = (wrapped_first_arg,) + args[1:] + + return method(*wrapped_args, **kwargs) + return method(*args, **kwargs) + + _wrap(asyncio, "to_thread", wrap_to_thread) + + def instrument_taskgroup_create_task(self) -> None: + # TaskGroup.create_task was added in Python 3.11 + if sys.version_info < (3, 11): + return + + def wrap_taskgroup_create_task(method, instance, args, kwargs) -> None: + if args: + coro = args[0] + wrapped_coro = self.trace_coroutine(coro) + wrapped_args = (wrapped_coro,) + args[1:] + return method(*wrapped_args, **kwargs) + return method(*args, **kwargs) + + _wrap( + asyncio.TaskGroup, # pylint: disable=no-member + "create_task", + wrap_taskgroup_create_task, + ) + + def trace_to_thread(self, func: callable): + """Trace a function.""" + start = default_timer() + span = ( + self._tracer.start_span( + f"{ASYNCIO_PREFIX} to_thread-" + func.__name__ + ) + if func.__name__ in self._to_thread_name_to_trace + else None + ) + attr = {"type": "to_thread", "name": func.__name__} + exception = None + try: + attr["state"] = "finished" + return func + except Exception: + attr["state"] = "exception" + raise + finally: + self.record_process(start, attr, span, exception) + + def trace_item(self, coro_or_future): + """Trace a coroutine or future item.""" + # Task is already traced, return it + if isinstance(coro_or_future, asyncio.Task): + return coro_or_future + if asyncio.iscoroutine(coro_or_future): + return self.trace_coroutine(coro_or_future) + if futures.isfuture(coro_or_future): + return self.trace_future(coro_or_future) + return coro_or_future + + async def trace_coroutine(self, coro): + start = default_timer() + attr = { + "type": "coroutine", + "name": coro.__name__, + } + span = ( + self._tracer.start_span(f"{ASYNCIO_PREFIX} coro-" + coro.__name__) + if coro.__name__ in self._coros_name_to_trace + else None + ) + exception = None + try: + attr["state"] = "finished" + return await coro + # CancelledError is raised when a coroutine is cancelled + # before it has a chance to run. We don't want to record + # this as an error. + except asyncio.CancelledError: + attr["state"] = "cancelled" + except Exception as exc: + exception = exc + state = determine_state(exception) + attr["state"] = state + raise + finally: + self.record_process(start, attr, span, exception) + + def trace_future(self, future): + start = default_timer() + span = ( + self._tracer.start_span(f"{ASYNCIO_PREFIX} future") + if self._future_active_enabled + else None + ) + + def callback(f): + exception = f.exception() + attr = { + "type": "future", + } + state = determine_state(exception) + attr["state"] = state + self.record_process(start, attr, span, exception) + + future.add_done_callback(callback) + return future + + def record_process( + self, start: float, attr: dict, span=None, exception=None + ) -> None: + """ + Record the processing time, update histogram and counter, and handle span. + + :param start: Start time of the process. + :param attr: Attributes for the histogram and counter. + :param span: Optional span for tracing. + :param exception: Optional exception occurred during the process. + """ + duration = max(default_timer() - start, 0) + self.process_duration_histogram.record(duration, attr) + self.process_created_counter.add(1, attr) + + if span: + if span.is_recording() and exception: + span.set_status(Status(StatusCode.ERROR)) + span.record_exception(exception) + span.end() + + +def determine_state(exception: Exception) -> str: + if isinstance(exception, asyncio.CancelledError): + return "cancelled" + if isinstance(exception, asyncio.TimeoutError): + return "timeout" + if exception: + return "exception" + return "finished" + + +def uninstrument_taskgroup_create_task() -> None: + # TaskGroup.create_task was added in Python 3.11 + if sys.version_info < (3, 11): + return + unwrap(asyncio.TaskGroup, "create_task") # pylint: disable=no-member + + +def uninstrument_to_thread() -> None: + # to_thread was added in Python 3.9 + if sys.version_info < (3, 9): + return + unwrap(asyncio, "to_thread") + + +def uninstrument_gather() -> None: + unwrap(asyncio, "gather") + + +def uninstrument_method_with_coroutine(method_name: str) -> None: + """ + Uninstrument specified asyncio method. + """ + unwrap(asyncio, method_name) diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/environment_variables.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/environment_variables.py new file mode 100644 index 0000000000..7420ea362f --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/environment_variables.py @@ -0,0 +1,34 @@ +# 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. + +""" +Enter the names of the coroutines to be traced through the environment variable below, separated by commas. +""" +OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE = ( + "OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE" +) + +""" +To determines whether the tracing feature for Future of Asyncio in Python is enabled or not. +""" +OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED = ( + "OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED" +) + +""" +Enter the names of the functions to be traced through the environment variable below, separated by commas. +""" +OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE = ( + "OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE" +) diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/package.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/package.py new file mode 100644 index 0000000000..484f6e9c58 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/package.py @@ -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. + +_instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py new file mode 100644 index 0000000000..15c78ae1ce --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/utils.py @@ -0,0 +1,67 @@ +# 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. +import os +from typing import Set + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, + OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED, + OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE, +) + + +def separate_coro_names_by_comma(coro_names: str) -> Set[str]: + """ + Function to separate the coroutines to be traced by comma + """ + if coro_names is None: + return set() + return {coro_name.strip() for coro_name in coro_names.split(",")} + + +def get_coros_to_trace() -> set: + """ + Function to get the coroutines to be traced from the environment variable + """ + coro_names = os.getenv(OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE) + return separate_coro_names_by_comma(coro_names) + + +def get_future_trace_enabled() -> bool: + """ + Function to get the future active enabled flag from the environment variable + default value is False + """ + return ( + os.getenv(OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED, "False").lower() + == "true" + ) + + +def get_to_thread_to_trace() -> set: + """ + Function to get the functions to be traced from the environment variable + """ + func_names = os.getenv( + OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE + ) + return separate_coro_names_by_comma(func_names) + + +__all__ = [ + "get_coros_to_trace", + "get_future_trace_enabled", + "get_to_thread_to_trace", +] diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py new file mode 100644 index 0000000000..ff896307c3 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py @@ -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.44b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/__init__.py new file mode 100644 index 0000000000..b0a6f42841 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/__init__.py @@ -0,0 +1,13 @@ +# 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. diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/common_test_func.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/common_test_func.py new file mode 100644 index 0000000000..5d06641bc0 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/common_test_func.py @@ -0,0 +1,48 @@ +# 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. + +import asyncio + + +async def async_func(): + await asyncio.sleep(0.1) + + +async def factorial(number: int): + factorial_value = 1 + for value in range(2, number + 1): + await asyncio.sleep(0) + factorial_value *= value + return factorial_value + + +async def cancellable_coroutine(): + await asyncio.sleep(2) + + +async def cancellation_coro(): + task = asyncio.create_task(cancellable_coroutine()) + + await asyncio.sleep(0.1) + task.cancel() + + await task + + +async def cancellation_create_task(): + await asyncio.create_task(cancellation_coro()) + + +async def ensure_future(): + await asyncio.ensure_future(asyncio.sleep(0)) diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py new file mode 100644 index 0000000000..9172cd4458 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_cancellation.py @@ -0,0 +1,78 @@ +# 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. +import asyncio +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import SpanKind, get_tracer + +from .common_test_func import cancellation_create_task + + +class TestAsyncioCancel(TestBase): + @patch.dict( + "os.environ", + { + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "cancellation_coro, cancellable_coroutine" + }, + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + def test_cancel(self): + with self._tracer.start_as_current_span("root", kind=SpanKind.SERVER): + asyncio.run(cancellation_create_task()) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 3) + self.assertEqual(spans[0].context.trace_id, spans[1].context.trace_id) + self.assertEqual(spans[2].context.trace_id, spans[1].context.trace_id) + + self.assertEqual(spans[0].name, "asyncio coro-cancellable_coroutine") + self.assertEqual(spans[1].name, "asyncio coro-cancellation_coro") + for metric in ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics + ): + if metric.name == "asyncio.process.duration": + for point in metric.data.data_points: + self.assertEqual(point.attributes["type"], "coroutine") + self.assertIn( + point.attributes["name"], + ["cancellation_coro", "cancellable_coroutine"], + ) + if metric.name == "asyncio.process.created": + for point in metric.data.data_points: + self.assertEqual(point.attributes["type"], "coroutine") + self.assertIn( + point.attributes["name"], + ["cancellation_coro", "cancellable_coroutine"], + ) + self.assertIn( + point.attributes["state"], ["finished", "cancelled"] + ) diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_create_task.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_create_task.py new file mode 100644 index 0000000000..9df8d9d14b --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_create_task.py @@ -0,0 +1,52 @@ +# 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. +import asyncio +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + +from .common_test_func import factorial + + +class TestAsyncioCreateTask(TestBase): + @patch.dict( + "os.environ", {OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "sleep"} + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + def test_asyncio_create_task(self): + async def async_func(): + await asyncio.create_task(asyncio.sleep(0)) + await asyncio.create_task(factorial(3)) + + asyncio.run(async_func()) + spans = self.memory_exporter.get_finished_spans() + + self.assertEqual(len(spans), 1) + self.assertEqual(spans[0].name, "asyncio coro-sleep") diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py new file mode 100644 index 0000000000..4907aa4bf8 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_ensure_future.py @@ -0,0 +1,91 @@ +# 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. +import asyncio +from unittest.mock import patch + +import pytest + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + +from .common_test_func import async_func + + +class TestAsyncioEnsureFuture(TestBase): + @patch.dict( + "os.environ", {OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED: "true"} + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + @pytest.mark.asyncio + def test_asyncio_loop_ensure_future(self): + """ + async_func is not traced because it is not set in the environment variable + """ + + async def test(): + task = asyncio.ensure_future(async_func()) + await task + + asyncio.run(test()) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 0) + + @pytest.mark.asyncio + def test_asyncio_ensure_future_with_future(self): + async def test(): + with self._tracer.start_as_current_span("root"): + future = asyncio.Future() + future.set_result(1) + task = asyncio.ensure_future(future) + await task + + asyncio.run(test()) + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 2) + for span in spans: + if span.name == "root": + self.assertEqual(span.parent, None) + if span.name == "asyncio future": + self.assertNotEqual(span.parent.trace_id, 0) + + for metric in ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics + ): + if metric.name == "asyncio.process.duration": + for point in metric.data.data_points: + self.assertEqual(point.attributes["type"], "future") + if metric.name == "asyncio.process.created": + for point in metric.data.data_points: + self.assertEqual(point.attributes["type"], "future") + self.assertEqual(point.attributes["state"], "finished") diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_gather.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_gather.py new file mode 100644 index 0000000000..395b46b698 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_gather.py @@ -0,0 +1,53 @@ +# 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. +import asyncio +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + +from .common_test_func import factorial + + +class TestAsyncioGather(TestBase): + @patch.dict( + "os.environ", + {OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "factorial"}, + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + def test_asyncio_gather(self): + async def gather_factorial(): + await asyncio.gather(factorial(2), factorial(3), factorial(4)) + + asyncio.run(gather_factorial()) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 3) + self.assertEqual(spans[0].name, "asyncio coro-factorial") + self.assertEqual(spans[1].name, "asyncio coro-factorial") + self.assertEqual(spans[2].name, "asyncio coro-factorial") diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_integration.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_integration.py new file mode 100644 index 0000000000..7f4723ec24 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_integration.py @@ -0,0 +1,49 @@ +# 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. +import asyncio +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + +from .common_test_func import ensure_future + + +class TestAsyncioInstrumentor(TestBase): + def setUp(self): + super().setUp() + self._tracer = get_tracer( + __name__, + ) + + @patch.dict( + "os.environ", {OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "sleep"} + ) + def test_asyncio_integration(self): + AsyncioInstrumentor().instrument() + + asyncio.run(ensure_future()) + spans = self.memory_exporter.get_finished_spans() + self.memory_exporter.clear() + assert spans + AsyncioInstrumentor().uninstrument() + + asyncio.run(ensure_future()) + spans = self.memory_exporter.get_finished_spans() + assert not spans diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_run_coroutine_threadsafe.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_run_coroutine_threadsafe.py new file mode 100644 index 0000000000..fdf4bcb353 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_run_coroutine_threadsafe.py @@ -0,0 +1,61 @@ +# 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. +import asyncio +import threading +from concurrent.futures import ThreadPoolExecutor +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + + +class TestRunCoroutineThreadSafe(TestBase): + @patch.dict( + "os.environ", {OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "coro"} + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self.loop = asyncio.new_event_loop() + self.executor = ThreadPoolExecutor(max_workers=1) + self.loop.set_default_executor(self.executor) + self.thread = threading.Thread(target=self.loop.run_forever) + self.thread.start() + + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + self.loop.call_soon_threadsafe(self.loop.stop) + self.thread.join() + self.loop.close() + + AsyncioInstrumentor().uninstrument() + + def test_run_coroutine_threadsafe(self): + async def coro(): + return 42 + + future = asyncio.run_coroutine_threadsafe(coro(), self.loop) + result = future.result(timeout=1) + self.assertEqual(result, 42) + spans = self.memory_exporter.get_finished_spans() + assert spans diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_taskgroup.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_taskgroup.py new file mode 100644 index 0000000000..e02f63aa42 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_taskgroup.py @@ -0,0 +1,63 @@ +# 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. +import asyncio +import sys +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + +from .common_test_func import async_func + +py11 = False +if sys.version_info >= (3, 11): + py11 = True + + +class TestAsyncioTaskgroup(TestBase): + @patch.dict( + "os.environ", + {OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "async_func"}, + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + def test_task_group_create_task(self): + # TaskGroup is only available in Python 3.11+ + if not py11: + return + + async def main(): + async with asyncio.TaskGroup() as tg: # pylint: disable=no-member + for _ in range(10): + tg.create_task(async_func()) + + with self._tracer.start_as_current_span("root"): + asyncio.run(main()) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 11) + self.assertEqual(spans[4].context.trace_id, spans[5].context.trace_id) diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py new file mode 100644 index 0000000000..b53a6edc08 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_to_thread.py @@ -0,0 +1,73 @@ +# 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. +import asyncio +import sys +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + + +class TestAsyncioToThread(TestBase): + @patch.dict( + "os.environ", + {OTEL_PYTHON_ASYNCIO_TO_THREAD_FUNCTION_NAMES_TO_TRACE: "multiply"}, + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + def test_to_thread(self): + # to_thread is only available in Python 3.9+ + if sys.version_info >= (3, 9): + + def multiply(x, y): + return x * y + + async def to_thread(): + result = await asyncio.to_thread(multiply, 2, 3) + assert result == 6 + + with self._tracer.start_as_current_span("root"): + asyncio.run(to_thread()) + spans = self.memory_exporter.get_finished_spans() + + self.assertEqual(len(spans), 2) + assert spans[0].name == "asyncio to_thread-multiply" + for metric in ( + self.memory_metrics_reader.get_metrics_data() + .resource_metrics[0] + .scope_metrics[0] + .metrics + ): + if metric.name == "asyncio.process.duration": + for point in metric.data.data_points: + self.assertEqual(point.attributes["type"], "to_thread") + self.assertEqual(point.attributes["name"], "multiply") + if metric.name == "asyncio.process.created": + for point in metric.data.data_points: + self.assertEqual(point.attributes["type"], "to_thread") + self.assertEqual(point.attributes["name"], "multiply") diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_utils.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_utils.py new file mode 100644 index 0000000000..f3974e2d43 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_utils.py @@ -0,0 +1,44 @@ +# 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. +from unittest import TestCase +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, + OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED, +) +from opentelemetry.instrumentation.asyncio.utils import ( + get_coros_to_trace, + get_future_trace_enabled, +) + + +class TestAsyncioToThread(TestCase): + @patch.dict( + "os.environ", + { + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "test1,test2,test3 ,test4" + }, + ) + def test_separator(self): + self.assertEqual( + get_coros_to_trace(), {"test1", "test2", "test3", "test4"} + ) + + @patch.dict( + "os.environ", {OTEL_PYTHON_ASYNCIO_FUTURE_TRACE_ENABLED: "true"} + ) + def test_future_trace_enabled(self): + self.assertEqual(get_future_trace_enabled(), True) diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_wait.py b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_wait.py new file mode 100644 index 0000000000..77064aeafa --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/tests/test_asyncio_wait.py @@ -0,0 +1,88 @@ +# 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. +import asyncio +import sys +from unittest.mock import patch + +# pylint: disable=no-name-in-module +from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor +from opentelemetry.instrumentation.asyncio.environment_variables import ( + OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE, +) +from opentelemetry.test.test_base import TestBase +from opentelemetry.trace import get_tracer + +from .common_test_func import async_func + + +class TestAsyncioWait(TestBase): + @patch.dict( + "os.environ", + {OTEL_PYTHON_ASYNCIO_COROUTINE_NAMES_TO_TRACE: "async_func"}, + ) + def setUp(self): + super().setUp() + AsyncioInstrumentor().instrument() + self._tracer = get_tracer( + __name__, + ) + + def tearDown(self): + super().tearDown() + AsyncioInstrumentor().uninstrument() + + def test_asyncio_wait_with_create_task(self): + async def main(): + if sys.version_info >= (3, 11): + # In Python 3.11, you can't send coroutines directly to asyncio.wait(). + # Instead, you must wrap them in asyncio.create_task(). + tasks = [ + asyncio.create_task(async_func()), + asyncio.create_task(async_func()), + ] + await asyncio.wait(tasks) + else: + await asyncio.wait([async_func(), async_func()]) + + asyncio.run(main()) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 2) + + def test_asyncio_wait_for(self): + async def main(): + await asyncio.wait_for(async_func(), 1) + await asyncio.wait_for(async_func(), 1) + + asyncio.run(main()) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 2) + + def test_asyncio_as_completed(self): + async def main(): + if sys.version_info >= (3, 11): + # In Python 3.11, you can't send coroutines directly to asyncio.as_completed(). + # Instead, you must wrap them in asyncio.create_task(). + tasks = [ + asyncio.create_task(async_func()), + asyncio.create_task(async_func()), + ] + for task in asyncio.as_completed(tasks): + await task + else: + for task in asyncio.as_completed([async_func(), async_func()]): + await task + + asyncio.run(main()) + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 2) diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index b954212b98..ff29864774 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -33,6 +33,7 @@ dependencies = [ "opentelemetry-instrumentation-aiohttp-server==0.44b0.dev", "opentelemetry-instrumentation-aiopg==0.44b0.dev", "opentelemetry-instrumentation-asgi==0.44b0.dev", + "opentelemetry-instrumentation-asyncio==0.44b0.dev", "opentelemetry-instrumentation-asyncpg==0.44b0.dev", "opentelemetry-instrumentation-aws-lambda==0.44b0.dev", "opentelemetry-instrumentation-boto==0.44b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index bf94b44d25..92ac4d9768 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -186,6 +186,7 @@ }, ] default_instrumentations = [ + "opentelemetry-instrumentation-asyncio==0.44b0.dev", "opentelemetry-instrumentation-aws-lambda==0.44b0.dev", "opentelemetry-instrumentation-dbapi==0.44b0.dev", "opentelemetry-instrumentation-logging==0.44b0.dev", diff --git a/tox.ini b/tox.ini index 3b921b9be1..74f785974d 100644 --- a/tox.ini +++ b/tox.ini @@ -230,6 +230,9 @@ envlist = py3{8,9,10,11}-test-instrumentation-confluent-kafka pypy3-test-instrumentation-confluent-kafka + ; opentelemetry-instrumentation-asyncio + py3{8,9,10,11}-test-instrumentation-asyncio + ; opentelemetry-instrumentation-cassandra py3{8,9,10,11}-test-instrumentation-cassandra pypy3-test-instrumentation-cassandra @@ -349,6 +352,7 @@ changedir = test-instrumentation-tortoiseorm: instrumentation/opentelemetry-instrumentation-tortoiseorm/tests test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests test-instrumentation-httpx-{18,21}: instrumentation/opentelemetry-instrumentation-httpx/tests + test-instrumentation-asyncio: instrumentation/opentelemetry-instrumentation-asyncio/tests test-util-http: util/opentelemetry-util-http/tests test-sdkextension-aws: sdk-extension/opentelemetry-sdk-extension-aws/tests test-resource-detector-container: resource/opentelemetry-resource-detector-container/tests @@ -465,6 +469,8 @@ commands_pre = elasticsearch-{2,5,6}: pip install {toxinidir}/opentelemetry-instrumentation[test] {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] + asyncio: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio[test] + httpx-{18,21}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] sdkextension-aws: pip install {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] @@ -571,6 +577,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] + python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio[test] python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] # requires snappy headers to be available on the system python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] From 2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179 Mon Sep 17 00:00:00 2001 From: Ben Beasley Date: Wed, 14 Feb 2024 23:21:14 -0500 Subject: [PATCH 107/200] Drop obsolete parameterized test dependency (#2134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the test dependencies for `opentelemetry-instrumentation-falcon`, don’t depend on `parametrized` because `pytest.mark.parametrize` is now included in `pytest`. --- .../opentelemetry-instrumentation-falcon/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 8d935cceb1..911618ae99 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -39,7 +39,6 @@ instruments = [ test = [ "opentelemetry-instrumentation-falcon[instruments]", "opentelemetry-test-utils == 0.44b0.dev", - "parameterized == 0.7.4", ] [project.entry-points.opentelemetry_instrumentor] From efb327d4d7b9ba1bd283534e5afbfd4424acf3f9 Mon Sep 17 00:00:00 2001 From: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:16:34 -0800 Subject: [PATCH 108/200] AwsLambdaInstrumentor handles and re-raises handler function exception (#2245) --- CHANGELOG.md | 1 + .../instrumentation/aws_lambda/__init__.py | 15 +++++++++++- .../tests/mocks/lambda_function.py | 4 ++++ .../test_aws_lambda_instrumentation_manual.py | 23 ++++++++++++++++++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a31f1a2d5..421d28888e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2136](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2136)) - `opentelemetry-resource-detector-azure` Suppress instrumentation for `urllib` call ([#2178](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2178)) +- AwsLambdaInstrumentor handles and re-raises function exception ([#2245](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2245)) ## Version 1.22.0/0.43b0 (2023-12-14) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index 391bc32f60..130622f8c8 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -97,6 +97,7 @@ def custom_event_context_extractor(lambda_event): get_tracer_provider, ) from opentelemetry.trace.propagation import get_current_span +from opentelemetry.trace.status import Status, StatusCode logger = logging.getLogger(__name__) @@ -278,6 +279,7 @@ def _set_api_gateway_v2_proxy_attributes( return span +# pylint: disable=too-many-statements def _instrument( wrapped_module_name, wrapped_function_name, @@ -287,6 +289,8 @@ def _instrument( disable_aws_context_propagation: bool = False, meter_provider: MeterProvider = None, ): + # pylint: disable=too-many-locals + # pylint: disable=too-many-statements def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches call_wrapped, instance, args, kwargs ): @@ -350,7 +354,13 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches lambda_context.aws_request_id, ) - result = call_wrapped(*args, **kwargs) + exception = None + try: + result = call_wrapped(*args, **kwargs) + except Exception as exc: # pylint: disable=W0703 + exception = exc + span.set_status(Status(StatusCode.ERROR)) + span.record_exception(exception) # If the request came from an API Gateway, extract http attributes from the event # https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/instrumentation/aws-lambda.md#api-gateway @@ -398,6 +408,9 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches "MeterProvider was missing `force_flush` method. This is necessary in case of a Lambda freeze and would exist in the OTel SDK implementation." ) + if exception is not None: + raise exception.with_traceback(exception.__traceback__) + return result wrap_function_wrapper( diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py index 259375c481..a878d0f06a 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/lambda_function.py @@ -19,3 +19,7 @@ def handler(event, context): def rest_api_handler(event, context): return {"statusCode": 200, "body": "200 ok"} + + +def handler_exc(event, context): + raise Exception("500 internal server error") diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py index 5e4aaf0312..2fa4aafee5 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py @@ -40,7 +40,7 @@ from opentelemetry.semconv.resource import ResourceAttributes from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase -from opentelemetry.trace import NoOpTracerProvider, SpanKind +from opentelemetry.trace import NoOpTracerProvider, SpanKind, StatusCode from opentelemetry.trace.propagation.tracecontext import ( TraceContextTextMapPropagator, ) @@ -410,6 +410,27 @@ def test_lambda_handles_list_event(self): assert spans + def test_lambda_handles_handler_exception(self): + exc_env_patch = mock.patch.dict( + "os.environ", + {_HANDLER: "tests.mocks.lambda_function.handler_exc"}, + ) + exc_env_patch.start() + AwsLambdaInstrumentor().instrument() + # instrumentor re-raises the exception + with self.assertRaises(Exception): + mock_execute_lambda() + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + span = spans[0] + self.assertEqual(span.status.status_code, StatusCode.ERROR) + self.assertEqual(len(span.events), 1) + event = span.events[0] + self.assertEqual(event.name, "exception") + + exc_env_patch.stop() + def test_uninstrument(self): AwsLambdaInstrumentor().instrument() From 565d2e33f410f8a8b7786d6c26ad25831615099e Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 22 Feb 2024 17:34:53 -0600 Subject: [PATCH 109/200] Remove werkzeug from Flask instrumentation dependencies (#2257) Fixes #2256 --- .../opentelemetry-instrumentation-flask/pyproject.toml | 1 - .../src/opentelemetry/instrumentation/bootstrap_gen.py | 4 ---- 2 files changed, 5 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 180e401333..dc3f6e6116 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -34,7 +34,6 @@ dependencies = [ [project.optional-dependencies] instruments = [ - "werkzeug < 3.0.0", "flask >= 1.0", ] test = [ diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 92ac4d9768..cd8f74aba6 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -84,10 +84,6 @@ "library": "fastapi ~= 0.58", "instrumentation": "opentelemetry-instrumentation-fastapi==0.44b0.dev", }, - { - "library": "werkzeug < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.44b0.dev", - }, { "library": "flask >= 1.0", "instrumentation": "opentelemetry-instrumentation-flask==0.44b0.dev", From 343d137f9579850635377d5e4e2e37e647a01a0f Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 22 Feb 2024 16:12:38 -0800 Subject: [PATCH 110/200] Skipping certain folders in release script (#2258) --- scripts/build.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index dc3e237946..e0c439c32e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -27,12 +27,21 @@ DISTDIR=dist fi ) done + ( cd $DISTDIR - for x in *.tar.gz ; do + for x in * ; do + # FIXME: Remove this logic once these packages are available in Pypi + if (echo "$x" | grep -Eq ^opentelemetry_(instrumentation_aiohttp_server|resource_detector_container).*(\.tar\.gz|\.whl)$); then + echo "Skipping $x because of erroneous uploads. See: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2053" + rm $x + # FIXME: Remove this once opentelemetry-resource-detector-azure package goes 1.X + elif (echo "$x" | grep -Eq ^opentelemetry_resource_detector_azure.*(\.tar\.gz|\.whl)$); then + echo "Skipping $x because of manual upload by Azure maintainers." + rm $x # NOTE: We filter beta vs 1.0 package at this point because we can read the - # version directly from the .tar.gz file. - if (echo "$x" | grep -Eq ^opentelemetry_.*-0\..*\.tar\.gz$); then + # version directly from the .tar.gz/whl file + elif (echo "$x" | grep -Eq ^opentelemetry_.*-0\..*(\.tar\.gz|\.whl)$); then : else echo "Skipping $x because it is not in pre-1.0 state and should be released using a tag." From d2d4561593cc1cfa3a8840d27d9b789b912b97b1 Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:13:21 +0100 Subject: [PATCH 111/200] Update version to 1.24.0.dev/0.45b0.dev (#2262) --- .github/workflows/instrumentations_0.yml | 2 +- .github/workflows/instrumentations_1.yml | 2 +- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + _template/version.py | 2 +- eachdist.ini | 4 +- .../prometheus_remote_write/version.py | 2 +- .../pyproject.toml | 2 +- .../exporter/richconsole/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/aio_pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_client/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_server/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/aiopg/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/asgi/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncio/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncpg/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aws_lambda/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/boto3sqs/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/botocore/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/cassandra/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/celery/version.py | 2 +- .../confluent_kafka/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/dbapi/version.py | 2 +- .../pyproject.toml | 12 +-- .../instrumentation/django/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/elasticsearch/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/falcon/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/fastapi/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/flask/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/grpc/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/httpx/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/jinja2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/kafka/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/logging/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysql/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/mysqlclient/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/psycopg2/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymemcache/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymongo/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/pymysql/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/pyramid/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/redis/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/remoulade/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/requests/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sklearn/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlalchemy/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/sqlite3/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/starlette/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/system_metrics/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/tornado/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/tortoiseorm/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/urllib3/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/wsgi/version.py | 2 +- .../pyproject.toml | 92 +++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 96 +++++++++---------- .../opentelemetry/instrumentation/version.py | 2 +- .../propagators/ot_trace/version.py | 2 +- .../resource/detector/container/version.py | 2 +- .../src/opentelemetry/util/http/version.py | 2 +- 109 files changed, 306 insertions(+), 304 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index 92ab15d4e0..5505fce008 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f + CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1 jobs: instrumentations-0: diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 931ab5d68e..b5f3a01835 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f + CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1 jobs: instrumentations-1: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c5a86922f..3bc748551b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: e98af82ff0ebe7e687fda265093aa576cd9ba80f + CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1 jobs: misc: diff --git a/CHANGELOG.md b/CHANGELOG.md index 421d28888e..aea2dc6193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## Version 1.23.0/0.44b0 (2024-02-23) + - Drop support for 3.7 ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151)) - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector diff --git a/_template/version.py b/_template/version.py index ff896307c3..2b23bc4994 100644 --- a/_template/version.py +++ b/_template/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/eachdist.ini b/eachdist.ini index 5c6531ca65..8d6bdbb6be 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.23.0.dev +version=1.24.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.44b0.dev +version=0.45b0.dev packages= all diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py index ff896307c3..2b23bc4994 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index dc43484520..c8a509f643 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "rich>=10.0.0", ] diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py index ff896307c3..2b23bc4994 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index e645bd42ee..f328eab452 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aio-pika[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index bbb44b6cb5..9aac42647a 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py index 65fe1deedd..f7a124c7b8 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index 55aad6ef61..566f9dbb35 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index bd1c415226..ebb88ee0ba 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-dbapi == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-dbapi == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,8 +36,8 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-aiopg[instruments]", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index 9e02da3210..d642a07e48 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asgi[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml index 0624714d99..358fbefeb4 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.14", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index f9879a993a..bd9e26bbe4 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-asyncpg[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 13729c8b56..6ab6e23ffc 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -21,15 +21,15 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 86fccf3411..307a96e5aa 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ test = [ "opentelemetry-instrumentation-boto[instruments]", "markupsafe==2.0.1", "moto~=2.0", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 8cad706028..89e1e112d8 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-boto3sqs[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index 44f3c3b0f1..cd8add1aa7 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", ] @@ -39,7 +39,7 @@ test = [ "markupsafe==2.0.1", "botocore ~= 1.0, < 1.31.81", "moto[all] ~= 2.2.6", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index b6ec60bfcd..9088332425 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-cassandra[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index 1875421547..ea866d4b4b 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-celery[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "pytest", ] diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index 782d599c07..3032c12da6 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -25,15 +25,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py index 6ce2e661e7..6340c1adfb 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 9f964faae0..50cc227e44 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -25,22 +25,22 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-wsgi == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-wsgi == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.44b0.dev", + "opentelemetry-instrumentation-asgi == 0.45b0.dev", ] instruments = [ "django >= 1.10", ] test = [ "opentelemetry-instrumentation-django[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index 9037560513..c716769f5c 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-elasticsearch[instruments]", "elasticsearch-dsl >= 2.0", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 911618ae99..1e4b5e5254 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-wsgi == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-wsgi == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", "packaging >= 20.0", ] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-falcon[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index e118df1ed7..4df6d3760c 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-asgi == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-asgi == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-fastapi[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index dc3f6e6116..ca26f4c860 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-wsgi == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-wsgi == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", "packaging >= 21.0", ] @@ -39,7 +39,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-flask[instruments]", "markupsafe==2.1.2", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 44bcbbad01..8373feaa40 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-grpc[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "protobuf ~= 3.13", ] diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index cba9e4d84b..f13fa816bc 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-httpx[instruments]", "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index c8f91cffb0..c3648a2922 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-jinja2[instruments]", "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index a8d8a066a0..b303a61a5c 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-kafka-python[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 8251dffa5d..518fdb0403 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,13 +25,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py index 6ce2e661e7..6340c1adfb 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index bf5d63acc3..7f7b703266 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-dbapi == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-dbapi == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysql[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index 4489c96950..de8c31a1f3 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-dbapi == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-dbapi == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-mysqlclient[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index 75efcd8400..b11c9bbffc 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pika[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "pytest", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index 3c7c177eaa..a300fa9fdd 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-dbapi == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-dbapi == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-psycopg2[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index 2ec603af87..e7a642b0aa 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymemcache[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index e4abdacc56..6df765bfe0 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymongo[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 0a23003473..4018d29601 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-dbapi == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-dbapi == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pymysql[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index fa6f64a24f..1face37ccc 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-wsgi == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-wsgi == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-pyramid[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "werkzeug == 0.16.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index 532728e911..8511671ed6 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "wrapt >= 1.12.1", ] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-redis[instruments]", "opentelemetry-sdk ~= 1.3", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index d442e05073..b8c9d2709b 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-remoulade[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "opentelemetry-sdk ~= 1.10" ] diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index 81bcca9760..a4f8255e00 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-requests[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index a0639d6c3e..28fa247159 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", ] [project.optional-dependencies] @@ -34,7 +34,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-sklearn[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index 65fe1deedd..f7a124c7b8 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 159c47f2d6..1c63d671b7 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", "packaging >= 21.0", "wrapt >= 1.11.2", ] diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index 751f7423f2..0ccdc2da06 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -25,14 +25,14 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-dbapi == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-dbapi == 0.45b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py index 6ce2e661e7..6340c1adfb 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index cd8e96bc2d..8b2f2a7014 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-instrumentation-asgi == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-asgi == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] @@ -37,7 +37,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-starlette[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "requests ~= 2.23", # needed for testclient "httpx ~= 0.22", # needed for testclient ] diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 00d6aba476..caf27ec5ab 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-system-metrics[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index eb1d3b2edb..54706b42f2 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -24,9 +24,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] @@ -35,7 +35,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tornado[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", "http-server-mock" ] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 503acbb784..9d32028bdd 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", ] [project.optional-dependencies] @@ -36,7 +36,7 @@ instruments = [ ] test = [ "opentelemetry-instrumentation-tortoiseorm[instruments]", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index 15c1cf29aa..3fe6d272cb 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -25,16 +25,16 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] instruments = [] test = [ "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py index 6ce2e661e7..6340c1adfb 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index a718e128af..fbd27f7bd8 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] @@ -38,7 +38,7 @@ instruments = [ test = [ "opentelemetry-instrumentation-urllib3[instruments]", "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 8b90dde000..bb1b6ef286 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -25,15 +25,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", - "opentelemetry-semantic-conventions == 0.44b0.dev", - "opentelemetry-util-http == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-util-http == 0.45b0.dev", ] [project.optional-dependencies] instruments = [] test = [ - "opentelemetry-test-utils == 0.44b0.dev", + "opentelemetry-test-utils == 0.45b0.dev", ] [project.urls] diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py index ff896307c3..2b23bc4994 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index ff29864774..794906793b 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -28,52 +28,52 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.44b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.44b0.dev", - "opentelemetry-instrumentation-aiohttp-server==0.44b0.dev", - "opentelemetry-instrumentation-aiopg==0.44b0.dev", - "opentelemetry-instrumentation-asgi==0.44b0.dev", - "opentelemetry-instrumentation-asyncio==0.44b0.dev", - "opentelemetry-instrumentation-asyncpg==0.44b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.44b0.dev", - "opentelemetry-instrumentation-boto==0.44b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.44b0.dev", - "opentelemetry-instrumentation-botocore==0.44b0.dev", - "opentelemetry-instrumentation-cassandra==0.44b0.dev", - "opentelemetry-instrumentation-celery==0.44b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.44b0.dev", - "opentelemetry-instrumentation-dbapi==0.44b0.dev", - "opentelemetry-instrumentation-django==0.44b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.44b0.dev", - "opentelemetry-instrumentation-falcon==0.44b0.dev", - "opentelemetry-instrumentation-fastapi==0.44b0.dev", - "opentelemetry-instrumentation-flask==0.44b0.dev", - "opentelemetry-instrumentation-grpc==0.44b0.dev", - "opentelemetry-instrumentation-httpx==0.44b0.dev", - "opentelemetry-instrumentation-jinja2==0.44b0.dev", - "opentelemetry-instrumentation-kafka-python==0.44b0.dev", - "opentelemetry-instrumentation-logging==0.44b0.dev", - "opentelemetry-instrumentation-mysql==0.44b0.dev", - "opentelemetry-instrumentation-mysqlclient==0.44b0.dev", - "opentelemetry-instrumentation-pika==0.44b0.dev", - "opentelemetry-instrumentation-psycopg2==0.44b0.dev", - "opentelemetry-instrumentation-pymemcache==0.44b0.dev", - "opentelemetry-instrumentation-pymongo==0.44b0.dev", - "opentelemetry-instrumentation-pymysql==0.44b0.dev", - "opentelemetry-instrumentation-pyramid==0.44b0.dev", - "opentelemetry-instrumentation-redis==0.44b0.dev", - "opentelemetry-instrumentation-remoulade==0.44b0.dev", - "opentelemetry-instrumentation-requests==0.44b0.dev", - "opentelemetry-instrumentation-sklearn==0.44b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.44b0.dev", - "opentelemetry-instrumentation-sqlite3==0.44b0.dev", - "opentelemetry-instrumentation-starlette==0.44b0.dev", - "opentelemetry-instrumentation-system-metrics==0.44b0.dev", - "opentelemetry-instrumentation-tornado==0.44b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.44b0.dev", - "opentelemetry-instrumentation-urllib==0.44b0.dev", - "opentelemetry-instrumentation-urllib3==0.44b0.dev", - "opentelemetry-instrumentation-wsgi==0.44b0.dev", + "opentelemetry-instrumentation-aio-pika==0.45b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.45b0.dev", + "opentelemetry-instrumentation-aiohttp-server==0.45b0.dev", + "opentelemetry-instrumentation-aiopg==0.45b0.dev", + "opentelemetry-instrumentation-asgi==0.45b0.dev", + "opentelemetry-instrumentation-asyncio==0.45b0.dev", + "opentelemetry-instrumentation-asyncpg==0.45b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.45b0.dev", + "opentelemetry-instrumentation-boto==0.45b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.45b0.dev", + "opentelemetry-instrumentation-botocore==0.45b0.dev", + "opentelemetry-instrumentation-cassandra==0.45b0.dev", + "opentelemetry-instrumentation-celery==0.45b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.45b0.dev", + "opentelemetry-instrumentation-dbapi==0.45b0.dev", + "opentelemetry-instrumentation-django==0.45b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.45b0.dev", + "opentelemetry-instrumentation-falcon==0.45b0.dev", + "opentelemetry-instrumentation-fastapi==0.45b0.dev", + "opentelemetry-instrumentation-flask==0.45b0.dev", + "opentelemetry-instrumentation-grpc==0.45b0.dev", + "opentelemetry-instrumentation-httpx==0.45b0.dev", + "opentelemetry-instrumentation-jinja2==0.45b0.dev", + "opentelemetry-instrumentation-kafka-python==0.45b0.dev", + "opentelemetry-instrumentation-logging==0.45b0.dev", + "opentelemetry-instrumentation-mysql==0.45b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.45b0.dev", + "opentelemetry-instrumentation-pika==0.45b0.dev", + "opentelemetry-instrumentation-psycopg2==0.45b0.dev", + "opentelemetry-instrumentation-pymemcache==0.45b0.dev", + "opentelemetry-instrumentation-pymongo==0.45b0.dev", + "opentelemetry-instrumentation-pymysql==0.45b0.dev", + "opentelemetry-instrumentation-pyramid==0.45b0.dev", + "opentelemetry-instrumentation-redis==0.45b0.dev", + "opentelemetry-instrumentation-remoulade==0.45b0.dev", + "opentelemetry-instrumentation-requests==0.45b0.dev", + "opentelemetry-instrumentation-sklearn==0.45b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.45b0.dev", + "opentelemetry-instrumentation-sqlite3==0.45b0.dev", + "opentelemetry-instrumentation-starlette==0.45b0.dev", + "opentelemetry-instrumentation-system-metrics==0.45b0.dev", + "opentelemetry-instrumentation-tornado==0.45b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.45b0.dev", + "opentelemetry-instrumentation-urllib==0.45b0.dev", + "opentelemetry-instrumentation-urllib3==0.45b0.dev", + "opentelemetry-instrumentation-wsgi==0.45b0.dev", ] [project.optional-dependencies] diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py index ff896307c3..2b23bc4994 100644 --- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py +++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index 63d4d34a02..43c646b1d9 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -23,13 +23,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.44b0.dev", + "opentelemetry-instrumentation == 0.45b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.23.0.dev", + "opentelemetry-exporter-otlp == 1.24.0.dev", ] test = [] diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py index ff896307c3..2b23bc4994 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/version.py +++ b/opentelemetry-distro/src/opentelemetry/distro/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index cd8f74aba6..169b9b9b89 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,175 +18,175 @@ libraries = [ { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.45b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.45b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.45b0.dev", }, { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.45b0.dev", }, { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.45b0.dev", }, { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.45b0.dev", }, { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.45b0.dev", }, { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.45b0.dev", }, { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.45b0.dev", }, { "library": "cassandra-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.45b0.dev", }, { "library": "scylla-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.45b0.dev", }, { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.45b0.dev", }, { "library": "confluent-kafka >= 1.8.2, <= 2.3.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.45b0.dev", }, { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.45b0.dev", }, { "library": "elasticsearch >= 2.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.45b0.dev", }, { "library": "falcon >= 1.4.1, < 3.1.2", - "instrumentation": "opentelemetry-instrumentation-falcon==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.45b0.dev", }, { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.45b0.dev", }, { "library": "flask >= 1.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.45b0.dev", }, { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.45b0.dev", }, { "library": "httpx >= 0.18.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.45b0.dev", }, { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.45b0.dev", }, { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.45b0.dev", }, { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.45b0.dev", }, { "library": "mysqlclient < 3", - "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.45b0.dev", }, { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.45b0.dev", }, { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.45b0.dev", }, { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.45b0.dev", }, { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.45b0.dev", }, { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.45b0.dev", }, { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.45b0.dev", }, { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.45b0.dev", }, { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.45b0.dev", }, { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.45b0.dev", }, { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.45b0.dev", }, { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.45b0.dev", }, { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.45b0.dev", }, { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.45b0.dev", }, { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.45b0.dev", }, { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.45b0.dev", }, { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.45b0.dev", }, { "library": "urllib3 >= 1.0.0, < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.44b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.45b0.dev", }, ] default_instrumentations = [ - "opentelemetry-instrumentation-asyncio==0.44b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.44b0.dev", - "opentelemetry-instrumentation-dbapi==0.44b0.dev", - "opentelemetry-instrumentation-logging==0.44b0.dev", - "opentelemetry-instrumentation-sqlite3==0.44b0.dev", - "opentelemetry-instrumentation-urllib==0.44b0.dev", - "opentelemetry-instrumentation-wsgi==0.44b0.dev", + "opentelemetry-instrumentation-asyncio==0.45b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.45b0.dev", + "opentelemetry-instrumentation-dbapi==0.45b0.dev", + "opentelemetry-instrumentation-logging==0.45b0.dev", + "opentelemetry-instrumentation-sqlite3==0.45b0.dev", + "opentelemetry-instrumentation-urllib==0.45b0.dev", + "opentelemetry-instrumentation-wsgi==0.45b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index ff896307c3..2b23bc4994 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py index ff896307c3..2b23bc4994 100644 --- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py +++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py index ff896307c3..2b23bc4994 100644 --- a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py index ff896307c3..2b23bc4994 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.44b0.dev" +__version__ = "0.45b0.dev" From adfb1c763d1562070cd333e8d3cb367aa274f9c9 Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:30:37 +0100 Subject: [PATCH 112/200] Copy change log updates from release/v1.23.x-0.44bx (#2265) --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aea2dc6193..e94fc1d957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1447,3 +1447,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `opentelemetry-ext-wsgi` Initial release - `opentelemetry-ext-http-requests` Initial release + +- Drop support for 3.7 + ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151)) +- `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector + ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) +- `opentelemetry-instrumentation-asyncpg` Allow AsyncPGInstrumentor to be instantiated multiple times +([#1791](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1791)) +- `opentelemetry-instrumentation-confluent-kafka` Add support for higher versions until 2.3.0 of confluent_kafka + ([#2132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2132)) +- `opentelemetry-resource-detector-azure` Changed timeout to 4 seconds due to [timeout bug](https://github.com/open-telemetry/opentelemetry-python/issues/3644) + ([#2136](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2136)) +- `opentelemetry-resource-detector-azure` Suppress instrumentation for `urllib` call + ([#2178](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2178)) +- AwsLambdaInstrumentor handles and re-raises function exception ([#2245](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2245)) + From 1c2171528e8f5566739c271c2eda0f1ae8c773fe Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 23 Feb 2024 10:50:39 -0800 Subject: [PATCH 113/200] Fix various release scripts aspects (#2267) --- .github/workflows/release.yml | 12 ++++++------ RELEASING.md | 4 +++- scripts/build.sh | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3346d64245..f6c267003a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,12 +45,6 @@ jobs: echo "PRIOR_VERSION_WHEN_PATCH=$prior_version_when_patch" >> $GITHUB_ENV - # check out main branch to verify there won't be problems with merging the change log - # at the end of this workflow - - uses: actions/checkout@v3 - with: - ref: main - - run: | if [[ -z $PRIOR_VERSION_WHEN_PATCH ]]; then # not making a patch release @@ -60,6 +54,12 @@ jobs: fi fi + # check out main branch to verify there won't be problems with merging the change log + # at the end of this workflow + - uses: actions/checkout@v3 + with: + ref: main + # back to the release branch - uses: actions/checkout@v3 diff --git a/RELEASING.md b/RELEASING.md index a30838130f..1547cec224 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -7,8 +7,10 @@ * If making a pre-release of stable components (e.g. release candidate), enter the pre-release version number, e.g. `1.9.0rc2`. (otherwise the workflow will pick up the version from `main` and just remove the `.dev` suffix). - * Review and merge the two pull requests that it creates + * Review the two pull requests that it creates. (one is targeted to the release branch and one is targeted to `main`). + * Merge the one targeted towards the release branch. + * The builds will fail for the `main` pr because of validation rules. Follow the [release workflow](https://github.com/open-telemetry/opentelemetry-python/blob/main/RELEASING.md) for the core repo up until this same point. Change the SHAs of each PR to point at each other to get the `main` builds to pass. ## Preparing a new patch release diff --git a/scripts/build.sh b/scripts/build.sh index e0c439c32e..fa490a6a35 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -32,16 +32,16 @@ DISTDIR=dist cd $DISTDIR for x in * ; do # FIXME: Remove this logic once these packages are available in Pypi - if (echo "$x" | grep -Eq ^opentelemetry_(instrumentation_aiohttp_server|resource_detector_container).*(\.tar\.gz|\.whl)$); then + if echo "$x" | grep -Eq "^opentelemetry_(instrumentation_aiohttp_server|resource_detector_container).*(\.tar\.gz|\.whl)$"; then echo "Skipping $x because of erroneous uploads. See: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2053" rm $x # FIXME: Remove this once opentelemetry-resource-detector-azure package goes 1.X - elif (echo "$x" | grep -Eq ^opentelemetry_resource_detector_azure.*(\.tar\.gz|\.whl)$); then + elif echo "$x" | grep -Eq "^opentelemetry_resource_detector_azure.*(\.tar\.gz|\.whl)$"; then echo "Skipping $x because of manual upload by Azure maintainers." rm $x # NOTE: We filter beta vs 1.0 package at this point because we can read the # version directly from the .tar.gz/whl file - elif (echo "$x" | grep -Eq ^opentelemetry_.*-0\..*(\.tar\.gz|\.whl)$); then + elif echo "$x" | grep -Eq "^opentelemetry_.*-0\..*(\.tar\.gz|\.whl)$"; then : else echo "Skipping $x because it is not in pre-1.0 state and should be released using a tag." From 8daa8ad48108775d8e799a3abc3ed06f84b4c00e Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Sat, 24 Feb 2024 16:35:25 -0300 Subject: [PATCH 114/200] Add instrumentation for Psycopg 3.x (#2123) * Add instrumentation for Psycopg 3.x * Add federicobond to component_owners.yml --- .github/component_owners.yml | 3 + .github/workflows/instrumentations_1.yml | 1 + CHANGELOG.md | 4 + docs-requirements.txt | 1 + docs/instrumentation/psycopg/psycopg.rst | 7 + docs/instrumentation/psycopg2/psycopg2.rst | 4 +- instrumentation/README.md | 1 + .../LICENSE | 201 +++++++++++++ .../README.rst | 21 ++ .../pyproject.toml | 58 ++++ .../instrumentation/psycopg/__init__.py | 261 +++++++++++++++++ .../instrumentation/psycopg/package.py | 16 ++ .../instrumentation/psycopg/version.py | 15 + .../tests/__init__.py | 0 .../tests/test_psycopg_integration.py | 271 ++++++++++++++++++ .../pyproject.toml | 1 + .../instrumentation/bootstrap_gen.py | 4 + tox.ini | 10 + 18 files changed, 877 insertions(+), 2 deletions(-) create mode 100644 docs/instrumentation/psycopg/psycopg.rst create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/LICENSE create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/README.rst create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/package.py create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/tests/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py diff --git a/.github/component_owners.yml b/.github/component_owners.yml index 3e8459ec59..ab14a41aec 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -70,3 +70,6 @@ components: instrumentation/opentelemetry-instrumentation-asyncio: - bourbonkk + + instrumentation/opentelemetry-instrumentation-psycopg: + - federicobond diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index b5f3a01835..0640c056a6 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -29,6 +29,7 @@ jobs: - "wsgi" - "distro" - "richconsole" + - "psycopg" - "prometheus-remote-write" - "sdkextension-aws" - "propagator-aws-xray" diff --git a/CHANGELOG.md b/CHANGELOG.md index e94fc1d957..8619b3df00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2178](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2178)) - AwsLambdaInstrumentor handles and re-raises function exception ([#2245](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2245)) +### Added + +- `opentelemetry-instrumentation-psycopg` Initial release for psycopg 3.x + ## Version 1.22.0/0.43b0 (2023-12-14) ### Added diff --git a/docs-requirements.txt b/docs-requirements.txt index b3f2998862..aff449fcf8 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -36,6 +36,7 @@ kafka-python>=2.0,<3.0 mysql-connector-python~=8.0 mysqlclient~=2.1.1 psutil>=5 +psycopg~=3.1.17 pika>=0.12.0 pymongo~=3.1 PyMySQL~=0.9.3 diff --git a/docs/instrumentation/psycopg/psycopg.rst b/docs/instrumentation/psycopg/psycopg.rst new file mode 100644 index 0000000000..3ba7556359 --- /dev/null +++ b/docs/instrumentation/psycopg/psycopg.rst @@ -0,0 +1,7 @@ +OpenTelemetry Psycopg Instrumentation +===================================== + +.. automodule:: opentelemetry.instrumentation.psycopg + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/instrumentation/psycopg2/psycopg2.rst b/docs/instrumentation/psycopg2/psycopg2.rst index 69be31b2d1..0ae76580c0 100644 --- a/docs/instrumentation/psycopg2/psycopg2.rst +++ b/docs/instrumentation/psycopg2/psycopg2.rst @@ -1,5 +1,5 @@ -OpenTelemetry Psycopg Instrumentation -===================================== +OpenTelemetry Psycopg2 Instrumentation +====================================== .. automodule:: opentelemetry.instrumentation.psycopg2 :members: diff --git a/instrumentation/README.md b/instrumentation/README.md index d5e201b135..0cce7e5de7 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -29,6 +29,7 @@ | [opentelemetry-instrumentation-mysql](./opentelemetry-instrumentation-mysql) | mysql-connector-python ~= 8.0 | No | [opentelemetry-instrumentation-mysqlclient](./opentelemetry-instrumentation-mysqlclient) | mysqlclient < 3 | No | [opentelemetry-instrumentation-pika](./opentelemetry-instrumentation-pika) | pika >= 0.12.0 | No +| [opentelemetry-instrumentation-psycopg](./opentelemetry-instrumentation-psycopg) | psycopg >= 3.1.0 | No | [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 | No | [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache >= 1.3.5, < 5 | No | [opentelemetry-instrumentation-pymongo](./opentelemetry-instrumentation-pymongo) | pymongo >= 3.1, < 5.0 | No diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/LICENSE b/instrumentation/opentelemetry-instrumentation-psycopg/LICENSE new file mode 100644 index 0000000000..1ef7dad2c5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + 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. diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/README.rst b/instrumentation/opentelemetry-instrumentation-psycopg/README.rst new file mode 100644 index 0000000000..7feb4dc36a --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/README.rst @@ -0,0 +1,21 @@ +OpenTelemetry Psycopg Instrumentation +===================================== + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-psycopg.svg + :target: https://pypi.org/project/opentelemetry-instrumentation-psycopg/ + +Installation +------------ + +:: + + pip install opentelemetry-instrumentation-psycopg + + +References +---------- +* `OpenTelemetry Psycopg Instrumentation `_ +* `OpenTelemetry Project `_ +* `OpenTelemetry Python Examples `_ diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml new file mode 100644 index 0000000000..a5a4da0b59 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-instrumentation-psycopg" +dynamic = ["version"] +description = "OpenTelemetry psycopg instrumentation" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.7" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "opentelemetry-api ~= 1.12", + "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation-dbapi == 0.45b0.dev", +] + +[project.optional-dependencies] +instruments = [ + "psycopg >= 3.1.0", +] +test = [ + "opentelemetry-instrumentation-psycopg[instruments]", + "opentelemetry-test-utils == 0.45b0.dev", +] + +[project.entry-points.opentelemetry_instrumentor] +psycopg = "opentelemetry.instrumentation.psycopg:PsycopgInstrumentor" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-psycopg" + +[tool.hatch.version] +path = "src/opentelemetry/instrumentation/psycopg/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py new file mode 100644 index 0000000000..ab473c2fe4 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py @@ -0,0 +1,261 @@ +# 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. + +""" +The integration with PostgreSQL supports the `Psycopg`_ library, it can be enabled by +using ``PsycopgInstrumentor``. + +.. _Psycopg: http://initd.org/psycopg/ + +SQLCOMMENTER +***************************************** +You can optionally configure Psycopg instrumentation to enable sqlcommenter which enriches +the query with contextual information. + +Usage +----- + +.. code:: python + + from opentelemetry.instrumentation.psycopg import PsycopgInstrumentor + + PsycopgInstrumentor().instrument(enable_commenter=True, commenter_options={}) + + +For example, +:: + + Invoking cursor.execute("select * from auth_users") will lead to sql query "select * from auth_users" but when SQLCommenter is enabled + the query will get appended with some configurable tags like "select * from auth_users /*tag=value*/;" + + +SQLCommenter Configurations +*************************** +We can configure the tags to be appended to the sqlquery log by adding configuration inside commenter_options(default:{}) keyword + +db_driver = True(Default) or False + +For example, +:: +Enabling this flag will add psycopg and it's version which is /*psycopg%%3A2.9.3*/ + +dbapi_threadsafety = True(Default) or False + +For example, +:: +Enabling this flag will add threadsafety /*dbapi_threadsafety=2*/ + +dbapi_level = True(Default) or False + +For example, +:: +Enabling this flag will add dbapi_level /*dbapi_level='2.0'*/ + +libpq_version = True(Default) or False + +For example, +:: +Enabling this flag will add libpq_version /*libpq_version=140001*/ + +driver_paramstyle = True(Default) or False + +For example, +:: +Enabling this flag will add driver_paramstyle /*driver_paramstyle='pyformat'*/ + +opentelemetry_values = True(Default) or False + +For example, +:: +Enabling this flag will add traceparent values /*traceparent='00-03afa25236b8cd948fa853d67038ac79-405ff022e8247c46-01'*/ + +Usage +----- + +.. code-block:: python + + import psycopg + from opentelemetry.instrumentation.psycopg import PsycopgInstrumentor + + + PsycopgInstrumentor().instrument() + + cnx = psycopg.connect(database='Database') + cursor = cnx.cursor() + cursor.execute("INSERT INTO test (testField) VALUES (123)") + cursor.close() + cnx.close() + +API +--- +""" + +import logging +import typing +from typing import Collection + +import psycopg +from psycopg import Cursor as pg_cursor # pylint: disable=no-name-in-module +from psycopg.sql import Composed # pylint: disable=no-name-in-module + +from opentelemetry.instrumentation import dbapi +from opentelemetry.instrumentation.instrumentor import BaseInstrumentor +from opentelemetry.instrumentation.psycopg.package import _instruments +from opentelemetry.instrumentation.psycopg.version import __version__ + +_logger = logging.getLogger(__name__) +_OTEL_CURSOR_FACTORY_KEY = "_otel_orig_cursor_factory" + + +class PsycopgInstrumentor(BaseInstrumentor): + _CONNECTION_ATTRIBUTES = { + "database": "info.dbname", + "port": "info.port", + "host": "info.host", + "user": "info.user", + } + + _DATABASE_SYSTEM = "postgresql" + + def instrumentation_dependencies(self) -> Collection[str]: + return _instruments + + def _instrument(self, **kwargs): + """Integrate with PostgreSQL Psycopg library. + Psycopg: http://initd.org/psycopg/ + """ + tracer_provider = kwargs.get("tracer_provider") + enable_sqlcommenter = kwargs.get("enable_commenter", False) + commenter_options = kwargs.get("commenter_options", {}) + dbapi.wrap_connect( + __name__, + psycopg, + "connect", + self._DATABASE_SYSTEM, + self._CONNECTION_ATTRIBUTES, + version=__version__, + tracer_provider=tracer_provider, + db_api_integration_factory=DatabaseApiIntegration, + enable_commenter=enable_sqlcommenter, + commenter_options=commenter_options, + ) + + def _uninstrument(self, **kwargs): + """ "Disable Psycopg instrumentation""" + dbapi.unwrap_connect(psycopg, "connect") + + # TODO(owais): check if core dbapi can do this for all dbapi implementations e.g, pymysql and mysql + @staticmethod + def instrument_connection(connection, tracer_provider=None): + if not hasattr(connection, "_is_instrumented_by_opentelemetry"): + connection._is_instrumented_by_opentelemetry = False + + if not connection._is_instrumented_by_opentelemetry: + setattr( + connection, _OTEL_CURSOR_FACTORY_KEY, connection.cursor_factory + ) + connection.cursor_factory = _new_cursor_factory( + tracer_provider=tracer_provider + ) + connection._is_instrumented_by_opentelemetry = True + else: + _logger.warning( + "Attempting to instrument Psycopg connection while already instrumented" + ) + return connection + + # TODO(owais): check if core dbapi can do this for all dbapi implementations e.g, pymysql and mysql + @staticmethod + def uninstrument_connection(connection): + connection.cursor_factory = getattr( + connection, _OTEL_CURSOR_FACTORY_KEY, None + ) + + return connection + + +# TODO(owais): check if core dbapi can do this for all dbapi implementations e.g, pymysql and mysql +class DatabaseApiIntegration(dbapi.DatabaseApiIntegration): + def wrapped_connection( + self, + connect_method: typing.Callable[..., typing.Any], + args: typing.Tuple[typing.Any, typing.Any], + kwargs: typing.Dict[typing.Any, typing.Any], + ): + """Add object proxy to connection object.""" + base_cursor_factory = kwargs.pop("cursor_factory", None) + new_factory_kwargs = {"db_api": self} + if base_cursor_factory: + new_factory_kwargs["base_factory"] = base_cursor_factory + kwargs["cursor_factory"] = _new_cursor_factory(**new_factory_kwargs) + connection = connect_method(*args, **kwargs) + self.get_connection_attributes(connection) + return connection + + +class CursorTracer(dbapi.CursorTracer): + def get_operation_name(self, cursor, args): + if not args: + return "" + + statement = args[0] + if isinstance(statement, Composed): + statement = statement.as_string(cursor) + + if isinstance(statement, str): + # Strip leading comments so we get the operation name. + return self._leading_comment_remover.sub("", statement).split()[0] + + return "" + + def get_statement(self, cursor, args): + if not args: + return "" + + statement = args[0] + if isinstance(statement, Composed): + statement = statement.as_string(cursor) + return statement + + +def _new_cursor_factory(db_api=None, base_factory=None, tracer_provider=None): + if not db_api: + db_api = DatabaseApiIntegration( + __name__, + PsycopgInstrumentor._DATABASE_SYSTEM, + connection_attributes=PsycopgInstrumentor._CONNECTION_ATTRIBUTES, + version=__version__, + tracer_provider=tracer_provider, + ) + + base_factory = base_factory or pg_cursor + _cursor_tracer = CursorTracer(db_api) + + class TracedCursorFactory(base_factory): + def execute(self, *args, **kwargs): + return _cursor_tracer.traced_execution( + self, super().execute, *args, **kwargs + ) + + def executemany(self, *args, **kwargs): + return _cursor_tracer.traced_execution( + self, super().executemany, *args, **kwargs + ) + + def callproc(self, *args, **kwargs): + return _cursor_tracer.traced_execution( + self, super().callproc, *args, **kwargs + ) + + return TracedCursorFactory diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/package.py b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/package.py new file mode 100644 index 0000000000..635edfb4db --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/package.py @@ -0,0 +1,16 @@ +# 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. + + +_instruments = ("psycopg >= 3.1.0",) diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py new file mode 100644 index 0000000000..2b23bc4994 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py @@ -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.45b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-psycopg/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py new file mode 100644 index 0000000000..d5e4bc65f3 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py @@ -0,0 +1,271 @@ +# 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. + +import types +from unittest import mock + +import psycopg + +import opentelemetry.instrumentation.psycopg +from opentelemetry.instrumentation.psycopg import PsycopgInstrumentor +from opentelemetry.sdk import resources +from opentelemetry.test.test_base import TestBase + + +class MockCursor: + execute = mock.MagicMock(spec=types.MethodType) + execute.__name__ = "execute" + + executemany = mock.MagicMock(spec=types.MethodType) + executemany.__name__ = "executemany" + + callproc = mock.MagicMock(spec=types.MethodType) + callproc.__name__ = "callproc" + + rowcount = "SomeRowCount" + + def __init__(self, *args, **kwargs): + pass + + def __enter__(self): + return self + + def __exit__(self, *args): + return self + + +class MockConnection: + commit = mock.MagicMock(spec=types.MethodType) + commit.__name__ = "commit" + + rollback = mock.MagicMock(spec=types.MethodType) + rollback.__name__ = "rollback" + + def __init__(self, *args, **kwargs): + self.cursor_factory = kwargs.pop("cursor_factory", None) + + def cursor(self): + if self.cursor_factory: + return self.cursor_factory(self) + return MockCursor() + + def get_dsn_parameters(self): # pylint: disable=no-self-use + return {"dbname": "test"} + + +class TestPostgresqlIntegration(TestBase): + def setUp(self): + super().setUp() + self.cursor_mock = mock.patch( + "opentelemetry.instrumentation.psycopg.pg_cursor", MockCursor + ) + self.connection_mock = mock.patch("psycopg.connect", MockConnection) + + self.cursor_mock.start() + self.connection_mock.start() + + def tearDown(self): + super().tearDown() + self.memory_exporter.clear() + self.cursor_mock.stop() + self.connection_mock.stop() + with self.disable_logging(): + PsycopgInstrumentor().uninstrument() + + # pylint: disable=unused-argument + def test_instrumentor(self): + PsycopgInstrumentor().instrument() + + cnx = psycopg.connect(database="test") + + cursor = cnx.cursor() + + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.psycopg + ) + + # check that no spans are generated after uninstrument + PsycopgInstrumentor().uninstrument() + + cnx = psycopg.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + def test_span_name(self): + PsycopgInstrumentor().instrument() + + cnx = psycopg.connect(database="test") + + cursor = cnx.cursor() + + cursor.execute("Test query", ("param1Value", False)) + cursor.execute( + """multi + line + query""" + ) + cursor.execute("tab\tseparated query") + cursor.execute("/* leading comment */ query") + cursor.execute("/* leading comment */ query /* trailing comment */") + cursor.execute("query /* trailing comment */") + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 6) + self.assertEqual(spans_list[0].name, "Test") + self.assertEqual(spans_list[1].name, "multi") + self.assertEqual(spans_list[2].name, "tab") + self.assertEqual(spans_list[3].name, "query") + self.assertEqual(spans_list[4].name, "query") + self.assertEqual(spans_list[5].name, "query") + + # pylint: disable=unused-argument + def test_not_recording(self): + mock_tracer = mock.Mock() + mock_span = mock.Mock() + mock_span.is_recording.return_value = False + mock_tracer.start_span.return_value = mock_span + PsycopgInstrumentor().instrument() + with mock.patch("opentelemetry.trace.get_tracer") as tracer: + tracer.return_value = mock_tracer + cnx = psycopg.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + self.assertFalse(mock_span.is_recording()) + self.assertTrue(mock_span.is_recording.called) + self.assertFalse(mock_span.set_attribute.called) + self.assertFalse(mock_span.set_status.called) + + PsycopgInstrumentor().uninstrument() + + # pylint: disable=unused-argument + def test_custom_tracer_provider(self): + resource = resources.Resource.create({}) + result = self.create_tracer_provider(resource=resource) + tracer_provider, exporter = result + + PsycopgInstrumentor().instrument(tracer_provider=tracer_provider) + + cnx = psycopg.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + self.assertIs(span.resource, resource) + + # pylint: disable=unused-argument + def test_instrument_connection(self): + cnx = psycopg.connect(database="test") + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 0) + + cnx = PsycopgInstrumentor().instrument_connection(cnx) + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + # pylint: disable=unused-argument + def test_instrument_connection_with_instrument(self): + cnx = psycopg.connect(database="test") + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 0) + + PsycopgInstrumentor().instrument() + cnx = PsycopgInstrumentor().instrument_connection(cnx) + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + # pylint: disable=unused-argument + def test_uninstrument_connection_with_instrument(self): + PsycopgInstrumentor().instrument() + cnx = psycopg.connect(database="test") + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + cnx = PsycopgInstrumentor().uninstrument_connection(cnx) + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + # pylint: disable=unused-argument + def test_uninstrument_connection_with_instrument_connection(self): + cnx = psycopg.connect(database="test") + PsycopgInstrumentor().instrument_connection(cnx) + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + cnx = PsycopgInstrumentor().uninstrument_connection(cnx) + cursor = cnx.cursor() + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + @mock.patch("opentelemetry.instrumentation.dbapi.wrap_connect") + def test_sqlcommenter_enabled(self, event_mocked): + cnx = psycopg.connect(database="test") + PsycopgInstrumentor().instrument(enable_commenter=True) + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + kwargs = event_mocked.call_args[1] + self.assertEqual(kwargs["enable_commenter"], True) + + @mock.patch("opentelemetry.instrumentation.dbapi.wrap_connect") + def test_sqlcommenter_disabled(self, event_mocked): + cnx = psycopg.connect(database="test") + PsycopgInstrumentor().instrument() + query = "SELECT * FROM test" + cursor = cnx.cursor() + cursor.execute(query) + kwargs = event_mocked.call_args[1] + self.assertEqual(kwargs["enable_commenter"], False) diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 794906793b..2ed7ccec87 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -56,6 +56,7 @@ dependencies = [ "opentelemetry-instrumentation-mysql==0.45b0.dev", "opentelemetry-instrumentation-mysqlclient==0.45b0.dev", "opentelemetry-instrumentation-pika==0.45b0.dev", + "opentelemetry-instrumentation-psycopg==0.45b0.dev", "opentelemetry-instrumentation-psycopg2==0.45b0.dev", "opentelemetry-instrumentation-pymemcache==0.45b0.dev", "opentelemetry-instrumentation-pymongo==0.45b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 169b9b9b89..3591581c97 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -116,6 +116,10 @@ "library": "pika >= 0.12.0", "instrumentation": "opentelemetry-instrumentation-pika==0.45b0.dev", }, + { + "library": "psycopg >= 3.1.0", + "instrumentation": "opentelemetry-instrumentation-psycopg==0.45b0.dev", + }, { "library": "psycopg2 >= 2.7.3.1", "instrumentation": "opentelemetry-instrumentation-psycopg2==0.45b0.dev", diff --git a/tox.ini b/tox.ini index 74f785974d..820ac93816 100644 --- a/tox.ini +++ b/tox.ini @@ -131,6 +131,10 @@ envlist = py3{8,9,10,11}-test-instrumentation-psycopg2 ; ext-psycopg2 intentionally excluded from pypy3 + ; opentelemetry-instrumentation-psycopg + py3{7,8,9,10,11}-test-instrumentation-psycopg + pypy3-test-instrumentation-psycopg + ; opentelemetry-instrumentation-pymemcache py3{8,9,10,11}-test-instrumentation-pymemcache-{135,200,300,342,400} pypy3-test-instrumentation-pymemcache-{135,200,300,342,400} @@ -335,6 +339,7 @@ changedir = test-instrumentation-mysqlclient: instrumentation/opentelemetry-instrumentation-mysqlclient/tests test-instrumentation-sio-pika-{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests test-instrumentation-aio-pika-{8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests + test-instrumentation-psycopg: instrumentation/opentelemetry-instrumentation-psycopg/tests test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests test-instrumentation-pymemcache-{135,200,300,342,400}: instrumentation/opentelemetry-instrumentation-pymemcache/tests test-instrumentation-pymongo: instrumentation/opentelemetry-instrumentation-pymongo/tests @@ -425,6 +430,8 @@ commands_pre = pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] + psycopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] + psycopg2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] pymysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] @@ -555,6 +562,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] + python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] @@ -602,6 +610,7 @@ deps = # prerequisite: install libpq-dev (debian) or postgresql-devel (rhel), postgresql (mac) # see https://www.psycopg.org/docs/install.html#build-prerequisites # you might have to install additional packages depending on your OS + psycopg ~= 3.1.17 psycopg2 ~= 2.9.5 aiopg >= 0.13.0, < 1.3.0 sqlalchemy ~= 1.4 @@ -633,6 +642,7 @@ commands_pre = -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient \ + -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2 \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo \ -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql \ From 46a8c59e03b70dc258c0bb1d66d597b276e136a2 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 4 Mar 2024 11:19:46 -0600 Subject: [PATCH 115/200] Refactor use of changedir in tox.ini (#2332) Fixes #3745 --- tox.ini | 115 +++++++++++++++++++++++++++----------------------------- 1 file changed, 56 insertions(+), 59 deletions(-) diff --git a/tox.ini b/tox.ini index 820ac93816..7b7b2a0710 100644 --- a/tox.ini +++ b/tox.ini @@ -308,64 +308,6 @@ setenv = CORE_REPO_SHA={env:CORE_REPO_SHA:main} CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA} -changedir = - test-distro: opentelemetry-distro/tests - test-opentelemetry-instrumentation: opentelemetry-instrumentation/tests - test-instrumentation-aiohttp-client: instrumentation/opentelemetry-instrumentation-aiohttp-client/tests - test-instrumentation-aiohttp-server: instrumentation/opentelemetry-instrumentation-aiohttp-server/tests - test-instrumentation-aiopg: instrumentation/opentelemetry-instrumentation-aiopg/tests - test-instrumentation-asgi: instrumentation/opentelemetry-instrumentation-asgi/tests - test-instrumentation-asyncpg: instrumentation/opentelemetry-instrumentation-asyncpg/tests - test-instrumentation-aws-lambda: instrumentation/opentelemetry-instrumentation-aws-lambda/tests - test-instrumentation-boto: instrumentation/opentelemetry-instrumentation-boto/tests - test-instrumentation-botocore: instrumentation/opentelemetry-instrumentation-botocore/tests - test-instrumentation-boto3sqs: instrumentation/opentelemetry-instrumentation-boto3sqs/tests - test-instrumentation-cassandra: instrumentation/opentelemetry-instrumentation-cassandra/tests - test-instrumentation-celery: instrumentation/opentelemetry-instrumentation-celery/tests - test-instrumentation-dbapi: instrumentation/opentelemetry-instrumentation-dbapi/tests - test-instrumentation-django-{1,2,3,4}: instrumentation/opentelemetry-instrumentation-django/tests - test-instrumentation-elasticsearch-{2,5,6}: instrumentation/opentelemetry-instrumentation-elasticsearch/tests - test-instrumentation-falcon-{1,2,3}: instrumentation/opentelemetry-instrumentation-falcon/tests - test-instrumentation-fastapi: instrumentation/opentelemetry-instrumentation-fastapi/tests - test-instrumentation-flask-{213,220,300}: instrumentation/opentelemetry-instrumentation-flask/tests - test-instrumentation-urllib: instrumentation/opentelemetry-instrumentation-urllib/tests - test-instrumentation-urllib3v-{1,2}: instrumentation/opentelemetry-instrumentation-urllib3/tests - test-instrumentation-grpc: instrumentation/opentelemetry-instrumentation-grpc/tests - test-instrumentation-jinja2: instrumentation/opentelemetry-instrumentation-jinja2/tests - test-instrumentation-kafka-python: instrumentation/opentelemetry-instrumentation-kafka-python/tests - test-instrumentation-confluent-kafka: instrumentation/opentelemetry-instrumentation-confluent-kafka/tests - test-instrumentation-logging: instrumentation/opentelemetry-instrumentation-logging/tests - test-instrumentation-mysql: instrumentation/opentelemetry-instrumentation-mysql/tests - test-instrumentation-mysqlclient: instrumentation/opentelemetry-instrumentation-mysqlclient/tests - test-instrumentation-sio-pika-{0,1}: instrumentation/opentelemetry-instrumentation-pika/tests - test-instrumentation-aio-pika-{8,9}: instrumentation/opentelemetry-instrumentation-aio-pika/tests - test-instrumentation-psycopg: instrumentation/opentelemetry-instrumentation-psycopg/tests - test-instrumentation-psycopg2: instrumentation/opentelemetry-instrumentation-psycopg2/tests - test-instrumentation-pymemcache-{135,200,300,342,400}: instrumentation/opentelemetry-instrumentation-pymemcache/tests - test-instrumentation-pymongo: instrumentation/opentelemetry-instrumentation-pymongo/tests - test-instrumentation-pymysql: instrumentation/opentelemetry-instrumentation-pymysql/tests - test-instrumentation-pyramid: instrumentation/opentelemetry-instrumentation-pyramid/tests - test-instrumentation-redis: instrumentation/opentelemetry-instrumentation-redis/tests - test-instrumentation-remoulade: instrumentation/opentelemetry-instrumentation-remoulade/tests - test-instrumentation-requests: instrumentation/opentelemetry-instrumentation-requests/tests - test-instrumentation-sklearn: instrumentation/opentelemetry-instrumentation-sklearn/tests - test-instrumentation-sqlalchemy-{11,14}: instrumentation/opentelemetry-instrumentation-sqlalchemy/tests - test-instrumentation-sqlite3: instrumentation/opentelemetry-instrumentation-sqlite3/tests - test-instrumentation-starlette: instrumentation/opentelemetry-instrumentation-starlette/tests - test-instrumentation-system-metrics: instrumentation/opentelemetry-instrumentation-system-metrics/tests - test-instrumentation-tornado: instrumentation/opentelemetry-instrumentation-tornado/tests - test-instrumentation-tortoiseorm: instrumentation/opentelemetry-instrumentation-tortoiseorm/tests - test-instrumentation-wsgi: instrumentation/opentelemetry-instrumentation-wsgi/tests - test-instrumentation-httpx-{18,21}: instrumentation/opentelemetry-instrumentation-httpx/tests - test-instrumentation-asyncio: instrumentation/opentelemetry-instrumentation-asyncio/tests - test-util-http: util/opentelemetry-util-http/tests - test-sdkextension-aws: sdk-extension/opentelemetry-sdk-extension-aws/tests - test-resource-detector-container: resource/opentelemetry-resource-detector-container/tests - test-propagator-aws: propagator/opentelemetry-propagator-aws-xray/tests - test-propagator-ot-trace: propagator/opentelemetry-propagator-ot-trace/tests - test-exporter-richconsole: exporter/opentelemetry-exporter-richconsole/tests - test-exporter-prometheus-remote-write: exporter/opentelemetry-exporter-prometheus-remote-write/tests - commands_pre = ; Install without -e to test the actual installation py3{8,9,10,11}: python -m pip install -U pip setuptools wheel @@ -494,7 +436,62 @@ commands_pre = coverage: python {toxinidir}/scripts/eachdist.py install --editable commands = - test: pytest {posargs} + test-distro: pytest {toxinidir}/opentelemetry-distro/tests {posargs} + test-opentelemetry-instrumentation: pytest {toxinidir}/opentelemetry-instrumentation/tests {posargs} + test-instrumentation-aiohttp-client: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/tests {posargs} + test-instrumentation-aiohttp-server: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/tests {posargs} + test-instrumentation-aiopg: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/tests {posargs} + test-instrumentation-asgi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/tests {posargs} + test-instrumentation-asyncpg: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/tests {posargs} + test-instrumentation-aws-lambda: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/tests {posargs} + test-instrumentation-boto: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/tests {posargs} + test-instrumentation-botocore: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/tests {posargs} + test-instrumentation-boto3sqs: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs/tests {posargs} + test-instrumentation-cassandra: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/tests {posargs} + test-instrumentation-celery: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/tests {posargs} + test-instrumentation-dbapi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/tests {posargs} + test-instrumentation-django-{1,2,3,4}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-django/tests {posargs} + test-instrumentation-elasticsearch-{2,5,6}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/tests {posargs} + test-instrumentation-falcon-{1,2,3}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/tests {posargs} + test-instrumentation-fastapi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/tests {posargs} + test-instrumentation-flask-{213,220,300}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/tests {posargs} + test-instrumentation-urllib: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/tests {posargs} + test-instrumentation-urllib3v-{1,2}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/tests {posargs} + test-instrumentation-grpc: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/tests {posargs} + test-instrumentation-jinja2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/tests {posargs} + test-instrumentation-kafka-python: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/tests {posargs} + test-instrumentation-confluent-kafka: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka/tests {posargs} + test-instrumentation-logging: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/tests {posargs} + test-instrumentation-mysql: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/tests {posargs} + test-instrumentation-mysqlclient: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/tests {posargs} + test-instrumentation-sio-pika-{0,1}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/tests {posargs} + test-instrumentation-aio-pika-{8,9}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/tests {posargs} + test-instrumentation-psycopg: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/tests {posargs} + test-instrumentation-psycopg2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/tests {posargs} + test-instrumentation-pymemcache-{135,200,300,342,400}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/tests {posargs} + test-instrumentation-pymongo: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/tests {posargs} + test-instrumentation-pymysql: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql/tests {posargs} + test-instrumentation-pyramid: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/tests {posargs} + test-instrumentation-redis: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/tests {posargs} + test-instrumentation-remoulade: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade/tests {posargs} + test-instrumentation-requests: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/tests {posargs} + test-instrumentation-sklearn: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn/tests {posargs} + test-instrumentation-sqlalchemy-{11,14}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests {posargs} + test-instrumentation-sqlite3: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/tests {posargs} + test-instrumentation-starlette: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/tests {posargs} + test-instrumentation-system-metrics: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/tests {posargs} + test-instrumentation-tornado: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/tests {posargs} + test-instrumentation-tortoiseorm: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/tests {posargs} + test-instrumentation-wsgi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/tests {posargs} + test-instrumentation-httpx-{18,21}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/tests {posargs} + test-instrumentation-asyncio: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/tests {posargs} + test-util-http: pytest {toxinidir}/util/opentelemetry-util-http/tests {posargs} + test-sdkextension-aws: pytest {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/tests {posargs} + test-resource-detector-container: pytest {toxinidir}/resource/opentelemetry-resource-detector-container/tests {posargs} + test-propagator-aws: pytest {toxinidir}/propagator/opentelemetry-propagator-aws-xray/tests {posargs} + test-propagator-ot-trace: pytest {toxinidir}/propagator/opentelemetry-propagator-ot-trace/tests {posargs} + test-exporter-richconsole: pytest {toxinidir}/exporter/opentelemetry-exporter-richconsole/tests {posargs} + test-exporter-prometheus-remote-write: pytest {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write/tests {posargs} coverage: {toxinidir}/scripts/coverage.sh [testenv:docs] From 2e746198bfedca9c50d61745311d31008dc22081 Mon Sep 17 00:00:00 2001 From: Filip Nikolovski Date: Thu, 7 Mar 2024 18:33:28 +0100 Subject: [PATCH 116/200] Align gRPC server span status codes to OTEL specs (#2019) --- CHANGELOG.md | 3 + .../instrumentation/grpc/_aio_server.py | 26 ++---- .../instrumentation/grpc/_server.py | 27 ++----- .../instrumentation/grpc/_utilities.py | 22 ++++++ .../tests/test_aio_server_interceptor.py | 19 ++--- .../tests/test_server_interceptor.py | 79 +++++++++++++++---- 6 files changed, 108 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8619b3df00..e841a0bdc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed +- Align gRPC span status codes to OTEL specification ([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756)) + ## Version 1.23.0/0.44b0 (2024-02-23) - Drop support for 3.7 diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py index 0db4c36edf..ba255ef3bf 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_aio_server.py @@ -17,9 +17,9 @@ import wrapt from opentelemetry.semconv.trace import SpanAttributes -from opentelemetry.trace.status import Status, StatusCode from ._server import OpenTelemetryServerInterceptor, _wrap_rpc_behavior +from ._utilities import _server_status # pylint:disable=abstract-method @@ -36,12 +36,8 @@ async def abort(self, code, details="", trailing_metadata=tuple()): self._self_active_span.set_attribute( SpanAttributes.RPC_GRPC_STATUS_CODE, code.value[0] ) - self._self_active_span.set_status( - Status( - status_code=StatusCode.ERROR, - description=f"{code}:{details}", - ) - ) + status = _server_status(code, details) + self._self_active_span.set_status(status) return await self.__wrapped__.abort(code, details, trailing_metadata) def set_code(self, code): @@ -51,23 +47,15 @@ def set_code(self, code): SpanAttributes.RPC_GRPC_STATUS_CODE, code.value[0] ) if code != grpc.StatusCode.OK: - self._self_active_span.set_status( - Status( - status_code=StatusCode.ERROR, - description=f"{code}:{details}", - ) - ) + status = _server_status(code, details) + self._self_active_span.set_status(status) return self.__wrapped__.set_code(code) def set_details(self, details): self._self_details = details if self._self_code != grpc.StatusCode.OK: - self._self_active_span.set_status( - Status( - status_code=StatusCode.ERROR, - description=f"{self._self_code}:{details}", - ) - ) + status = _server_status(self._self_code, details) + self._self_active_span.set_status(status) return self.__wrapped__.set_details(details) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py index 9b66110574..71697ef8bc 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py @@ -31,7 +31,8 @@ from opentelemetry.context import attach, detach from opentelemetry.propagate import extract from opentelemetry.semconv.trace import SpanAttributes -from opentelemetry.trace.status import Status, StatusCode + +from ._utilities import _server_status logger = logging.getLogger(__name__) @@ -124,12 +125,8 @@ def abort(self, code, details): self._active_span.set_attribute( SpanAttributes.RPC_GRPC_STATUS_CODE, code.value[0] ) - self._active_span.set_status( - Status( - status_code=StatusCode.ERROR, - description=f"{code}:{details}", - ) - ) + status = _server_status(code, details) + self._active_span.set_status(status) return self._servicer_context.abort(code, details) def abort_with_status(self, status): @@ -158,23 +155,15 @@ def set_code(self, code): SpanAttributes.RPC_GRPC_STATUS_CODE, code.value[0] ) if code != grpc.StatusCode.OK: - self._active_span.set_status( - Status( - status_code=StatusCode.ERROR, - description=f"{code}:{details}", - ) - ) + status = _server_status(code, details) + self._active_span.set_status(status) return self._servicer_context.set_code(code) def set_details(self, details): self._details = details if self._code != grpc.StatusCode.OK: - self._active_span.set_status( - Status( - status_code=StatusCode.ERROR, - description=f"{self._code}:{details}", - ) - ) + status = _server_status(self._code, details) + self._active_span.set_status(status) return self._servicer_context.set_details(details) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_utilities.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_utilities.py index b6ff7d311a..8a6365b742 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_utilities.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_utilities.py @@ -14,6 +14,10 @@ """Internal utilities.""" +import grpc + +from opentelemetry.trace.status import Status, StatusCode + class RpcInfo: def __init__( @@ -31,3 +35,21 @@ def __init__( self.request = request self.response = response self.error = error + + +def _server_status(code, details): + error_status = Status( + status_code=StatusCode.ERROR, description=f"{code}:{details}" + ) + status_codes = { + grpc.StatusCode.UNKNOWN: error_status, + grpc.StatusCode.DEADLINE_EXCEEDED: error_status, + grpc.StatusCode.UNIMPLEMENTED: error_status, + grpc.StatusCode.INTERNAL: error_status, + grpc.StatusCode.UNAVAILABLE: error_status, + grpc.StatusCode.DATA_LOSS: error_status, + } + + return status_codes.get( + code, Status(status_code=StatusCode.UNSET, description="") + ) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py index 242295c08c..7b31b085de 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_server_interceptor.py @@ -507,9 +507,7 @@ async def test_abort(self): class AbortServicer(GRPCTestServerServicer): # pylint:disable=C0103 async def SimpleMethod(self, request, context): - await context.abort( - grpc.StatusCode.FAILED_PRECONDITION, failure_message - ) + await context.abort(grpc.StatusCode.INTERNAL, failure_message) testcase = self @@ -520,9 +518,7 @@ async def request(channel): with testcase.assertRaises(grpc.RpcError) as cm: await channel.unary_unary(rpc_call)(msg) - self.assertEqual( - cm.exception.code(), grpc.StatusCode.FAILED_PRECONDITION - ) + self.assertEqual(cm.exception.code(), grpc.StatusCode.INTERNAL) self.assertEqual(cm.exception.details(), failure_message) await run_with_test_server(request, servicer=AbortServicer()) @@ -543,7 +539,7 @@ async def request(channel): self.assertEqual(span.status.status_code, StatusCode.ERROR) self.assertEqual( span.status.description, - f"{grpc.StatusCode.FAILED_PRECONDITION}:{failure_message}", + f"{grpc.StatusCode.INTERNAL}:{failure_message}", ) # Check attributes @@ -555,7 +551,7 @@ async def request(channel): SpanAttributes.RPC_METHOD: "SimpleMethod", SpanAttributes.RPC_SERVICE: "GRPCTestServer", SpanAttributes.RPC_SYSTEM: "grpc", - SpanAttributes.RPC_GRPC_STATUS_CODE: grpc.StatusCode.FAILED_PRECONDITION.value[ + SpanAttributes.RPC_GRPC_STATUS_CODE: grpc.StatusCode.INTERNAL.value[ 0 ], }, @@ -605,11 +601,8 @@ async def request(channel): ) # make sure this span errored, with the right status and detail - self.assertEqual(span.status.status_code, StatusCode.ERROR) - self.assertEqual( - span.status.description, - f"{grpc.StatusCode.FAILED_PRECONDITION}:{failure_message}", - ) + self.assertEqual(span.status.status_code, StatusCode.UNSET) + self.assertEqual(span.status.description, None) # Check attributes self.assertSpanHasAttributes( diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py index 57f27c89d6..de79269894 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py @@ -552,28 +552,45 @@ def test_abort(self): # our detailed failure message failure_message = "This is a test failure" - # aborting RPC handler - def handler(request, context): + # aborting RPC handlers + def error_status_handler(request, context): + context.abort(grpc.StatusCode.INTERNAL, failure_message) + + def unset_status_handler(request, context): context.abort(grpc.StatusCode.FAILED_PRECONDITION, failure_message) - with self.server( - max_workers=1, - interceptors=[interceptor], - ) as (server, channel): - server.add_generic_rpc_handlers((UnaryUnaryRpcHandler(handler),)) - rpc_call = "TestServicer/handler" + rpc_call_error = "TestServicer/error_status_handler" + rpc_call_unset = "TestServicer/unset_status_handler" + + rpc_calls = { + rpc_call_error: error_status_handler, + rpc_call_unset: unset_status_handler, + } + + for rpc_call, handler in rpc_calls.items(): + with self.server( + max_workers=1, + interceptors=[interceptor], + ) as (server, channel): + server.add_generic_rpc_handlers( + (UnaryUnaryRpcHandler(handler),) + ) - server.start() - # unfortunately, these are just bare exceptions in grpc... - with self.assertRaises(Exception): - channel.unary_unary(rpc_call)(b"") - server.stop(None) + server.start() + + with self.assertRaises(Exception): + channel.unary_unary(rpc_call)(b"") + + # unfortunately, these are just bare exceptions in grpc... + server.stop(None) spans_list = self.memory_exporter.get_finished_spans() - self.assertEqual(len(spans_list), 1) + self.assertEqual(len(spans_list), 2) + + # check error span span = spans_list[0] - self.assertEqual(span.name, rpc_call) + self.assertEqual(span.name, rpc_call_error) self.assertIs(span.kind, trace.SpanKind.SERVER) # Check version and name in span's instrumentation info @@ -585,15 +602,43 @@ def handler(request, context): self.assertEqual(span.status.status_code, StatusCode.ERROR) self.assertEqual( span.status.description, - f"{grpc.StatusCode.FAILED_PRECONDITION}:{failure_message}", + f"{grpc.StatusCode.INTERNAL}:{failure_message}", + ) + + # Check attributes + self.assertSpanHasAttributes( + span, + { + **self.net_peer_span_attributes, + SpanAttributes.RPC_METHOD: "error_status_handler", + SpanAttributes.RPC_SERVICE: "TestServicer", + SpanAttributes.RPC_SYSTEM: "grpc", + SpanAttributes.RPC_GRPC_STATUS_CODE: grpc.StatusCode.INTERNAL.value[ + 0 + ], + }, ) + # check unset status span + span = spans_list[1] + + self.assertEqual(span.name, rpc_call_unset) + self.assertIs(span.kind, trace.SpanKind.SERVER) + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.grpc + ) + + self.assertEqual(span.status.description, None) + self.assertEqual(span.status.status_code, StatusCode.UNSET) + # Check attributes self.assertSpanHasAttributes( span, { **self.net_peer_span_attributes, - SpanAttributes.RPC_METHOD: "handler", + SpanAttributes.RPC_METHOD: "unset_status_handler", SpanAttributes.RPC_SERVICE: "TestServicer", SpanAttributes.RPC_SYSTEM: "grpc", SpanAttributes.RPC_GRPC_STATUS_CODE: grpc.StatusCode.FAILED_PRECONDITION.value[ From 565e78de2ca3b0304568ff01a70c614c3d4e8def Mon Sep 17 00:00:00 2001 From: Emanuele Fumagalli Date: Thu, 7 Mar 2024 19:56:04 +0000 Subject: [PATCH 117/200] Fix OpenTelemetry Aio-pika instrumentation link (#2259) --- .../opentelemetry-instrumentation-aio-pika/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/README.rst b/instrumentation/opentelemetry-instrumentation-aio-pika/README.rst index aa0f1a3f5c..bb5e46cf2f 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/README.rst +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/README.rst @@ -18,6 +18,6 @@ Installation References ---------- -* `OpenTelemetry Aio-pika instrumentation `_ +* `OpenTelemetry Aio-pika instrumentation `_ * `OpenTelemetry Project `_ * `OpenTelemetry Python Examples `_ From cb5a07c765e34095dbd916dc945a4b08baf0e6fc Mon Sep 17 00:00:00 2001 From: Andrew L <32132177+awhlam@users.noreply.github.com> Date: Wed, 13 Mar 2024 05:05:31 -0700 Subject: [PATCH 118/200] Update README.rst (#2111) Co-authored-by: Leighton Chen --- .../opentelemetry-instrumentation-tortoiseorm/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/README.rst b/instrumentation/opentelemetry-instrumentation-tortoiseorm/README.rst index e845fbf84d..22d6c01731 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/README.rst +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/README.rst @@ -19,5 +19,5 @@ References ---------- * `OpenTelemetry Project `_ -* `Tortoise ORM `_ +* `Tortoise ORM `_ * `OpenTelemetry Python Examples `_ From 1e0b11f07a2a87849d7ffa1f4f7db9f26b815c7e Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 13 Mar 2024 16:33:47 -0600 Subject: [PATCH 119/200] Fix docker test dependencies (#2345) Fixes #2344 --- tox.ini | 89 +++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 70 insertions(+), 19 deletions(-) diff --git a/tox.ini b/tox.ini index 7b7b2a0710..6d74b45964 100644 --- a/tox.ini +++ b/tox.ini @@ -597,30 +597,81 @@ commands = [testenv:docker-tests] basepython: python3 deps = - pip >= 20.3.3 - pytest + aiopg==1.1.0 + amqp==5.2.0 + asgiref==3.7.2 + async-timeout==4.0.3 asyncpg==0.27.0 - docker-compose >= 1.25.2 - mysql-connector-python ~= 8.0 - pymongo >= 3.1, < 5.0 - PyMySQL ~= 0.10.1 + attrs==23.2.0 + bcrypt==4.1.2 + billiard==4.2.0 + celery==5.3.6 + certifi==2024.2.2 + cffi==1.16.0 + chardet==3.0.4 + click==8.1.7 + click-didyoumean==0.3.0 + click-plugins==1.1.1 + click-repl==0.3.0 + cryptography==42.0.5 + Deprecated==1.2.14 + distro==1.9.0 + dnspython==2.6.1 + docker==5.0.3 + docker-compose==1.29.2 + dockerpty==0.4.1 + docopt==0.6.2 + exceptiongroup==1.2.0 + flaky==3.7.0 + greenlet==3.0.3 + grpcio==1.62.1 + idna==2.10 + importlib-metadata==6.11.0 + iniconfig==2.0.0 + jsonschema==3.2.0 + kombu==5.3.5 + mysql-connector-python==8.3.0 + mysqlclient==2.1.1 + opencensus-proto==0.1.0 + packaging==24.0 + paramiko==3.4.0 + pluggy==1.4.0 + prometheus_client==0.20.0 + prompt-toolkit==3.0.43 + protobuf==3.20.3 # prerequisite: install libpq-dev (debian) or postgresql-devel (rhel), postgresql (mac) # see https://www.psycopg.org/docs/install.html#build-prerequisites # you might have to install additional packages depending on your OS - psycopg ~= 3.1.17 - psycopg2 ~= 2.9.5 - aiopg >= 0.13.0, < 1.3.0 - sqlalchemy ~= 1.4 - redis ~= 4.3 - celery[pytest] >= 4.0, < 6.0 - protobuf~=3.13 + psycopg==3.1.18 + psycopg2==2.9.9 + psycopg2-binary==2.9.9 + pycparser==2.21 + pymongo==4.6.2 + PyMySQL==0.10.1 + PyNaCl==1.5.0 + pyodbc==4.0.39 + pyrsistent==0.20.0 + pytest==8.0.2 + pytest-celery==0.0.0 + python-dateutil==2.9.0.post0 + python-dotenv==0.21.1 + pytz==2024.1 + PyYAML==5.3.1 + redis==4.6.0 + remoulade==3.2.0 requests==2.25.0 - # prerequisite: install unixodbc - pyodbc~=4.0.30 - flaky==3.7.0 - remoulade>=0.50 - mysqlclient~=2.1.1 - pyyaml==5.3.1 + six==1.16.0 + SQLAlchemy==1.4.52 + texttable==1.7.0 + tomli==2.0.1 + typing_extensions==4.10.0 + tzdata==2024.1 + urllib3==1.26.18 + vine==5.1.0 + wcwidth==0.2.13 + websocket-client==0.59.0 + wrapt==1.16.0 + zipp==3.18.0 changedir = tests/opentelemetry-docker-tests/tests From aa8ae2efe34f049088eb517c5c87ed1f943a4704 Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 14 Mar 2024 09:50:04 +0100 Subject: [PATCH 120/200] Celery duplicated instrumentation (#2342) * * Adding (failing) testcase to cover Issue #2029 * * move Instance variables to class variables. Since the object in question will be a singelton. This will resolve #2029 where multiple calls to the instrumentation will assign Null values. * * black formatting * * Changelog stub entry, PR # to follow * * updating the pullrequest number * * remove superfluous constructor * * moving Change log to unreleased section --------- Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CHANGELOG.md | 2 ++ .../instrumentation/celery/__init__.py | 6 ++-- .../tests/test_duplicate.py | 30 +++++++++++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-celery/tests/test_duplicate.py diff --git a/CHANGELOG.md b/CHANGELOG.md index e841a0bdc8..673623d89c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Fixed +- `opentelemetry-instrumentation-celery` Allow Celery instrumentation to be installed multiple times + ([#2342](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2342)) - Align gRPC span status codes to OTEL specification ([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756)) ## Version 1.23.0/0.44b0 (2024-02-23) diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py index 94cac68b70..10ccca1270 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py @@ -113,10 +113,8 @@ def keys(self, carrier): class CeleryInstrumentor(BaseInstrumentor): - def __init__(self): - super().__init__() - self.metrics = None - self.task_id_to_start_time = {} + metrics = None + task_id_to_start_time = {} def instrumentation_dependencies(self) -> Collection[str]: return _instruments diff --git a/instrumentation/opentelemetry-instrumentation-celery/tests/test_duplicate.py b/instrumentation/opentelemetry-instrumentation-celery/tests/test_duplicate.py new file mode 100644 index 0000000000..ab1f7804cf --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-celery/tests/test_duplicate.py @@ -0,0 +1,30 @@ +# 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. + +import unittest + +from opentelemetry.instrumentation.celery import CeleryInstrumentor + + +class TestUtils(unittest.TestCase): + def test_duplicate_instrumentaion(self): + first = CeleryInstrumentor() + first.instrument() + second = CeleryInstrumentor() + second.instrument() + CeleryInstrumentor().uninstrument() + self.assertIsNotNone(first.metrics) + self.assertIsNotNone(second.metrics) + self.assertEqual(first.task_id_to_start_time, {}) + self.assertEqual(second.task_id_to_start_time, {}) From af1528d2884dbdfa080845260750c40d50427dd8 Mon Sep 17 00:00:00 2001 From: Rodrigo-Novas Date: Thu, 14 Mar 2024 06:36:54 -0300 Subject: [PATCH 121/200] chore: fix md based on rules and fix bad links (#2240) * chore: fix md based on rules and fix bad links * chore: add index to contribuiting and readme files --------- Co-authored-by: Leighton Chen Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- CONTRIBUTING.md | 57 ++++++++++++++++++++++++++++++++----------------- README.md | 17 +++++++++++---- RELEASING.md | 6 ++++-- 3 files changed, 54 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c76634db7..0c18392bc7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,26 @@ on how to become a [**Member**](https://github.com/open-telemetry/community/blob [**Approver**](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver) and [**Maintainer**](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer). -## Find a Buddy and get Started Quickly! +## Index + +* [Find a Buddy and get Started Quickly](#find-a-buddy-and-get-started-quickly) +* [Development](#development) + * [Troubleshooting](#troubleshooting) + * [Benchmarks](#benchmarks) +* [Pull requests](#pull-requests) + * [How to Send Pull Requests](#how-to-send-pull-requests) + * [How to Receive Comments](#how-to-receive-comments) + * [How to Get PRs Reviewed](#how-to-get-prs-reviewed) + * [How to Get PRs Merged](#how-to-get-prs-merged) +* [Design Choices](#design-choices) + * [Focus on Capabilities, Not Structure Compliance](#focus-on-capabilities-not-structure-compliance) +* [Running Tests Locally](#running-tests-locally) + * [Testing against a different Core repo branch/commit](#testing-against-a-different-core-repo-branchcommit) +* [Style Guide](#style-guide) +* [Guideline for instrumentations](#guideline-for-instrumentations) +* [Expectations from contributors](#expectations-from-contributors) + +## Find a Buddy and get Started Quickly If you are looking for someone to help you find a starting point and be a resource for your first contribution, join our Slack and find a buddy! @@ -31,8 +50,8 @@ This project uses [tox](https://tox.readthedocs.io) to automate some aspects of development, including testing against multiple Python versions. To install `tox`, run: -```console -$ pip install tox +```sh +pip install tox ``` You can run `tox` with the following arguments: @@ -57,7 +76,7 @@ for more detail on available tox commands. ### Troubleshooting -- Some packages may require additional system wide dependencies to be installed. For example, you may need to install `libpq-dev` to run the postgresql client libraries instrumentation tests. or `libsnappy-dev` to run the prometheus exporter tests. If you encounter a build error, please check the installation instructions for the package you are trying to run tests for. +> Some packages may require additional system wide dependencies to be installed. For example, you may need to install `libpq-dev` to run the postgresql client libraries instrumentation tests. or `libsnappy-dev` to run the prometheus exporter tests. If you encounter a build error, please check the installation instructions for the package you are trying to run tests for. ### Benchmarks @@ -94,13 +113,13 @@ pull requests (PRs). To create a new PR, fork the project in GitHub and clone the upstream repo: ```sh -$ git clone https://github.com/open-telemetry/opentelemetry-python-contrib.git +git clone https://github.com/open-telemetry/opentelemetry-python-contrib.git ``` Add your fork as an origin: ```sh -$ git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opentelemetry-python-contrib.git +git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opentelemetry-python-contrib.git ``` Run tests: @@ -114,10 +133,10 @@ $ tox # execute in the root of the repository Check out a new branch, make modifications and push the branch to your fork: ```sh -$ git checkout -b feature +git checkout -b feature # edit files -$ git commit -$ git push fork feature +git commit +git push fork feature ``` Open a pull request against the main `opentelemetry-python-contrib` repo. @@ -142,6 +161,7 @@ If you are not getting reviews, please contact the respective owners directly. ### How to Get PRs Merged A PR is considered to be **ready to merge** when: + * It has received two approvals from [Approvers](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver) / [Maintainers](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer) (at different companies). @@ -186,8 +206,7 @@ Some of the tox targets install packages from the [OpenTelemetry Python Core Rep CORE_REPO_SHA=c49ad57bfe35cfc69bfa863d74058ca9bec55fc3 tox -The continuation integration overrides that environment variable with as per the configuration [here](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/test.yml#L9). - +The continuation integration overrides that environment variable with as per the configuration [here](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/.github/workflows/test.yml#L9). ## Style Guide @@ -203,27 +222,25 @@ Below is a checklist of things to be mindful of when implementing a new instrume - Follow semantic conventions - The instrumentation should follow the semantic conventions defined [here](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/semantic-conventions.md) -- Extends from [BaseInstrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py#L26) +- Extends from [BaseInstrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/2518a4ac07cb62ad6587dd8f6cbb5f8663a7e179/opentelemetry-instrumentation/src/opentelemetry/instrumentation/instrumentor.py#L35) - Supports auto-instrumentation - - Add an entry point (ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/f045c43affff6ff1af8fa2f7514a4fdaca97dacf/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml#L44) + - Add an entry point (ex. ) - Run `python scripts/generate_instrumentation_bootstrap.py` after adding a new instrumentation package. - Functionality that is common amongst other instrumentation and can be abstracted [here](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation/src/opentelemetry/instrumentation) - Request/response [hooks](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/408) for http instrumentations - `suppress_instrumentation` functionality - - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/3ec77360cb20482b08b30312a6bedc8b946e3fa1/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L111 + - ex. - Suppress propagation functionality - https://github.com/open-telemetry/opentelemetry-python-contrib/issues/344 for more context - `exclude_urls` functionality - - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py#L91 + - ex. - `url_filter` functionality - - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py#L235 + - ex. - `is_recording()` optimization on non-sampled spans - - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L133 + - ex. - Appropriate error handling - - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L146 - + - ex. ## Expectations from contributors OpenTelemetry is an open source community, and as such, greatly encourages contributions from anyone interested in the project. With that being said, there is a certain level of expectation from contributors even after a pull request is merged, specifically pertaining to instrumentations. The OpenTelemetry Python community expects contributors to maintain a level of support and interest in the instrumentations they contribute. This is to ensure that the instrumentation does not become stale and still functions the way the original contributor intended. Some instrumentations also pertain to libraries that the current members of the community are not so familiar with, so it is necessary to rely on the expertise of the original contributing parties. - diff --git a/README.md b/README.md index 0a3d37ab3f..c315b4a876 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,20 @@ --- -## OpenTelemetry Python Contrib +# OpenTelemetry Python Contrib The Python auto-instrumentation libraries for [OpenTelemetry](https://opentelemetry.io/) (per [OTEP 0001](https://github.com/open-telemetry/oteps/blob/main/text/0001-telemetry-without-manual-instrumentation.md)) -### Installation +## Index + +* [Installation](#installation) +* [Releasing](#releasing) + * [Releasing a package as `1.0` stable](#releasing-a-package-as-10-stable) +* [Contributing](#contributing) +* [Running Tests Locally](#running-tests-locally) +* [Thanks to all the people who already contributed](#thanks-to-all-the-people-who-already-contributed) + +## Installation This repository includes installable packages for each instrumented library. Libraries that produce telemetry data should only depend on `opentelemetry-api`, and defer the choice of the SDK to the application developer. Applications may @@ -79,6 +88,7 @@ To resolve this, members of the community are encouraged to commit to becoming a ### Releasing a package as `1.0` stable To release a package as `1.0` stable, the package: + - SHOULD have a CODEOWNER. To become one, submit an issue and explain why you meet the responsibilities found in [CODEOWNERS](.github/CODEOWNERS). - MUST have unit tests that cover all supported versions of the instrumented library. - e.g. Instrumentation packages might use different techniques to instrument different major versions of python packages @@ -131,9 +141,8 @@ Emeritus Maintainers: 4. Make sure you have `tox` installed. `pip install tox`. 5. Run tests for a package. (e.g. `tox -e test-instrumentation-flask`.) -### Thanks to all the people who already contributed! +### Thanks to all the people who already contributed - diff --git a/RELEASING.md b/RELEASING.md index 1547cec224..256674d1b8 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -77,15 +77,17 @@ * If for some reason the action failed, see [Publish failed](#publish-failed) below * Move stable tag * Run the following (TODO automate): + ```bash git tag -d stable git tag stable git push --delete origin tagname git push origin stable ``` + * This will ensure the docs are pointing at the stable release. * To validate this worked, ensure the stable build has run successfully: - https://readthedocs.org/projects/opentelemetry-python/builds/. + . If the build has not run automatically, it can be manually trigger via the readthedocs interface. ## Troubleshooting @@ -98,4 +100,4 @@ If for some reason the action failed, do it manually: - Build distributions with `./scripts/build.sh` - Delete distributions we don't want to push (e.g. `testutil`) - Push to PyPI as `twine upload --skip-existing --verbose dist/*` -- Double check PyPI! \ No newline at end of file +- Double check PyPI! From 9b3d0b485e444366ae7b98a030489e40be099402 Mon Sep 17 00:00:00 2001 From: John Bley Date: Thu, 14 Mar 2024 13:29:38 -0400 Subject: [PATCH 122/200] Use set -e to catch errors in all scripts (#2347) --- .../proto/generate-proto-py.sh | 1 + scripts/prepare_release.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/proto/generate-proto-py.sh b/exporter/opentelemetry-exporter-prometheus-remote-write/proto/generate-proto-py.sh index 3cde0bd1ac..5f6129df55 100755 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/proto/generate-proto-py.sh +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/proto/generate-proto-py.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e PROM_VERSION=v2.39.0 PROTO_VERSION=v1.3.2 diff --git a/scripts/prepare_release.sh b/scripts/prepare_release.sh index a0bb15f216..66ed3c593e 100755 --- a/scripts/prepare_release.sh +++ b/scripts/prepare_release.sh @@ -1,5 +1,6 @@ #!/bin/bash -# +set -e + # This script: # 1. parses the version number from the branch name # 2. updates version.py files to match that version From 3273d8c39f289e2c9350ae781406dfb99692bb76 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 14 Mar 2024 20:27:18 +0100 Subject: [PATCH 123/200] Fix asyncio related warnings in tests (#2335) * aiopg: fix runtime warnings when running tests Fixes: RuntimeWarning: coroutine 'MockCursor.execute' was never awaited cursor.execute(query) * aio-pika: no need to return an awaitable in mocked method No need to return an awaitable since the mocked method awaits itself. Fixes: RuntimeWarning: coroutine 'sleep' was never awaited --------- Co-authored-by: Leighton Chen --- .../tests/test_publish_decorator.py | 16 ++++------------ .../tests/test_aiopg_integration.py | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py b/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py index 41cd11d5a6..90a029531d 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/tests/test_publish_decorator.py @@ -75,9 +75,7 @@ def _test_publish(self, exchange_type: Type[Exchange]): with mock.patch.object( PublishDecorator, "_get_publish_span" ) as mock_get_publish_span: - with mock.patch.object( - Exchange, "publish", return_value=asyncio.sleep(0) - ) as mock_publish: + with mock.patch.object(Exchange, "publish") as mock_publish: decorated_publish = PublishDecorator( self.tracer, exchange ).decorate(mock_publish) @@ -101,9 +99,7 @@ def _test_publish_works_with_not_recording_span(self, exchange_type): mocked_not_recording_span = MagicMock() mocked_not_recording_span.is_recording.return_value = False mock_get_publish_span.return_value = mocked_not_recording_span - with mock.patch.object( - Exchange, "publish", return_value=asyncio.sleep(0) - ) as mock_publish: + with mock.patch.object(Exchange, "publish") as mock_publish: with mock.patch( "opentelemetry.instrumentation.aio_pika.publish_decorator.propagate.inject" ) as mock_inject: @@ -158,9 +154,7 @@ def _test_publish(self, exchange_type: Type[Exchange]): with mock.patch.object( PublishDecorator, "_get_publish_span" ) as mock_get_publish_span: - with mock.patch.object( - Exchange, "publish", return_value=asyncio.sleep(0) - ) as mock_publish: + with mock.patch.object(Exchange, "publish") as mock_publish: decorated_publish = PublishDecorator( self.tracer, exchange ).decorate(mock_publish) @@ -184,9 +178,7 @@ def _test_publish_works_with_not_recording_span(self, exchange_type): mocked_not_recording_span = MagicMock() mocked_not_recording_span.is_recording.return_value = False mock_get_publish_span.return_value = mocked_not_recording_span - with mock.patch.object( - Exchange, "publish", return_value=asyncio.sleep(0) - ) as mock_publish: + with mock.patch.object(Exchange, "publish") as mock_publish: with mock.patch( "opentelemetry.instrumentation.aio_pika.publish_decorator.propagate.inject" ) as mock_inject: diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py index c6d00a51fe..fb76bd0f38 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py @@ -76,7 +76,7 @@ def test_instrumentor_connect(self): cnx = async_call(aiopg.connect(database="test")) cursor = async_call(cnx.cursor()) query = "SELECT * FROM test" - cursor.execute(query) + async_call(cursor.execute(query)) spans_list = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans_list), 1) @@ -127,7 +127,7 @@ def test_instrumentor_create_pool(self): cnx = async_call(pool.acquire()) cursor = async_call(cnx.cursor()) query = "SELECT * FROM test" - cursor.execute(query) + async_call(cursor.execute(query)) spans_list = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans_list), 1) From 717d10760ad1731fe59673a3b26c5e645bb6e1c3 Mon Sep 17 00:00:00 2001 From: Rodrigo-Novas Date: Thu, 14 Mar 2024 18:56:32 -0300 Subject: [PATCH 124/200] feat: add importlib metadata default on flask module (#2302) * feat: add importlib metadata default * feat: add importlib metadata default * feat: add importlib metadata default * Fix lint --------- Co-authored-by: Diego Hurtado --- CHANGELOG.md | 7 +++++-- .../pyproject.toml | 1 + .../opentelemetry/instrumentation/flask/__init__.py | 13 +++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 673623d89c..7bbe579232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `opentelemetry-instrumentation-celery` Allow Celery instrumentation to be installed multiple times ([#2342](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2342)) -- Align gRPC span status codes to OTEL specification ([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756)) +- Align gRPC span status codes to OTEL specification + ([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756)) +- `opentelemetry-instrumentation-flask` Add importlib metadata default for deprecation warning flask version + ([#2297](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2297)) ## Version 1.23.0/0.44b0 (2024-02-23) -- Drop support for 3.7 +- Drop uspport for 3.7 ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151)) - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index ca26f4c860..c8e8b48185 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ "opentelemetry-semantic-conventions == 0.45b0.dev", "opentelemetry-util-http == 0.45b0.dev", "packaging >= 21.0", + "importlib-metadata >= 4.0", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index 5e81cc5abe..a2b85d67f8 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -245,22 +245,13 @@ def response_hook(span: Span, status: str, response_headers: List): from typing import Collection import flask +import importlib_metadata as metadata from packaging import version as package_version import opentelemetry.instrumentation.wsgi as otel_wsgi from opentelemetry import context, trace from opentelemetry.instrumentation.flask.package import _instruments from opentelemetry.instrumentation.flask.version import __version__ - -try: - flask_version = flask.__version__ -except AttributeError: - try: - from importlib import metadata - except ImportError: - import importlib_metadata as metadata - flask_version = metadata.version("flask") - from opentelemetry.instrumentation.instrumentor import BaseInstrumentor from opentelemetry.instrumentation.propagators import ( get_global_response_propagator, @@ -281,6 +272,8 @@ def response_hook(span: Span, status: str, response_headers: List): _excluded_urls_from_env = get_excluded_urls("FLASK") +flask_version = metadata.version("flask") + if package_version.parse(flask_version) >= package_version.parse("2.2.0"): def _request_ctx_ref() -> weakref.ReferenceType: From 5b4e5d810ab36f08977579a76804472d58f9850a Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 17:43:20 -0600 Subject: [PATCH 125/200] Remove [test] package from opentelemetry-contrib-instrumentations (#2318) Fixes #2236 --- opentelemetry-contrib-instrumentations/pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 2ed7ccec87..1cd2c37625 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -77,9 +77,6 @@ dependencies = [ "opentelemetry-instrumentation-wsgi==0.45b0.dev", ] -[project.optional-dependencies] -test = [] - [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-contrib-instrumentations" From c54a9d1ad2436ce363df4680f3ec83369c98e5c9 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 17:57:38 -0600 Subject: [PATCH 126/200] Remove [test] package from aiopg instrumentation (#2243) Fixes #2185 --- .../pyproject.toml | 5 ----- .../test-requirements.txt | 22 +++++++++++++++++++ tox.ini | 6 ++--- 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index ebb88ee0ba..b6c54b658b 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -34,11 +34,6 @@ dependencies = [ instruments = [ "aiopg >= 0.13.0, < 2.0.0", ] -test = [ - "opentelemetry-instrumentation-aiopg[instruments]", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] aiopg = "opentelemetry.instrumentation.aiopg:AiopgInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt new file mode 100644 index 0000000000..2b03677f42 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt @@ -0,0 +1,22 @@ +aiopg==1.4.0 +asgiref==3.7.2 +async-timeout==4.0.3 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +install==1.3.5 +packaging==23.2 +pluggy==1.4.0 +psycopg2-binary==2.9.9 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-aiopg diff --git a/tox.ini b/tox.ini index 6d74b45964..936ee920a7 100644 --- a/tox.ini +++ b/tox.ini @@ -406,7 +406,7 @@ commands_pre = aiohttp-server: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] - aiopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] + aiopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt richconsole: pip install flaky {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] @@ -563,7 +563,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] @@ -597,7 +597,7 @@ commands = [testenv:docker-tests] basepython: python3 deps = - aiopg==1.1.0 + aiopg==1.4.0 amqp==5.2.0 asgiref==3.7.2 async-timeout==4.0.3 From 2417c099a0172717cc2929fda5892e37ebac461b Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 18:07:12 -0600 Subject: [PATCH 127/200] Remove [test] package from aio-pika instrumentation (#2244) Fixes #2186 --- .../pyproject.toml | 6 ----- .../test-requirements-0.txt | 23 +++++++++++++++++++ .../test-requirements-1.txt | 23 +++++++++++++++++++ .../test-requirements-2.txt | 23 +++++++++++++++++++ tox.ini | 20 ++++++++-------- 5 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt create mode 100644 instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index f328eab452..e79dac2866 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -33,12 +33,6 @@ dependencies = [ instruments = [ "aio_pika >= 7.2.0, < 10.0.0", ] -test = [ - "opentelemetry-instrumentation-aio-pika[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "pytest", - "wrapt >= 1.0.0, < 2.0.0", -] [project.entry-points.opentelemetry_instrumentor] aio-pika = "opentelemetry.instrumentation.aio_pika:AioPikaInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt new file mode 100644 index 0000000000..c8ffea4e89 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt @@ -0,0 +1,23 @@ +aio-pika==7.2.0 +aiormq==6.2.3 +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +multidict==6.0.5 +packaging==23.2 +pamqp==3.1.0 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +yarl==1.9.4 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-aio-pika diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt new file mode 100644 index 0000000000..1e2ea5a1e5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt @@ -0,0 +1,23 @@ +aio-pika==8.3.0 +aiormq==6.6.4 +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +multidict==6.0.5 +packaging==23.2 +pamqp==3.2.1 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +yarl==1.9.4 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-aio-pika diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt new file mode 100644 index 0000000000..3250c93947 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt @@ -0,0 +1,23 @@ +aio-pika==9.4.0 +aiormq==6.8.0 +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +multidict==6.0.5 +packaging==23.2 +pamqp==3.3.0 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +yarl==1.9.4 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-aio-pika diff --git a/tox.ini b/tox.ini index 936ee920a7..5b7fe73aa8 100644 --- a/tox.ini +++ b/tox.ini @@ -223,8 +223,13 @@ envlist = pypy3-test-instrumentation-sio-pika-{0,1} ; opentelemetry-instrumentation-aio-pika - py3{8,9,10,11}-test-instrumentation-aio-pika-{8,9} - pypy3-test-instrumentation-aio-pika-{8,9} + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: aio_pika~=7.2.0 + ; 1: aio_pika>=8.0.0,<9.0.0 + ; 2: aio_pika>=9.0.0,<10.0.0 + py3{8,9,10,11}-test-instrumentation-aio-pika-{0,1,2} + pypy3-test-instrumentation-aio-pika-{0,1,2} ; opentelemetry-instrumentation-kafka-python py3{8,9,10,11}-test-instrumentation-kafka-python @@ -284,9 +289,6 @@ deps = sqlalchemy-14: sqlalchemy~=1.4 sio-pika-0: pika>=0.12.0,<1.0.0 sio-pika-1: pika>=1.0.0 - aio-pika-7: aio_pika~=7.2.0 - aio-pika-8: aio_pika>=8.0.0,<9.0.0 - aio-pika-9: aio_pika>=9.0.0,<10.0.0 pymemcache-135: pymemcache ==1.3.5 pymemcache-200: pymemcache >2.0.0,<3.0.0 pymemcache-300: pymemcache >3.0.0,<3.4.2 @@ -325,7 +327,9 @@ commands_pre = sio-pika-{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] - aio-pika-{8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + aio-pika-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt + aio-pika-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt + aio-pika-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt kafka-python: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] @@ -400,8 +404,6 @@ commands_pre = logging: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] - aio-pika-{8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] - aiohttp-client: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] aiohttp-server: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] @@ -549,7 +551,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] From 1bf9f429e4b8b710762f06cb3a8e738e1fe76667 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 18:18:52 -0600 Subject: [PATCH 128/200] Remove [test] package from asgi instrumentation (#2247) Fixes #2187 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 8 +++++--- 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index d642a07e48..81c83b07e9 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -35,10 +35,6 @@ dependencies = [ instruments = [ "asgiref ~= 3.0", ] -test = [ - "opentelemetry-instrumentation-asgi[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-asgi" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt new file mode 100644 index 0000000000..f3ee9764cf --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-asgi diff --git a/tox.ini b/tox.ini index 5b7fe73aa8..6e18132202 100644 --- a/tox.ini +++ b/tox.ini @@ -323,6 +323,8 @@ commands_pre = distro: pip install {toxinidir}/opentelemetry-distro + asgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt + celery: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] sio-pika-{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] @@ -337,9 +339,9 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,asgi,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http + falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http wsgi,falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] - asgi,django-{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] + django-{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -538,7 +540,7 @@ commands_pre = python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] From 5552db2adfbd18fd3232dee8047d366a19d4df7b Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 18:32:23 -0600 Subject: [PATCH 129/200] Remove [test] package from asyncio instrumentation (#2248) Fixes #2188 --- .../pyproject.toml | 6 ------ .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml index 358fbefeb4..5354ea3cb4 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml @@ -33,12 +33,6 @@ dependencies = [ [project.optional-dependencies] instruments = [] -test = [ - "opentelemetry-instrumentation-asyncio[instruments]", - "pytest", - "wrapt >= 1.0.0, < 2.0.0", - "pytest-asyncio", -] [project.entry-points.opentelemetry_instrumentor] asyncio = "opentelemetry.instrumentation.asyncio:AsyncioInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt new file mode 100644 index 0000000000..14f724888b --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-asyncio==0.23.5 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-asyncio diff --git a/tox.ini b/tox.ini index 6e18132202..3250a5be3c 100644 --- a/tox.ini +++ b/tox.ini @@ -422,7 +422,7 @@ commands_pre = elasticsearch-{2,5,6}: pip install {toxinidir}/opentelemetry-instrumentation[test] {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] - asyncio: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio[test] + asyncio: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt httpx-{18,21}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] @@ -586,7 +586,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] # requires snappy headers to be available on the system python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] From d948f21ad32fb9fde0b1193abc1b7acf28539d4a Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 18:42:46 -0600 Subject: [PATCH 130/200] Remove [test] package from flask instrumentation (#2127) Fixes #2126 --- .../pyproject.toml | 5 ---- .../test-requirements-0.txt | 25 +++++++++++++++++ .../test-requirements-1.txt | 25 +++++++++++++++++ .../test-requirements-2.txt | 26 ++++++++++++++++++ tox.ini | 27 ++++++++++--------- 5 files changed, 90 insertions(+), 18 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt create mode 100644 instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index c8e8b48185..8e0dd1f858 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -37,11 +37,6 @@ dependencies = [ instruments = [ "flask >= 1.0", ] -test = [ - "opentelemetry-instrumentation-flask[instruments]", - "markupsafe==2.1.2", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] flask = "opentelemetry.instrumentation.flask:FlaskInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt new file mode 100644 index 0000000000..fbefeebdb4 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt @@ -0,0 +1,25 @@ +asgiref==3.7.2 +attrs==23.2.0 +click==8.1.7 +Deprecated==1.2.14 +Flask==2.1.3 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.2 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +Werkzeug==2.3.8 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-flask diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt new file mode 100644 index 0000000000..41583ad7f9 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt @@ -0,0 +1,25 @@ +asgiref==3.7.2 +attrs==23.2.0 +click==8.1.7 +Deprecated==1.2.14 +Flask==2.2.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.2 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +Werkzeug==2.3.8 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-flask diff --git a/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt new file mode 100644 index 0000000000..3a89328861 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt @@ -0,0 +1,26 @@ +asgiref==3.7.2 +attrs==23.2.0 +blinker==1.7.0 +click==8.1.7 +Deprecated==1.2.14 +Flask==3.0.2 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.2 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +Werkzeug==3.0.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-flask diff --git a/tox.ini b/tox.ini index 3250a5be3c..d61f050571 100644 --- a/tox.ini +++ b/tox.ini @@ -83,9 +83,14 @@ envlist = pypy3-test-instrumentation-fastapi ; opentelemetry-instrumentation-flask - py3{8,9,10,11}-test-instrumentation-flask-{213,220} - py3{8,9,10,11}-test-instrumentation-flask-{300} - pypy3-test-instrumentation-flask-{213,220} + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: Flask ==2.1.3 Werkzeug <3.0.0 + ; 1: Flask ==2.2.0 Werkzeug <3.0.0 + ; 2: Flask >=3.0.0 Werkzeug >=3.0.0 + py3{8,9,10,11}-test-instrumentation-flask-{0,1} + py3{8,9,10,11}-test-instrumentation-flask-{2} + pypy3-test-instrumentation-flask-{0,1} ; opentelemetry-instrumentation-urllib py3{8,9,10,11}-test-instrumentation-urllib @@ -277,12 +282,6 @@ deps = falcon-1: falcon ==1.4.1 falcon-2: falcon >=2.0.0,<3.0.0 falcon-3: falcon >=3.0.0,<4.0.0 - flask-213: Flask ==2.1.3 - flask-213: Werkzeug <3.0.0 - flask-220: Flask ==2.2.0 - flask-220: Werkzeug <3.0.0 - flask-300: Flask >=3.0.0 - flask-300: Werkzeug >=3.0.0 grpc: pytest-asyncio sqlalchemy-11: sqlalchemy>=1.1,<1.2 sqlalchemy-14: aiosqlite @@ -339,8 +338,8 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http - wsgi,falcon-{1,2,3},flask-{213,220,300},django-{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + falcon-{1,2,3},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http + wsgi,falcon-{1,2,3},django-{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] django-{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -354,7 +353,9 @@ commands_pre = falcon-{1,2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] - flask-{213,220,300}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] + flask-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt + flask-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt + flask-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt urllib: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] @@ -548,7 +549,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-flask[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] From 5f68e9701bed6a12b90100595839690c04dc8d5d Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 18:54:12 -0600 Subject: [PATCH 131/200] Remove [test] package for django instrumentation (#2311) Fixes #2198 --- .../pyproject.toml | 4 --- .../test-requirements-0.txt | 22 +++++++++++++ .../test-requirements-1.txt | 23 +++++++++++++ .../test-requirements-2.txt | 23 +++++++++++++ .../test-requirements-3.txt | 22 +++++++++++++ tox.ini | 33 ++++++++++++------- 6 files changed, 112 insertions(+), 15 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt create mode 100644 instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt create mode 100644 instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 50cc227e44..65be04cb69 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -38,10 +38,6 @@ asgi = [ instruments = [ "django >= 1.10", ] -test = [ - "opentelemetry-instrumentation-django[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] django = "opentelemetry.instrumentation.django:DjangoInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt new file mode 100644 index 0000000000..6dce957000 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +Django==2.2.28 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +pytz==2024.1 +sqlparse==0.4.4 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-django diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt new file mode 100644 index 0000000000..116dc015ec --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt @@ -0,0 +1,23 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +Django==3.2.24 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +pytz==2024.1 +sqlparse==0.4.4 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e instrumentation/opentelemetry-instrumentation-asgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-django diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt new file mode 100644 index 0000000000..ac3b40e16b --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt @@ -0,0 +1,23 @@ +asgiref==3.7.2 +attrs==23.2.0 +backports.zoneinfo==0.2.1 +Deprecated==1.2.14 +Django==4.2.10 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +sqlparse==0.4.4 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e instrumentation/opentelemetry-instrumentation-asgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-django diff --git a/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt new file mode 100644 index 0000000000..3bb32c4c6b --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +Django==4.2.10 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +sqlparse==0.4.4 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e instrumentation/opentelemetry-instrumentation-asgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-django diff --git a/tox.ini b/tox.ini index d61f050571..411f73f2f3 100644 --- a/tox.ini +++ b/tox.ini @@ -52,10 +52,18 @@ envlist = ; Only officially supported Python versions are tested for each Django ; major release. Updated list can be found at: ; https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: django~=2.0 + ; 1: django~=3.0 + ; 2: django>=4.0b1,<5.0 backports.zoneinfo==0.2.1 + ; 3: django>=4.0b1,<5.0 + py3{8,9}-test-instrumentation-django-0 + py3{8,9}-test-instrumentation-django-1 py3{8,9}-test-instrumentation-django-2 - py3{8,9,10,11}-test-instrumentation-django-3 - py3{8,9,10,11}-test-instrumentation-django-4 - pypy3-test-instrumentation-django-{2,3} + py3{10,11}-test-instrumentation-django-1 + py3{10,11}-test-instrumentation-django-3 + pypy3-test-instrumentation-django-{0,1} ; opentelemetry-instrumentation-dbapi py3{8,9,10,11}-test-instrumentation-dbapi @@ -265,9 +273,6 @@ deps = test: pytest-benchmark coverage: pytest coverage: pytest-cov - django-2: django~=2.0 - django-3: django~=3.0 - django-4: django>=4.0b1,<5.0 elasticsearch-2: elasticsearch-dsl>=2.0,<3.0 elasticsearch-2: elasticsearch>=2.0,<3.0 elasticsearch-5: elasticsearch-dsl>=5.0,<6.0 @@ -338,9 +343,9 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon-{1,2,3},django-{1,2,3,4},pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http - wsgi,falcon-{1,2,3},django-{1,2,3,4},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] - django-{3,4},starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi + falcon-{1,2,3},pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http + wsgi,falcon-{1,2,3},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -367,7 +372,13 @@ commands_pre = dbapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] - django-{1,2,3,4}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] + py3{8,9}-test-instrumentation-django-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt + py3{8,9}-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt + py3{8,9}-test-instrumentation-django-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-2.txt + py3{10,11}-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt + py3{10,11}-test-instrumentation-django-3: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt + pypy3-test-instrumentation-django-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt + pypy3-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] @@ -544,7 +555,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-django[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] From ce2de1f5a933f66b9c72fe293a04dde39a368eb7 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 19:05:44 -0600 Subject: [PATCH 132/200] Remove [test] package from falcon instrumentation (#2313) Fixes #2200 --- .../pyproject.toml | 4 ---- .../test-requirements-0.txt | 22 +++++++++++++++++ .../test-requirements-1.txt | 20 ++++++++++++++++ .../test-requirements-2.txt | 20 ++++++++++++++++ tox.ini | 24 +++++++++++-------- 5 files changed, 76 insertions(+), 14 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt create mode 100644 instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index 1e4b5e5254..dab9534bf9 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -36,10 +36,6 @@ dependencies = [ instruments = [ "falcon >= 1.4.1, < 3.1.2", ] -test = [ - "opentelemetry-instrumentation-falcon[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] falcon = "opentelemetry.instrumentation.falcon:FalconInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt new file mode 100644 index 0000000000..31c7f1d7c8 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +falcon==1.4.1 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-mimeparse==1.6.0 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-falcon diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt new file mode 100644 index 0000000000..ad476d7c22 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt @@ -0,0 +1,20 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +falcon==2.0.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-falcon diff --git a/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt new file mode 100644 index 0000000000..6c5c3e8ac9 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt @@ -0,0 +1,20 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +falcon==3.1.1 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-falcon diff --git a/tox.ini b/tox.ini index 411f73f2f3..8ba4d6722d 100644 --- a/tox.ini +++ b/tox.ini @@ -82,9 +82,14 @@ envlist = ; opentelemetry-instrumentation-falcon ; py310 does not work with falcon 1 - py3{8,9}-test-instrumentation-falcon-1 - py3{8,9,10,11}-test-instrumentation-falcon-{2,3} - pypy3-test-instrumentation-falcon-{1,2,3} + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: falcon ==1.4.1 + ; 1: falcon >=2.0.0,<3.0.0 + ; 2: falcon >=3.0.0,<4.0.0 + py3{8,9}-test-instrumentation-falcon-0 + py3{8,9,10,11}-test-instrumentation-falcon-{1,2} + pypy3-test-instrumentation-falcon-{0,1,2} ; opentelemetry-instrumentation-fastapi py3{8,9,10,11}-test-instrumentation-fastapi @@ -284,9 +289,6 @@ deps = ; elasticsearch-7: elasticsearch>=7.0,<8.0 ; elasticsearch-8: elasticsearch-dsl>=8.0,<9.0 ; elasticsearch-8: elasticsearch>=8.0,<9.0 - falcon-1: falcon ==1.4.1 - falcon-2: falcon >=2.0.0,<3.0.0 - falcon-3: falcon >=3.0.0,<4.0.0 grpc: pytest-asyncio sqlalchemy-11: sqlalchemy>=1.1,<1.2 sqlalchemy-14: aiosqlite @@ -343,8 +345,8 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - falcon-{1,2,3},pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http - wsgi,falcon-{1,2,3},pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http + wsgi,pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -356,7 +358,9 @@ commands_pre = boto3sqs: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] - falcon-{1,2,3}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] + falcon-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt + falcon-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt + falcon-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt flask-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-0.txt flask-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt @@ -558,7 +562,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] From ba05c2c0c33297c08eb98d87742b68c48b09f10f Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 19:15:50 -0600 Subject: [PATCH 133/200] Remove [test] package from wsgi instrumentation (#2283) Fixes #2227 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 8 +++++--- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index bb1b6ef286..69b0e7ff41 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -32,9 +32,6 @@ dependencies = [ [project.optional-dependencies] instruments = [] -test = [ - "opentelemetry-test-utils == 0.45b0.dev", -] [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-wsgi" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt new file mode 100644 index 0000000000..a4910352ed --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-wsgi diff --git a/tox.ini b/tox.ini index 8ba4d6722d..e1d78919bc 100644 --- a/tox.ini +++ b/tox.ini @@ -345,10 +345,12 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2},wsgi: pip install {toxinidir}/util/opentelemetry-util-http - wsgi,pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi + wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt + asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] aws-lambda: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] @@ -554,7 +556,7 @@ commands_pre = python -m pip install {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils python -m pip install -e {toxinidir}/util/opentelemetry-util-http[test] python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] From e56cdc8feca09d611ac837e7268d30b676025a4a Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 19:29:18 -0600 Subject: [PATCH 134/200] Remove [test] package from pyramid instrumentation (#2273) Fixes #2214 --- .../pyproject.toml | 5 ---- .../test-requirements.txt | 30 +++++++++++++++++++ tox.ini | 7 ++--- 3 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 1face37ccc..4f6577d4a8 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -36,11 +36,6 @@ dependencies = [ instruments = [ "pyramid >= 1.7", ] -test = [ - "opentelemetry-instrumentation-pyramid[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "werkzeug == 0.16.1", -] [project.entry-points.opentelemetry_instrumentor] pyramid = "opentelemetry.instrumentation.pyramid:PyramidInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt new file mode 100644 index 0000000000..1362e7166e --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt @@ -0,0 +1,30 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +hupper==1.12.1 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +PasteDeploy==3.1.0 +plaster==1.1.2 +plaster-pastedeploy==1.0.1 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pyramid==2.0.2 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +translationstring==1.4 +typing_extensions==4.9.0 +venusian==3.1.0 +WebOb==1.8.7 +Werkzeug==0.16.1 +wrapt==1.16.0 +zipp==3.17.0 +zope.deprecation==5.0 +zope.interface==6.2 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-wsgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-pyramid diff --git a/tox.ini b/tox.ini index e1d78919bc..ac4123f4ce 100644 --- a/tox.ini +++ b/tox.ini @@ -345,8 +345,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - pyramid,tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http - pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi + tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -402,7 +401,7 @@ commands_pre = pymysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] - pyramid: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid[test] + pyramid: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt sqlite3: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] @@ -587,7 +586,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] From e923938646341c2ec54d7ba55cb486b1a2b6e7b7 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 14 Mar 2024 19:53:17 -0600 Subject: [PATCH 135/200] Remove [test] package from starlette instrumentation (#2278) Fixes #2221 --- .../pyproject.toml | 6 ---- .../test-requirements.txt | 31 +++++++++++++++++++ tox.ini | 8 ++--- 3 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index 8b2f2a7014..a73d5b0455 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -35,12 +35,6 @@ dependencies = [ instruments = [ "starlette ~= 0.13.0", ] -test = [ - "opentelemetry-instrumentation-starlette[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "requests ~= 2.23", # needed for testclient - "httpx ~= 0.22", # needed for testclient -] [project.entry-points.opentelemetry_instrumentor] starlette = "opentelemetry.instrumentation.starlette:StarletteInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt new file mode 100644 index 0000000000..1cd21039a7 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt @@ -0,0 +1,31 @@ +anyio==4.3.0 +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +Deprecated==1.2.14 +exceptiongroup==1.2.0 +h11==0.14.0 +httpcore==1.0.4 +httpx==0.27.0 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +requests==2.31.0 +sniffio==1.3.0 +starlette==0.13.8 +tomli==2.0.1 +typing_extensions==4.9.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-asgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-starlette diff --git a/tox.ini b/tox.ini index ac4123f4ce..6c0f00b7c2 100644 --- a/tox.ini +++ b/tox.ini @@ -345,8 +345,8 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - tornado,starlette,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http - starlette,fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi + tornado,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -411,7 +411,7 @@ commands_pre = requests: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] - starlette: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette[test] + starlette: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt system-metrics: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] @@ -561,7 +561,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] From fd6b8f1647e18b9c2be4e45d46ed49b50902923f Mon Sep 17 00:00:00 2001 From: Mario de Frutos Dieguez Date: Fri, 15 Mar 2024 13:07:40 +0100 Subject: [PATCH 136/200] Fix response hook (#2038) Response hook receives a third parameter, Response, and that should be reflected in the _ResponseHook type Co-authored-by: Leighton Chen Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- .../src/opentelemetry/instrumentation/requests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py index 4c198596a2..d0150d57b7 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py @@ -105,7 +105,7 @@ _excluded_urls_from_env = get_excluded_urls("REQUESTS") _RequestHookT = Optional[Callable[[Span, PreparedRequest], None]] -_ResponseHookT = Optional[Callable[[Span, PreparedRequest], None]] +_ResponseHookT = Optional[Callable[[Span, PreparedRequest, Response], None]] # pylint: disable=unused-argument From 7404e69663bb4ee3394f089857d402ae0616a3bf Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 10:38:56 -0600 Subject: [PATCH 137/200] Remove [test] package from fastapi instrumentation (#2289) Fixes #2201 --- .../pyproject.toml | 6 ---- .../test-requirements.txt | 35 +++++++++++++++++++ tox.ini | 7 ++-- 3 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 4df6d3760c..89f1c77e43 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -35,12 +35,6 @@ dependencies = [ instruments = [ "fastapi ~= 0.58", ] -test = [ - "opentelemetry-instrumentation-fastapi[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "requests ~= 2.23", # needed for testclient - "httpx ~= 0.22", # needed for testclient -] [project.entry-points.opentelemetry_instrumentor] fastapi = "opentelemetry.instrumentation.fastapi:FastAPIInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt new file mode 100644 index 0000000000..8d7bf3ad78 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt @@ -0,0 +1,35 @@ +annotated-types==0.6.0 +anyio==4.3.0 +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +Deprecated==1.2.14 +exceptiongroup==1.2.0 +fastapi==0.109.2 +h11==0.14.0 +httpcore==1.0.4 +httpx==0.27.0 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pydantic==2.6.2 +pydantic_core==2.16.3 +pytest==7.1.3 +pytest-benchmark==4.0.0 +requests==2.31.0 +sniffio==1.3.0 +starlette==0.36.3 +tomli==2.0.1 +typing_extensions==4.9.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-asgi +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-fastapi diff --git a/tox.ini b/tox.ini index 6c0f00b7c2..935d46e5f4 100644 --- a/tox.ini +++ b/tox.ini @@ -345,8 +345,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - tornado,fastapi,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http - fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi + tornado,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -385,7 +384,7 @@ commands_pre = pypy3-test-instrumentation-django-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt pypy3-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt - fastapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] + fastapi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt mysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] @@ -574,7 +573,7 @@ commands_pre = ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] From 8d436187981f479b796c38082d3e987dd5eb79a6 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 10:50:17 -0600 Subject: [PATCH 138/200] Remove [test] package from tornado instrumentation (#2280) Fixes #2223 --- .../pyproject.toml | 5 --- .../test-requirements.txt | 32 +++++++++++++++++++ .../tests/test_instrumentation.py | 2 +- tox.ini | 6 ++-- 4 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index 54706b42f2..e56a566410 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -33,11 +33,6 @@ dependencies = [ instruments = [ "tornado >= 5.1.1", ] -test = [ - "opentelemetry-instrumentation-tornado[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "http-server-mock" -] [project.entry-points.opentelemetry_instrumentor] tornado = "opentelemetry.instrumentation.tornado:TornadoInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt new file mode 100644 index 0000000000..9f637278fd --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt @@ -0,0 +1,32 @@ +asgiref==3.7.2 +attrs==23.2.0 +blinker==1.7.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +click==8.1.7 +Deprecated==1.2.14 +Flask==3.0.2 +http_server_mock==1.7 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.5 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +requests==2.31.0 +tomli==2.0.1 +tornado==6.4 +typing_extensions==4.9.0 +urllib3==2.2.1 +Werkzeug==3.0.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-tornado diff --git a/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py b/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py index 0baaa348ab..01cdddceed 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py @@ -528,7 +528,7 @@ def index(): class TestTornadoInstrumentationWithXHeaders(TornadoTest): - def get_httpserver_options(self): + def get_httpserver_options(self): # pylint: disable=no-self-use return {"xheaders": True} def test_xheaders(self): diff --git a/tox.ini b/tox.ini index 935d46e5f4..4ba21be3f8 100644 --- a/tox.ini +++ b/tox.ini @@ -345,7 +345,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - tornado,aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -414,7 +414,7 @@ commands_pre = system-metrics: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] - tornado: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado[test] + tornado: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt tortoiseorm: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] @@ -596,7 +596,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] From 17de1d576558294c2982e08b4c444e88ed3bb41d Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 11:16:35 -0600 Subject: [PATCH 139/200] Remove [test] package from aiohttp-client instrumentation (#2238) Fixes #2183 --- .../pyproject.toml | 4 -- .../test-requirements.txt | 37 +++++++++++++++++++ tox.ini | 8 ++-- 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index 9aac42647a..b7c0e52b7c 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -35,10 +35,6 @@ dependencies = [ instruments = [ "aiohttp ~= 3.0", ] -test = [ - "opentelemetry-instrumentation-aiohttp-client[instruments]", - "http-server-mock" -] [project.entry-points.opentelemetry_instrumentor] aiohttp-client = "opentelemetry.instrumentation.aiohttp_client:AioHttpClientInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt new file mode 100644 index 0000000000..b8ccfd2a50 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -0,0 +1,37 @@ +aiohttp==3.9.3 +aiosignal==1.3.1 +asgiref==3.7.2 +async-timeout==4.0.3 +attrs==23.2.0 +blinker==1.7.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +click==8.1.7 +Deprecated==1.2.14 +Flask==3.0.2 +frozenlist==1.4.1 +http_server_mock==1.7 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.5 +multidict==6.0.5 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +requests==2.31.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==2.2.1 +Werkzeug==3.0.1 +wrapt==1.16.0 +yarl==1.9.4 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-aiohttp-client diff --git a/tox.ini b/tox.ini index 4ba21be3f8..152a1a57f1 100644 --- a/tox.ini +++ b/tox.ini @@ -345,7 +345,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - aiohttp,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + aiohttp-server,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -422,7 +422,9 @@ commands_pre = logging: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] - aiohttp-client: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] + aio-pika-{8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + + aiohttp-client: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt aiohttp-server: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] @@ -581,7 +583,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] From 28f49a56e46e6b06695b8a0613e7018e1d3e5c48 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 11:37:21 -0600 Subject: [PATCH 140/200] Remove [test] package from aiohttp-server instrumentation (#2242) Fixes #2184 --- .../pyproject.toml | 5 ---- .../test-requirements.txt | 27 +++++++++++++++++++ tox.ini | 6 ++--- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index 566f9dbb35..3ea2340d89 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -35,11 +35,6 @@ dependencies = [ instruments = [ "aiohttp ~= 3.0", ] -test = [ - "opentelemetry-instrumentation-aiohttp-server[instruments]", - "pytest-asyncio", - "pytest-aiohttp", -] [project.entry-points.opentelemetry_instrumentor] aiohttp-server = "opentelemetry.instrumentation.aiohttp_server:AioHttpServerInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt new file mode 100644 index 0000000000..9f6d7accce --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt @@ -0,0 +1,27 @@ +aiohttp==3.9.3 +aiosignal==1.3.1 +asgiref==3.7.2 +async-timeout==4.0.3 +attrs==23.2.0 +Deprecated==1.2.14 +frozenlist==1.4.1 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +multidict==6.0.5 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-aiohttp==1.0.5 +pytest-asyncio==0.23.5 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +yarl==1.9.4 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-aiohttp-server diff --git a/tox.ini b/tox.ini index 152a1a57f1..bf2a9dc64c 100644 --- a/tox.ini +++ b/tox.ini @@ -345,7 +345,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - aiohttp-server,httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -426,7 +426,7 @@ commands_pre = aiohttp-client: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt - aiohttp-server: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] + aiohttp-server: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt aiopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt @@ -584,8 +584,8 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] From d1c3cb33dcebfe349c64427e3b2580f12c4795b2 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 12:39:51 -0600 Subject: [PATCH 141/200] Remove [test] package from httpx instrumentation (#2314) Fixes #2203 --- .../pyproject.toml | 5 --- .../test-requirements-0.txt | 28 +++++++++++++ .../test-requirements-1.txt | 27 ++++++++++++ tox.ini | 41 ++++++++++--------- 4 files changed, 76 insertions(+), 25 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index f13fa816bc..1a4da4a520 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -34,11 +34,6 @@ dependencies = [ instruments = [ "httpx >= 0.18.0", ] -test = [ - "opentelemetry-instrumentation-httpx[instruments]", - "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] httpx = "opentelemetry.instrumentation.httpx:HTTPXClientInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt new file mode 100644 index 0000000000..2d3a8399d8 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt @@ -0,0 +1,28 @@ +anyio==3.7.1 +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +Deprecated==1.2.14 +exceptiongroup==1.2.0 +h11==0.12.0 +httpcore==0.13.7 +httpx==0.18.2 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +respx==0.17.1 +rfc3986==1.5.0 +sniffio==1.3.1 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-httpx diff --git a/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt new file mode 100644 index 0000000000..4a36398fc1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt @@ -0,0 +1,27 @@ +anyio==4.3.0 +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +Deprecated==1.2.14 +exceptiongroup==1.2.0 +h11==0.14.0 +httpcore==1.0.4 +httpx==0.27.0 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +respx==0.20.2 +sniffio==1.3.1 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-httpx diff --git a/tox.ini b/tox.ini index bf2a9dc64c..4e5832fbf8 100644 --- a/tox.ini +++ b/tox.ini @@ -221,8 +221,8 @@ envlist = pypy3-test-instrumentation-tortoiseorm ; opentelemetry-instrumentation-httpx - py3{8,9,10,11}-test-instrumentation-httpx-{18,21} - pypy3-test-instrumentation-httpx-{18,21} + py3{8,9,10,11}-test-instrumentation-httpx-{0,1} + pypy3-test-instrumentation-httpx-{0,1} ; opentelemetry-util-http py3{8,9,10,11}-test-util-http @@ -300,10 +300,6 @@ deps = pymemcache-300: pymemcache >3.0.0,<3.4.2 pymemcache-342: pymemcache ==3.4.2 pymemcache-400: pymemcache ==4.0.0 - httpx-18: httpx>=0.18.0,<0.19.0 - httpx-18: respx~=0.17.0 - httpx-21: httpx>=0.19.0 - httpx-21: respx~=0.20.1 urllib3v-1: urllib3 >=1.0.0,<2.0.0 urllib3v-2: urllib3 >=2.0.0,<3.0.0 @@ -345,7 +341,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - httpx-{18,21},requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -422,7 +418,7 @@ commands_pre = logging: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] - aio-pika-{8,9}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika[test] + aio-pika-{0,1,2}: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt aiohttp-client: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -442,7 +438,12 @@ commands_pre = asyncio: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt - httpx-{18,21}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: httpx>=0.18.0,<0.19.0 respx~=0.17.0 + ; 1: httpx>=0.19.0 respx~=0.20.1 + httpx-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt + httpx-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt sdkextension-aws: pip install {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] @@ -472,13 +473,13 @@ commands = test-instrumentation-cassandra: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/tests {posargs} test-instrumentation-celery: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/tests {posargs} test-instrumentation-dbapi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/tests {posargs} - test-instrumentation-django-{1,2,3,4}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-django/tests {posargs} - test-instrumentation-elasticsearch-{2,5,6}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/tests {posargs} - test-instrumentation-falcon-{1,2,3}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/tests {posargs} + test-instrumentation-django: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-django/tests {posargs} + test-instrumentation-elasticsearch: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/tests {posargs} + test-instrumentation-falcon: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/tests {posargs} test-instrumentation-fastapi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/tests {posargs} - test-instrumentation-flask-{213,220,300}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/tests {posargs} + test-instrumentation-flask: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/tests {posargs} test-instrumentation-urllib: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/tests {posargs} - test-instrumentation-urllib3v-{1,2}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/tests {posargs} + test-instrumentation-urllib3v: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/tests {posargs} test-instrumentation-grpc: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/tests {posargs} test-instrumentation-jinja2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/tests {posargs} test-instrumentation-kafka-python: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/tests {posargs} @@ -486,11 +487,11 @@ commands = test-instrumentation-logging: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/tests {posargs} test-instrumentation-mysql: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/tests {posargs} test-instrumentation-mysqlclient: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/tests {posargs} - test-instrumentation-sio-pika-{0,1}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/tests {posargs} - test-instrumentation-aio-pika-{8,9}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/tests {posargs} + test-instrumentation-sio-pika: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/tests {posargs} + test-instrumentation-aio-pika: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/tests {posargs} test-instrumentation-psycopg: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/tests {posargs} test-instrumentation-psycopg2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/tests {posargs} - test-instrumentation-pymemcache-{135,200,300,342,400}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/tests {posargs} + test-instrumentation-pymemcache: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/tests {posargs} test-instrumentation-pymongo: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/tests {posargs} test-instrumentation-pymysql: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql/tests {posargs} test-instrumentation-pyramid: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/tests {posargs} @@ -498,14 +499,14 @@ commands = test-instrumentation-remoulade: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade/tests {posargs} test-instrumentation-requests: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/tests {posargs} test-instrumentation-sklearn: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn/tests {posargs} - test-instrumentation-sqlalchemy-{11,14}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests {posargs} + test-instrumentation-sqlalchemy: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/tests {posargs} test-instrumentation-sqlite3: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/tests {posargs} test-instrumentation-starlette: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/tests {posargs} test-instrumentation-system-metrics: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/tests {posargs} test-instrumentation-tornado: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/tests {posargs} test-instrumentation-tortoiseorm: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/tests {posargs} test-instrumentation-wsgi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/tests {posargs} - test-instrumentation-httpx-{18,21}: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/tests {posargs} + test-instrumentation-httpx: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/tests {posargs} test-instrumentation-asyncio: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/tests {posargs} test-util-http: pytest {toxinidir}/util/opentelemetry-util-http/tests {posargs} test-sdkextension-aws: pytest {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/tests {posargs} @@ -601,7 +602,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt From fbda226a5a781c091edc1482b050dc5165d3badb Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 14:10:12 -0600 Subject: [PATCH 142/200] Remove [test] package from requests instrumentation (#2276) Fixes #2217 --- .../pyproject.toml | 5 ---- .../test-requirements.txt | 24 +++++++++++++++++++ tox.ini | 6 ++--- 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index a4f8255e00..ce83ca93ac 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -34,11 +34,6 @@ dependencies = [ instruments = [ "requests ~= 2.0", ] -test = [ - "opentelemetry-instrumentation-requests[instruments]", - "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] requests = "opentelemetry.instrumentation.requests:RequestsInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt new file mode 100644 index 0000000000..be34594506 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt @@ -0,0 +1,24 @@ +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +Deprecated==1.2.14 +httpretty==1.1.4 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +requests==2.31.0 +tomli==2.0.1 +typing_extensions==4.9.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-requests diff --git a/tox.ini b/tox.ini index 4e5832fbf8..752f506ca6 100644 --- a/tox.ini +++ b/tox.ini @@ -341,7 +341,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - requests,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + ,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -404,7 +404,7 @@ commands_pre = remoulade: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] - requests: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] + requests: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt starlette: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt @@ -589,7 +589,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-requests[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] From 74820251f1f431d48ae2f99d1da1c23b10172040 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 14:33:49 -0600 Subject: [PATCH 143/200] Remove [test] package from urllib instrumentation (#2282) Fixes #2225 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 6 +++--- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index 3fe6d272cb..08a0f90aca 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -32,10 +32,6 @@ dependencies = [ [project.optional-dependencies] instruments = [] -test = [ - "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] urllib = "opentelemetry.instrumentation.urllib:URLLibInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt new file mode 100644 index 0000000000..cdb10df7e9 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +httpretty==1.1.4 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-urllib diff --git a/tox.ini b/tox.ini index 752f506ca6..b59ee8d21b 100644 --- a/tox.ini +++ b/tox.ini @@ -341,7 +341,7 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - ,urllib,urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http + urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -362,7 +362,7 @@ commands_pre = flask-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-1.txt flask-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt - urllib: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] + urllib: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt urllib3v-{1,2}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] @@ -590,7 +590,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install From e30dd1abebd5c93d395c6ec3b4a87949a253fc84 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 14:49:03 -0600 Subject: [PATCH 144/200] Remove [test] package from urllib3 instrumentation (#2316) Fixes #2226 --- .github/workflows/instrumentations_1.yml | 2 +- .../pyproject.toml | 5 ----- .../test-requirements-0.txt | 20 +++++++++++++++++++ .../test-requirements-1.txt | 20 +++++++++++++++++++ tox.ini | 19 +++++++++--------- 5 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 0640c056a6..978642a7a3 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -25,7 +25,7 @@ jobs: python-version: [py38, py39, py310, py311, pypy3] package: - "urllib" - - "urllib3v" + - "urllib3" - "wsgi" - "distro" - "richconsole" diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index fbd27f7bd8..628cb46554 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -35,11 +35,6 @@ dependencies = [ instruments = [ "urllib3 >= 1.0.0, < 3.0.0", ] -test = [ - "opentelemetry-instrumentation-urllib3[instruments]", - "httpretty ~= 1.0", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] urllib3 = "opentelemetry.instrumentation.urllib3:URLLib3Instrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt new file mode 100644 index 0000000000..730ef16977 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt @@ -0,0 +1,20 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +httpretty==1.1.4 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==1.26.18 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-urllib3 diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt new file mode 100644 index 0000000000..1f10502f57 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt @@ -0,0 +1,20 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +httpretty==1.1.4 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e util/opentelemetry-util-http +-e instrumentation/opentelemetry-instrumentation-urllib3 diff --git a/tox.ini b/tox.ini index b59ee8d21b..d7c30a8e7b 100644 --- a/tox.ini +++ b/tox.ini @@ -110,8 +110,12 @@ envlist = pypy3-test-instrumentation-urllib ; opentelemetry-instrumentation-urllib3 - py3{8,9,10,11}-test-instrumentation-urllib3v-{1,2} - pypy3-test-instrumentation-urllib3v-{1,2} + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: urllib3 >=1.0.0,<2.0.0 + ; 1: urllib3 >=2.0.0,<3.0.0 + py3{8,9,10,11}-test-instrumentation-urllib3-{0,1} + pypy3-test-instrumentation-urllib3-{0,1} ; opentelemetry-instrumentation-requests py3{8,9,10,11}-test-instrumentation-requests @@ -300,8 +304,6 @@ deps = pymemcache-300: pymemcache >3.0.0,<3.4.2 pymemcache-342: pymemcache ==3.4.2 pymemcache-400: pymemcache ==4.0.0 - urllib3v-1: urllib3 >=1.0.0,<2.0.0 - urllib3v-2: urllib3 >=2.0.0,<3.0.0 ; FIXME: add coverage testing ; FIXME: add mypy testing @@ -341,8 +343,6 @@ commands_pre = grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] - urllib3v-{1,2}: pip install {toxinidir}/util/opentelemetry-util-http - wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] @@ -364,7 +364,8 @@ commands_pre = urllib: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt - urllib3v-{1,2}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] + urllib3-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt + urllib3-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] @@ -479,7 +480,7 @@ commands = test-instrumentation-fastapi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/tests {posargs} test-instrumentation-flask: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/tests {posargs} test-instrumentation-urllib: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/tests {posargs} - test-instrumentation-urllib3v: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/tests {posargs} + test-instrumentation-urllib3: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/tests {posargs} test-instrumentation-grpc: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/tests {posargs} test-instrumentation-jinja2: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/tests {posargs} test-instrumentation-kafka-python: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/tests {posargs} @@ -591,7 +592,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install # for your OS to install the required dependencies From 0b5e3b4bcd235b2e1dfa7582939417f10b3cf0af Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 15:08:03 -0600 Subject: [PATCH 145/200] Remove [test] package from pymemcache instrumentation (#2310) Fixes #2211 --- .../pyproject.toml | 4 ---- .../test-requirements-0.txt | 19 +++++++++++++++ .../test-requirements-1.txt | 19 +++++++++++++++ .../test-requirements-2.txt | 19 +++++++++++++++ .../test-requirements-3.txt | 19 +++++++++++++++ .../test-requirements-4.txt | 18 ++++++++++++++ tox.ini | 24 ++++++++++++------- 7 files changed, 109 insertions(+), 13 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt create mode 100644 instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt create mode 100644 instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt create mode 100644 instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index e7a642b0aa..e37f566b0b 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -34,10 +34,6 @@ dependencies = [ instruments = [ "pymemcache >= 1.3.5, < 5", ] -test = [ - "opentelemetry-instrumentation-pymemcache[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] pymemcache = "opentelemetry.instrumentation.pymemcache:PymemcacheInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt new file mode 100644 index 0000000000..2e7313ab6e --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pymemcache==1.3.5 +pytest==7.1.3 +pytest-benchmark==4.0.0 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pymemcache diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt new file mode 100644 index 0000000000..a1a3cc4fb1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pymemcache==2.2.2 +pytest==7.1.3 +pytest-benchmark==4.0.0 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pymemcache diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt new file mode 100644 index 0000000000..cb28ea22d7 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pymemcache==3.4.1 +pytest==7.1.3 +pytest-benchmark==4.0.0 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pymemcache diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt new file mode 100644 index 0000000000..40152664ac --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pymemcache==3.4.2 +pytest==7.1.3 +pytest-benchmark==4.0.0 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pymemcache diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt new file mode 100644 index 0000000000..9031276ce4 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pymemcache==4.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pymemcache diff --git a/tox.ini b/tox.ini index d7c30a8e7b..207de15380 100644 --- a/tox.ini +++ b/tox.ini @@ -158,8 +158,15 @@ envlist = pypy3-test-instrumentation-psycopg ; opentelemetry-instrumentation-pymemcache - py3{8,9,10,11}-test-instrumentation-pymemcache-{135,200,300,342,400} - pypy3-test-instrumentation-pymemcache-{135,200,300,342,400} + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: pymemcache ==1.3.5 + ; 1: pymemcache >2.0.0,<3.0.0 + ; 2: pymemcache >3.0.0,<3.4.2 + ; 3: pymemcache ==3.4.2 + ; 4: pymemcache ==4.0.0 + py3{8,9,10,11}-test-instrumentation-pymemcache-{0,1,2,3,4} + pypy3-test-instrumentation-pymemcache-{0,1,2,3,4} ; opentelemetry-instrumentation-pymongo py3{8,9,10,11}-test-instrumentation-pymongo @@ -299,11 +306,6 @@ deps = sqlalchemy-14: sqlalchemy~=1.4 sio-pika-0: pika>=0.12.0,<1.0.0 sio-pika-1: pika>=1.0.0 - pymemcache-135: pymemcache ==1.3.5 - pymemcache-200: pymemcache >2.0.0,<3.0.0 - pymemcache-300: pymemcache >3.0.0,<3.4.2 - pymemcache-342: pymemcache ==3.4.2 - pymemcache-400: pymemcache ==4.0.0 ; FIXME: add coverage testing ; FIXME: add mypy testing @@ -387,7 +389,11 @@ commands_pre = mysqlclient: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] - pymemcache-{135,200,300,342,400}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] + pymemcache-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt + pymemcache-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt + pymemcache-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-2.txt + pymemcache-3: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt + pymemcache-4: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] @@ -582,7 +588,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt From 8f02162221424106f06d7c551f4719e538acdf03 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 15:26:38 -0600 Subject: [PATCH 146/200] Remove [test] package from elasticsearch configuration (#2312) Fixes #3745 --- .../pyproject.toml | 5 --- .../test-requirements-0.txt | 22 +++++++++++++ .../test-requirements-1.txt | 22 +++++++++++++ .../test-requirements-2.txt | 22 +++++++++++++ tox.ini | 31 +++++++++---------- 5 files changed, 80 insertions(+), 22 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt create mode 100644 instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index c716769f5c..987cfb17c1 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -34,11 +34,6 @@ dependencies = [ instruments = [ "elasticsearch >= 2.0", ] -test = [ - "opentelemetry-instrumentation-elasticsearch[instruments]", - "elasticsearch-dsl >= 2.0", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] elasticsearch = "opentelemetry.instrumentation.elasticsearch:ElasticsearchInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt new file mode 100644 index 0000000000..216d1c0b02 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +elasticsearch==2.4.1 +elasticsearch-dsl==2.2.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==1.26.18 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-elasticsearch diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt new file mode 100644 index 0000000000..2c51c87508 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +elasticsearch==5.5.3 +elasticsearch-dsl==5.4.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-elasticsearch diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt new file mode 100644 index 0000000000..4bd1d0d318 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +elasticsearch==6.8.2 +elasticsearch-dsl==6.4.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-elasticsearch diff --git a/tox.ini b/tox.ini index 207de15380..dbd1a8ad15 100644 --- a/tox.ini +++ b/tox.ini @@ -75,10 +75,16 @@ envlist = ; pypy3-test-instrumentation-boto ; opentelemetry-instrumentation-elasticsearch - py3{8,9,10,11}-test-instrumentation-elasticsearch-{2,6} - pypy3-test-instrumentation-elasticsearch-{2,6} - py3{8,9}-test-instrumentation-elasticsearch-5 - pypy3-test-instrumentation-elasticsearch-5 + ; FIXME: Elasticsearch >=7 causes CI workflow tests to hang, see open-telemetry/opentelemetry-python-contrib#620 + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: elasticsearch-dsl>=2.0,<3.0 elasticsearch>=2.0,<3.0 + ; 1: elasticsearch-dsl>=5.0,<6.0 elasticsearch>=5.0,<6.0 + ; 2: elasticsearch-dsl>=6.0,<7.0 elasticsearch>=6.0,<7.0 + py3{8,9,10,11}-test-instrumentation-elasticsearch-{0,2} + pypy3-test-instrumentation-elasticsearch-{0,2} + py3{8,9}-test-instrumentation-elasticsearch-1 + pypy3-test-instrumentation-elasticsearch-1 ; opentelemetry-instrumentation-falcon ; py310 does not work with falcon 1 @@ -289,17 +295,6 @@ deps = test: pytest-benchmark coverage: pytest coverage: pytest-cov - elasticsearch-2: elasticsearch-dsl>=2.0,<3.0 - elasticsearch-2: elasticsearch>=2.0,<3.0 - elasticsearch-5: elasticsearch-dsl>=5.0,<6.0 - elasticsearch-5: elasticsearch>=5.0,<6.0 - elasticsearch-6: elasticsearch-dsl>=6.0,<7.0 - elasticsearch-6: elasticsearch>=6.0,<7.0 - ; FIXME: Elasticsearch >=7 causes CI workflow tests to hang, see open-telemetry/opentelemetry-python-contrib#620 - ; elasticsearch-7: elasticsearch-dsl>=7.0,<8.0 - ; elasticsearch-7: elasticsearch>=7.0,<8.0 - ; elasticsearch-8: elasticsearch-dsl>=8.0,<9.0 - ; elasticsearch-8: elasticsearch>=8.0,<9.0 grpc: pytest-asyncio sqlalchemy-11: sqlalchemy>=1.1,<1.2 sqlalchemy-14: aiosqlite @@ -441,7 +436,9 @@ commands_pre = sqlalchemy-{11,14}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] - elasticsearch-{2,5,6}: pip install {toxinidir}/opentelemetry-instrumentation[test] {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] + elasticsearch-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt + elasticsearch-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt + elasticsearch-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt asyncio: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt @@ -604,7 +601,7 @@ commands_pre = # for your OS to install the required dependencies python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] From 223c79c6174acdb42459de99663166b603075e2f Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Fri, 15 Mar 2024 23:37:18 -0600 Subject: [PATCH 147/200] Remove [test] package from mysqlclient instrumentation (#2295) Fixes #2208 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index de8c31a1f3..7646a9be2b 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -33,10 +33,6 @@ dependencies = [ instruments = [ "mysqlclient < 3", ] -test = [ - "opentelemetry-instrumentation-mysqlclient[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] mysqlclient = "opentelemetry.instrumentation.mysqlclient:MySQLClientInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt new file mode 100644 index 0000000000..afa2ccae6c --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +mysqlclient==2.2.4 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-mysqlclient diff --git a/tox.ini b/tox.ini index dbd1a8ad15..8ac6a4606f 100644 --- a/tox.ini +++ b/tox.ini @@ -382,7 +382,7 @@ commands_pre = mysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] - mysqlclient: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] + mysqlclient: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt pymemcache-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-0.txt pymemcache-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-1.txt @@ -599,7 +599,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install # for your OS to install the required dependencies - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] From 617cae937553817dde303a8ba1ba933ca205917e Mon Sep 17 00:00:00 2001 From: Rodrigo-Novas Date: Mon, 18 Mar 2024 12:29:10 -0300 Subject: [PATCH 148/200] Feature/convention http server duration (#2326) * feat: add http.duration convention * feat: add http.duration convention * feat: replace for the last description version Duration of HTTP client requests * feat: add new description to histogram --- CHANGELOG.md | 3 ++- .../opentelemetry/instrumentation/aiohttp_server/__init__.py | 2 +- .../src/opentelemetry/instrumentation/asgi/__init__.py | 2 +- .../src/opentelemetry/instrumentation/django/__init__.py | 2 +- .../src/opentelemetry/instrumentation/falcon/__init__.py | 2 +- .../src/opentelemetry/instrumentation/flask/__init__.py | 4 ++-- .../src/opentelemetry/instrumentation/pyramid/callbacks.py | 2 +- .../src/opentelemetry/instrumentation/tornado/__init__.py | 2 +- .../src/opentelemetry/instrumentation/wsgi/__init__.py | 2 +- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bbe579232..d1f8850790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -### Fixed - `opentelemetry-instrumentation-celery` Allow Celery instrumentation to be installed multiple times ([#2342](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2342)) - Align gRPC span status codes to OTEL specification ([#1756](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1756)) - `opentelemetry-instrumentation-flask` Add importlib metadata default for deprecation warning flask version ([#2297](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2297)) +- Ensure all http.server.duration metrics have the same description + ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2298)) ## Version 1.23.0/0.44b0 (2024-02-23) diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py index 914f005b2a..c1ab960818 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py @@ -207,7 +207,7 @@ async def middleware(request, handler): duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound HTTP request", + description="Duration of HTTP client requests.", ) active_requests_counter = meter.create_up_down_counter( diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index dba7414cb1..d179f4fafa 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -492,7 +492,7 @@ def __init__( self.duration_histogram = self.meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound HTTP request", + description="Duration of HTTP client requests.", ) self.server_response_size_histogram = self.meter.create_histogram( name=MetricInstruments.HTTP_SERVER_RESPONSE_SIZE, diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py index 583f1adeb6..37ac760283 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py @@ -322,7 +322,7 @@ def _instrument(self, **kwargs): _DjangoMiddleware._duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound http request", + description="Duration of HTTP client requests.", ) _DjangoMiddleware._active_request_counter = meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py index d6cf8249a4..06a550cf3f 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py @@ -268,7 +268,7 @@ def __init__(self, *args, **kwargs): self.duration_histogram = self._otel_meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound HTTP request", + description="Duration of HTTP client requests.", ) self.active_requests_counter = self._otel_meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index a2b85d67f8..ba1031655e 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -506,7 +506,7 @@ def __init__(self, *args, **kwargs): duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound HTTP request", + description="Duration of HTTP client requests.", ) active_requests_counter = meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, @@ -612,7 +612,7 @@ def instrument_app( duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound HTTP request", + description="Duration of HTTP client requests.", ) active_requests_counter = meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py index e3675fcfab..4f17da3da5 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py @@ -140,7 +140,7 @@ def trace_tween_factory(handler, registry): duration_histogram = meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound HTTP request", + description="Duration of HTTP client requests.", ) active_requests_counter = meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py index dfa4b217df..5a39538837 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py @@ -296,7 +296,7 @@ def _create_server_histograms(meter) -> Dict[str, Histogram]: MetricInstruments.HTTP_SERVER_DURATION: meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration outbound HTTP requests", + description="Duration of HTTP client requests.", ), MetricInstruments.HTTP_SERVER_REQUEST_SIZE: meter.create_histogram( name=MetricInstruments.HTTP_SERVER_REQUEST_SIZE, diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py index 87c73cc737..afa1bf2a55 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -507,7 +507,7 @@ def __init__( self.duration_histogram = self.meter.create_histogram( name=MetricInstruments.HTTP_SERVER_DURATION, unit="ms", - description="measures the duration of the inbound HTTP request", + description="Duration of HTTP client requests.", ) self.active_requests_counter = self.meter.create_up_down_counter( name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS, From 6c2e54da6490d4b04497f201d3c9d17537a32bac Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 18 Mar 2024 12:44:02 -0600 Subject: [PATCH 149/200] Remove [test] package from sqlalchemy instrumentation (#2315) Fixes #2219 Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com> --- .../pyproject.toml | 5 ----- .../test-requirements-0.txt | 22 +++++++++++++++++++ .../test-requirements-1.txt | 20 +++++++++++++++++ tox.ini | 16 ++++++++------ 4 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index 1c63d671b7..bf5759e57b 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -35,11 +35,6 @@ dependencies = [ instruments = [ "sqlalchemy", ] -test = [ - "opentelemetry-instrumentation-sqlalchemy[instruments]", - "opentelemetry-sdk ~= 1.12", - "pytest", -] [project.entry-points.opentelemetry_instrumentor] sqlalchemy = "opentelemetry.instrumentation.sqlalchemy:SQLAlchemyInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt new file mode 100644 index 0000000000..26fd283824 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +cffi==1.15.1 +Deprecated==1.2.14 +greenlet==0.4.13 +hpy==0.0.4.dev179+g9b5d200 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +readline==6.2.4.1 +SQLAlchemy==1.1.18 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-sqlalchemy diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt new file mode 100644 index 0000000000..bfb9dac972 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt @@ -0,0 +1,20 @@ +aiosqlite==0.20.0 +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +greenlet==3.0.3 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +SQLAlchemy==1.4.51 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-sqlalchemy diff --git a/tox.ini b/tox.ini index 8ac6a4606f..185ed7cf1c 100644 --- a/tox.ini +++ b/tox.ini @@ -207,8 +207,12 @@ envlist = pypy3-test-instrumentation-grpc ; opentelemetry-instrumentation-sqlalchemy - py3{8,9,10,11}-test-instrumentation-sqlalchemy-{14} - pypy3-test-instrumentation-sqlalchemy-{11,14} + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: sqlalchemy>=1.1,<1.2 + ; 1: sqlalchemy~=1.4 aiosqlite + py3{8,9,10,11}-test-instrumentation-sqlalchemy-{1} + pypy3-test-instrumentation-sqlalchemy-{0,1} ; opentelemetry-instrumentation-redis py3{8,9,10,11}-test-instrumentation-redis @@ -296,9 +300,6 @@ deps = coverage: pytest coverage: pytest-cov grpc: pytest-asyncio - sqlalchemy-11: sqlalchemy>=1.1,<1.2 - sqlalchemy-14: aiosqlite - sqlalchemy-14: sqlalchemy~=1.4 sio-pika-0: pika>=0.12.0,<1.0.0 sio-pika-1: pika>=1.0.0 @@ -434,7 +435,8 @@ commands_pre = sklearn: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] - sqlalchemy-{11,14}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] + sqlalchemy-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt + sqlalchemy-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt elasticsearch-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-0.txt elasticsearch-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-1.txt @@ -572,7 +574,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] From 1782e96b7750aef8b0443ba46ddec7be703cade6 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 18 Mar 2024 13:42:10 -0600 Subject: [PATCH 150/200] Remove [test] package from dbapi instrumentation (#2288) Fixes #2197 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 17 +++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index 3032c12da6..5ae0f09376 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -32,9 +32,6 @@ dependencies = [ [project.optional-dependencies] instruments = [] -test = [ - "opentelemetry-test-utils == 0.45b0.dev", -] [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-dbapi" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt new file mode 100644 index 0000000000..46c02707c1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt @@ -0,0 +1,17 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi diff --git a/tox.ini b/tox.ini index 185ed7cf1c..45bf97bf8b 100644 --- a/tox.ini +++ b/tox.ini @@ -369,7 +369,7 @@ commands_pre = cassandra: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] - dbapi: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] + dbapi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt py3{8,9}-test-instrumentation-django-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-0.txt py3{8,9}-test-instrumentation-django-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-1.txt @@ -564,8 +564,8 @@ commands_pre = python -m pip install -e {toxinidir}/util/opentelemetry-util-http[test] python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt From 9bb73fc4c51f9e395bacf065e78b0a646be05d63 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 18 Mar 2024 16:46:13 -0600 Subject: [PATCH 151/200] Remove [test] package from logging instrumentation (#2293) Fixes #2206 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 17 +++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 518fdb0403..45e29c7026 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -30,9 +30,6 @@ dependencies = [ [project.optional-dependencies] instruments = [] -test = [ - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] logging = "opentelemetry.instrumentation.logging:LoggingInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt new file mode 100644 index 0000000000..f376796169 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt @@ -0,0 +1,17 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-logging diff --git a/tox.ini b/tox.ini index 45bf97bf8b..53406e6f8b 100644 --- a/tox.ini +++ b/tox.ini @@ -419,7 +419,7 @@ commands_pre = jinja2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] - logging: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] + logging: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt aio-pika-{0,1,2}: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt @@ -586,8 +586,8 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-logging[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt From dcffb584c4d3e74fd5bda741294c129df02a4282 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 18 Mar 2024 17:29:07 -0600 Subject: [PATCH 152/200] Remove [test] package from asyncpg instrumentation (#2249) Fixes #2189 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 6 +++--- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index bd9e26bbe4..a1ec427a88 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -33,10 +33,6 @@ dependencies = [ instruments = [ "asyncpg >= 0.12.0", ] -test = [ - "opentelemetry-instrumentation-asyncpg[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] asyncpg = "opentelemetry.instrumentation.asyncpg:AsyncPGInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt new file mode 100644 index 0000000000..02d8fb2041 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +async-timeout==4.0.3 +asyncpg==0.29.0 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-asyncpg diff --git a/tox.ini b/tox.ini index 53406e6f8b..93342e8174 100644 --- a/tox.ini +++ b/tox.ini @@ -343,7 +343,7 @@ commands_pre = wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt - asyncpg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] + asyncpg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt aws-lambda: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] @@ -604,8 +604,8 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt @@ -630,7 +630,7 @@ deps = amqp==5.2.0 asgiref==3.7.2 async-timeout==4.0.3 - asyncpg==0.27.0 + asyncpg==0.29.0 attrs==23.2.0 bcrypt==4.1.2 billiard==4.2.0 From c9832ba2321cb251eaa20cf2cb64b308eff66309 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 19 Mar 2024 18:58:51 +0100 Subject: [PATCH 153/200] instrumentation/django: fix test_trace_parent (#2338) --- .../tests/test_middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py index d7bb1e544f..4d221fae62 100644 --- a/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py @@ -390,7 +390,7 @@ def response_hook(span, request, response): self.assertIsInstance(response_hook_args[2], HttpResponse) self.assertEqual(response_hook_args[2], response) - async def test_trace_parent(self): + def test_trace_parent(self): id_generator = RandomIdGenerator() trace_id = format_trace_id(id_generator.generate_trace_id()) span_id = format_span_id(id_generator.generate_span_id()) @@ -398,7 +398,7 @@ async def test_trace_parent(self): Client().get( "/span_name/1234/", - traceparent=traceparent_value, + HTTP_TRACEPARENT=traceparent_value, ) span = self.memory_exporter.get_finished_spans()[0] From 1b68fdc8c8f6acdf4a477076a3e3d87c2d0f4dfb Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 19 Mar 2024 19:24:25 +0100 Subject: [PATCH 154/200] Psycopg3 sync and async instrumentation (#2146) --- CHANGELOG.md | 4 + .../instrumentation/psycopg/__init__.py | 95 +++++++- .../tests/test_psycopg_integration.py | 208 ++++++++++++++++++ 3 files changed, 304 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1f8850790..0fae8763b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- `opentelemetry-instrumentation-psycopg` Async Instrumentation for psycopg 3.x + ([#2146](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2146)) + +### Fixed - `opentelemetry-instrumentation-celery` Allow Celery instrumentation to be installed multiple times ([#2342](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2342)) - Align gRPC span status codes to OTEL specification diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py index ab473c2fe4..5d7054151a 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/__init__.py @@ -105,8 +105,13 @@ import typing from typing import Collection -import psycopg -from psycopg import Cursor as pg_cursor # pylint: disable=no-name-in-module +import psycopg # pylint: disable=import-self +from psycopg import ( + AsyncCursor as pg_async_cursor, # pylint: disable=import-self,no-name-in-module +) +from psycopg import ( + Cursor as pg_cursor, # pylint: disable=no-name-in-module,import-self +) from psycopg.sql import Composed # pylint: disable=no-name-in-module from opentelemetry.instrumentation import dbapi @@ -151,9 +156,40 @@ def _instrument(self, **kwargs): commenter_options=commenter_options, ) + dbapi.wrap_connect( + __name__, + psycopg.Connection, # pylint: disable=no-member + "connect", + self._DATABASE_SYSTEM, + self._CONNECTION_ATTRIBUTES, + version=__version__, + tracer_provider=tracer_provider, + db_api_integration_factory=DatabaseApiIntegration, + enable_commenter=enable_sqlcommenter, + commenter_options=commenter_options, + ) + dbapi.wrap_connect( + __name__, + psycopg.AsyncConnection, # pylint: disable=no-member + "connect", + self._DATABASE_SYSTEM, + self._CONNECTION_ATTRIBUTES, + version=__version__, + tracer_provider=tracer_provider, + db_api_integration_factory=DatabaseApiAsyncIntegration, + enable_commenter=enable_sqlcommenter, + commenter_options=commenter_options, + ) + def _uninstrument(self, **kwargs): """ "Disable Psycopg instrumentation""" - dbapi.unwrap_connect(psycopg, "connect") + dbapi.unwrap_connect(psycopg, "connect") # pylint: disable=no-member + dbapi.unwrap_connect( + psycopg.Connection, "connect" # pylint: disable=no-member + ) + dbapi.unwrap_connect( + psycopg.AsyncConnection, "connect" # pylint: disable=no-member + ) # TODO(owais): check if core dbapi can do this for all dbapi implementations e.g, pymysql and mysql @staticmethod @@ -204,6 +240,26 @@ def wrapped_connection( return connection +class DatabaseApiAsyncIntegration(dbapi.DatabaseApiIntegration): + async def wrapped_connection( + self, + connect_method: typing.Callable[..., typing.Any], + args: typing.Tuple[typing.Any, typing.Any], + kwargs: typing.Dict[typing.Any, typing.Any], + ): + """Add object proxy to connection object.""" + base_cursor_factory = kwargs.pop("cursor_factory", None) + new_factory_kwargs = {"db_api": self} + if base_cursor_factory: + new_factory_kwargs["base_factory"] = base_cursor_factory + kwargs["cursor_factory"] = _new_cursor_async_factory( + **new_factory_kwargs + ) + connection = await connect_method(*args, **kwargs) + self.get_connection_attributes(connection) + return connection + + class CursorTracer(dbapi.CursorTracer): def get_operation_name(self, cursor, args): if not args: @@ -259,3 +315,36 @@ def callproc(self, *args, **kwargs): ) return TracedCursorFactory + + +def _new_cursor_async_factory( + db_api=None, base_factory=None, tracer_provider=None +): + if not db_api: + db_api = DatabaseApiAsyncIntegration( + __name__, + PsycopgInstrumentor._DATABASE_SYSTEM, + connection_attributes=PsycopgInstrumentor._CONNECTION_ATTRIBUTES, + version=__version__, + tracer_provider=tracer_provider, + ) + base_factory = base_factory or pg_async_cursor + _cursor_tracer = CursorTracer(db_api) + + class TracedCursorAsyncFactory(base_factory): + async def execute(self, *args, **kwargs): + return await _cursor_tracer.traced_execution( + self, super().execute, *args, **kwargs + ) + + async def executemany(self, *args, **kwargs): + return await _cursor_tracer.traced_execution( + self, super().executemany, *args, **kwargs + ) + + async def callproc(self, *args, **kwargs): + return await _cursor_tracer.traced_execution( + self, super().callproc, *args, **kwargs + ) + + return TracedCursorAsyncFactory diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py index d5e4bc65f3..4fbcac6042 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import asyncio import types from unittest import mock @@ -45,6 +46,35 @@ def __exit__(self, *args): return self +class MockAsyncCursor: + def __init__(self, *args, **kwargs): + pass + + # pylint: disable=unused-argument, no-self-use + async def execute(self, query, params=None, throw_exception=False): + if throw_exception: + raise Exception("Test Exception") + + # pylint: disable=unused-argument, no-self-use + async def executemany(self, query, params=None, throw_exception=False): + if throw_exception: + raise Exception("Test Exception") + + # pylint: disable=unused-argument, no-self-use + async def callproc(self, query, params=None, throw_exception=False): + if throw_exception: + raise Exception("Test Exception") + + async def __aenter__(self, *args, **kwargs): + return self + + async def __aexit__(self, *args, **kwargs): + pass + + def close(self): + pass + + class MockConnection: commit = mock.MagicMock(spec=types.MethodType) commit.__name__ = "commit" @@ -64,22 +94,68 @@ def get_dsn_parameters(self): # pylint: disable=no-self-use return {"dbname": "test"} +class MockAsyncConnection: + commit = mock.MagicMock(spec=types.MethodType) + commit.__name__ = "commit" + + rollback = mock.MagicMock(spec=types.MethodType) + rollback.__name__ = "rollback" + + def __init__(self, *args, **kwargs): + self.cursor_factory = kwargs.pop("cursor_factory", None) + + @staticmethod + async def connect(*args, **kwargs): + return MockAsyncConnection(**kwargs) + + def cursor(self): + if self.cursor_factory: + cur = self.cursor_factory(self) + return cur + return MockAsyncCursor() + + def get_dsn_parameters(self): # pylint: disable=no-self-use + return {"dbname": "test"} + + async def __aenter__(self): + return self + + async def __aexit__(self, *args): + return mock.MagicMock(spec=types.MethodType) + + class TestPostgresqlIntegration(TestBase): def setUp(self): super().setUp() self.cursor_mock = mock.patch( "opentelemetry.instrumentation.psycopg.pg_cursor", MockCursor ) + self.cursor_async_mock = mock.patch( + "opentelemetry.instrumentation.psycopg.pg_async_cursor", + MockAsyncCursor, + ) self.connection_mock = mock.patch("psycopg.connect", MockConnection) + self.connection_sync_mock = mock.patch( + "psycopg.Connection.connect", MockConnection + ) + self.connection_async_mock = mock.patch( + "psycopg.AsyncConnection.connect", MockAsyncConnection.connect + ) self.cursor_mock.start() + self.cursor_async_mock.start() self.connection_mock.start() + self.connection_sync_mock.start() + self.connection_async_mock.start() def tearDown(self): super().tearDown() self.memory_exporter.clear() self.cursor_mock.stop() + self.cursor_async_mock.stop() self.connection_mock.stop() + self.connection_sync_mock.stop() + self.connection_async_mock.stop() with self.disable_logging(): PsycopgInstrumentor().uninstrument() @@ -114,6 +190,91 @@ def test_instrumentor(self): spans_list = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans_list), 1) + # pylint: disable=unused-argument + def test_instrumentor_with_connection_class(self): + PsycopgInstrumentor().instrument() + + cnx = psycopg.Connection.connect(database="test") + + cursor = cnx.cursor() + + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.psycopg + ) + + # check that no spans are generated after uninstrument + PsycopgInstrumentor().uninstrument() + + cnx = psycopg.Connection.connect(database="test") + cursor = cnx.cursor() + query = "SELECT * FROM test" + cursor.execute(query) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + async def test_wrap_async_connection_class_with_cursor(self): + PsycopgInstrumentor().instrument() + + async def test_async_connection(): + acnx = await psycopg.AsyncConnection.connect(database="test") + async with acnx as cnx: + async with cnx.cursor() as cursor: + await cursor.execute("SELECT * FROM test") + + asyncio.run(test_async_connection()) + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.psycopg + ) + + # check that no spans are generated after uninstrument + PsycopgInstrumentor().uninstrument() + + asyncio.run(test_async_connection()) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + + # pylint: disable=unused-argument + async def test_instrumentor_with_async_connection_class(self): + PsycopgInstrumentor().instrument() + + async def test_async_connection(): + acnx = await psycopg.AsyncConnection.connect(database="test") + async with acnx as cnx: + await cnx.execute("SELECT * FROM test") + + asyncio.run(test_async_connection()) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.psycopg + ) + + # check that no spans are generated after uninstrument + PsycopgInstrumentor().uninstrument() + asyncio.run(test_async_connection()) + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 1) + def test_span_name(self): PsycopgInstrumentor().instrument() @@ -140,6 +301,33 @@ def test_span_name(self): self.assertEqual(spans_list[4].name, "query") self.assertEqual(spans_list[5].name, "query") + async def test_span_name_async(self): + PsycopgInstrumentor().instrument() + + cnx = psycopg.AsyncConnection.connect(database="test") + async with cnx.cursor() as cursor: + await cursor.execute("Test query", ("param1Value", False)) + await cursor.execute( + """multi + line + query""" + ) + await cursor.execute("tab\tseparated query") + await cursor.execute("/* leading comment */ query") + await cursor.execute( + "/* leading comment */ query /* trailing comment */" + ) + await cursor.execute("query /* trailing comment */") + + spans_list = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans_list), 6) + self.assertEqual(spans_list[0].name, "Test") + self.assertEqual(spans_list[1].name, "multi") + self.assertEqual(spans_list[2].name, "tab") + self.assertEqual(spans_list[3].name, "query") + self.assertEqual(spans_list[4].name, "query") + self.assertEqual(spans_list[5].name, "query") + # pylint: disable=unused-argument def test_not_recording(self): mock_tracer = mock.Mock() @@ -160,6 +348,26 @@ def test_not_recording(self): PsycopgInstrumentor().uninstrument() + # pylint: disable=unused-argument + async def test_not_recording_async(self): + mock_tracer = mock.Mock() + mock_span = mock.Mock() + mock_span.is_recording.return_value = False + mock_tracer.start_span.return_value = mock_span + PsycopgInstrumentor().instrument() + with mock.patch("opentelemetry.trace.get_tracer") as tracer: + tracer.return_value = mock_tracer + cnx = psycopg.AsyncConnection.connect(database="test") + async with cnx.cursor() as cursor: + query = "SELECT * FROM test" + cursor.execute(query) + self.assertFalse(mock_span.is_recording()) + self.assertTrue(mock_span.is_recording.called) + self.assertFalse(mock_span.set_attribute.called) + self.assertFalse(mock_span.set_status.called) + + PsycopgInstrumentor().uninstrument() + # pylint: disable=unused-argument def test_custom_tracer_provider(self): resource = resources.Resource.create({}) From 78424fa98538dde0a83acaf2aa0d1837089513b0 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 19 Mar 2024 15:38:18 -0600 Subject: [PATCH 155/200] Skip celery test case if running in PyPy (#2349) Fixes #2348 Co-authored-by: Leighton Chen --- .../tests/test_metrics.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py index 01c9487ea8..f83759317b 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py +++ b/instrumentation/opentelemetry-instrumentation-celery/tests/test_metrics.py @@ -1,7 +1,10 @@ import threading import time +from platform import python_implementation from timeit import default_timer +from pytest import mark + from opentelemetry.instrumentation.celery import CeleryInstrumentor from opentelemetry.test.test_base import TestBase @@ -62,6 +65,9 @@ def test_basic_metric(self): est_value_delta=200, ) + @mark.skipif( + python_implementation() == "PyPy", reason="Fails randomly in pypy" + ) def test_metric_uninstrument(self): CeleryInstrumentor().instrument() From 11812b190a4427cb56c2747323b64a6259d59b57 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 19 Mar 2024 16:01:01 -0600 Subject: [PATCH 156/200] Remove [test] package from aws-lambda instrumentation (#2250) Fixes #2190 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 6ab6e23ffc..70e1169eff 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -28,9 +28,6 @@ dependencies = [ [project.optional-dependencies] instruments = [] -test = [ - "opentelemetry-test-utils == 0.45b0.dev", -] [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aws-lambda" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt new file mode 100644 index 0000000000..53e5b9ce6f --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e propagator/opentelemetry-propagator-aws-xray +-e instrumentation/opentelemetry-instrumentation-aws-lambda diff --git a/tox.ini b/tox.ini index 93342e8174..011d4f48b5 100644 --- a/tox.ini +++ b/tox.ini @@ -345,7 +345,7 @@ commands_pre = asyncpg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt - aws-lambda: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] + aws-lambda: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] @@ -609,7 +609,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] From 5e1e866ec1ff93f399465793e2f0013e2d2b773c Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Tue, 19 Mar 2024 18:02:02 -0600 Subject: [PATCH 157/200] Remove [test] package from cassandra instrumentation (#2285) Fixes #2194 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 23 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index 9088332425..c320f70aa9 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -35,10 +35,6 @@ instruments = [ "cassandra-driver ~= 3.25", "scylla-driver ~= 3.25", ] -test = [ - "opentelemetry-instrumentation-cassandra[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] cassandra = "opentelemetry.instrumentation.cassandra:CassandraInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt new file mode 100644 index 0000000000..f55190171d --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt @@ -0,0 +1,23 @@ +asgiref==3.7.2 +attrs==23.2.0 +cassandra-driver==3.29.0 +click==8.1.7 +Deprecated==1.2.14 +geomet==0.2.1.post1 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +PyYAML==6.0.1 +scylla-driver==3.26.6 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-cassandra diff --git a/tox.ini b/tox.ini index 011d4f48b5..3118bba42c 100644 --- a/tox.ini +++ b/tox.ini @@ -367,7 +367,7 @@ commands_pre = botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] - cassandra: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] + cassandra: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt dbapi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt @@ -575,7 +575,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt From ef7125000a729d51c5f307ae5d9f860509da90ed Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 10:10:15 -0600 Subject: [PATCH 158/200] Remove [test] package from botocore instrumentation (#2284) Fixes #2193 --- .../pyproject.toml | 1 + .../pyproject.toml | 7 -- .../test-requirements.txt | 70 +++++++++++++++++++ tox.ini | 5 +- 4 files changed, 73 insertions(+), 10 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 307a96e5aa..4a1f30175e 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -38,6 +38,7 @@ test = [ "markupsafe==2.0.1", "moto~=2.0", "opentelemetry-test-utils == 0.45b0.dev", + "docker==7.0.0" ] [project.entry-points.opentelemetry_instrumentor] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index cd8add1aa7..d6584078ed 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -34,13 +34,6 @@ dependencies = [ instruments = [ "botocore ~= 1.0", ] -test = [ - "opentelemetry-instrumentation-botocore[instruments]", - "markupsafe==2.0.1", - "botocore ~= 1.0, < 1.31.81", - "moto[all] ~= 2.2.6", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] botocore = "opentelemetry.instrumentation.botocore:BotocoreInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt new file mode 100644 index 0000000000..9dcf9f9c0d --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt @@ -0,0 +1,70 @@ +annotated-types==0.6.0 +asgiref==3.7.2 +attrs==23.2.0 +aws-sam-translator==1.85.0 +aws-xray-sdk==2.12.1 +boto3==1.28.80 +botocore==1.31.80 +certifi==2024.2.2 +cffi==1.16.0 +cfn-lint==0.85.2 +charset-normalizer==3.3.2 +cryptography==42.0.5 +Deprecated==1.2.14 +docker==7.0.0 +ecdsa==0.18.0 +idna==3.6 +importlib-metadata==6.11.0 +importlib-resources==6.1.1 +iniconfig==2.0.0 +Jinja2==3.1.3 +jmespath==1.0.1 +jschema-to-python==1.2.3 +jsondiff==2.0.0 +jsonpatch==1.33 +jsonpickle==3.0.3 +jsonpointer==2.4 +jsonschema==4.21.1 +jsonschema-specifications==2023.12.1 +junit-xml==1.9 +MarkupSafe==2.0.1 +moto==2.2.20 +mpmath==1.3.0 +networkx==3.1 +packaging==23.2 +pbr==6.0.0 +pkgutil_resolve_name==1.3.10 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pyasn1==0.5.1 +pycparser==2.21 +pydantic==2.6.2 +pydantic_core==2.16.3 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +python-jose==3.3.0 +pytz==2024.1 +PyYAML==6.0.1 +referencing==0.33.0 +regex==2023.12.25 +requests==2.31.0 +responses==0.25.0 +rpds-py==0.18.0 +rsa==4.9 +s3transfer==0.7.0 +sarif-om==1.0.4 +six==1.16.0 +sshpubkeys==3.3.1 +sympy==1.12 +tomli==2.0.1 +typing_extensions==4.9.0 +urllib3==1.26.18 +Werkzeug==2.1.2 +wrapt==1.16.0 +xmltodict==0.13.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e propagator/opentelemetry-propagator-aws-xray +-e instrumentation/opentelemetry-instrumentation-botocore diff --git a/tox.ini b/tox.ini index 3118bba42c..e5db2cd77f 100644 --- a/tox.ini +++ b/tox.ini @@ -347,7 +347,6 @@ commands_pre = aws-lambda: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt - boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] boto3sqs: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] @@ -365,7 +364,7 @@ commands_pre = urllib3-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-0.txt urllib3-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt - botocore: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] + botocore: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt cassandra: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt @@ -566,7 +565,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt From a8e57bfbb8362a33781371cb4639a3e779343abf Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 10:27:22 -0600 Subject: [PATCH 159/200] Remove [test] package from celery instrumentation (#2286) Fixes #2195 --- .../pyproject.toml | 5 --- .../test-requirements-0.txt | 32 +++++++++++++++++++ .../test-requirements-1.txt | 31 ++++++++++++++++++ tox.ini | 6 ++-- 4 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index ea866d4b4b..e789b54b3f 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -33,11 +33,6 @@ dependencies = [ instruments = [ "celery >= 4.0, < 6.0", ] -test = [ - "opentelemetry-instrumentation-celery[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "pytest", -] [project.entry-points.opentelemetry_instrumentor] celery = "opentelemetry.instrumentation.celery:CeleryInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt new file mode 100644 index 0000000000..98c661ca67 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt @@ -0,0 +1,32 @@ +amqp==5.2.0 +asgiref==3.7.2 +attrs==23.2.0 +backports.zoneinfo==0.2.1 +billiard==4.2.0 +celery==5.3.6 +click==8.1.7 +click-didyoumean==0.3.0 +click-plugins==1.1.1 +click-repl==0.3.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +kombu==5.3.5 +packaging==23.2 +pluggy==1.4.0 +prompt-toolkit==3.0.43 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.9.0 +tzdata==2024.1 +vine==5.1.0 +wcwidth==0.2.13 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-celery diff --git a/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt new file mode 100644 index 0000000000..516e1a78b9 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt @@ -0,0 +1,31 @@ +amqp==5.2.0 +asgiref==3.7.2 +attrs==23.2.0 +billiard==4.2.0 +celery==5.3.6 +click==8.1.7 +click-didyoumean==0.3.0 +click-plugins==1.1.1 +click-repl==0.3.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +kombu==5.3.5 +packaging==23.2 +pluggy==1.4.0 +prompt-toolkit==3.0.43 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.9.0 +tzdata==2024.1 +vine==5.1.0 +wcwidth==0.2.13 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-celery diff --git a/tox.ini b/tox.ini index e5db2cd77f..14b81e3bf0 100644 --- a/tox.ini +++ b/tox.ini @@ -327,7 +327,9 @@ commands_pre = asgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt - celery: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] + py3{8,9}-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-0.txt + py3{10,11}-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt + pypy3-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt sio-pika-{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] @@ -575,7 +577,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-celery[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] From 51c78bf3a8306bf2a0a2a144eefc56676dc718ee Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 11:40:37 -0600 Subject: [PATCH 160/200] Remove [test] package from grpc instrumentation (#2290) Fixes #2202 --- .../pyproject.toml | 6 ------ .../test-requirements.txt | 20 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 8373feaa40..056592dd42 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -35,12 +35,6 @@ dependencies = [ instruments = [ "grpcio ~= 1.27", ] -test = [ - "opentelemetry-instrumentation-grpc[instruments]", - "opentelemetry-sdk ~= 1.12", - "opentelemetry-test-utils == 0.45b0.dev", - "protobuf ~= 3.13", -] [project.entry-points.opentelemetry_instrumentor] grpc_client = "opentelemetry.instrumentation.grpc:GrpcInstrumentorClient" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt new file mode 100644 index 0000000000..56d47af0df --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt @@ -0,0 +1,20 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +grpcio==1.62.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +protobuf==3.20.3 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-asyncio==0.23.5 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-grpc diff --git a/tox.ini b/tox.ini index 14b81e3bf0..d55243e8cb 100644 --- a/tox.ini +++ b/tox.ini @@ -341,7 +341,7 @@ commands_pre = confluent-kafka: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] - grpc: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] + grpc: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt wsgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt @@ -571,8 +571,8 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt From 70d9b3d9eab77a96de7d32586178bd612655b9c2 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 12:02:34 -0600 Subject: [PATCH 161/200] Remove [test] package from jinja2 instrumentation (#2291) Fixes #2204 --- .../pyproject.toml | 5 ----- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index c3648a2922..9bde62464a 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -33,11 +33,6 @@ dependencies = [ instruments = [ "jinja2 >= 2.7, < 4.0", ] -test = [ - "opentelemetry-instrumentation-jinja2[instruments]", - "markupsafe==2.0.1", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] jinja2 = "opentelemetry.instrumentation.jinja2:Jinja2Instrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt new file mode 100644 index 0000000000..d8ab59ac2d --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +Jinja2==3.1.3 +MarkupSafe==2.0.1 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-jinja2 diff --git a/tox.ini b/tox.ini index d55243e8cb..adf2f1fcd9 100644 --- a/tox.ini +++ b/tox.ini @@ -418,7 +418,7 @@ commands_pre = tortoiseorm: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] - jinja2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] + jinja2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt logging: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt @@ -584,7 +584,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt From ab97e07eefcf4bc6b21914a692e0632f06811afd Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 14:30:38 -0600 Subject: [PATCH 162/200] Remove [test] package from kafka-python instrumentation (#2292) Fixes #2205 --- .../pyproject.toml | 5 ----- .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index b303a61a5c..ba04c2467e 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -33,11 +33,6 @@ dependencies = [ instruments = [ "kafka-python >= 2.0", ] -test = [ - "opentelemetry-instrumentation-kafka-python[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "wrapt >= 1.0.0, < 2.0.0", -] [project.entry-points.opentelemetry_instrumentor] kafka = "opentelemetry.instrumentation.kafka:KafkaInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt new file mode 100644 index 0000000000..96bef86dbe --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +kafka-python==2.0.2 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-kafka-python diff --git a/tox.ini b/tox.ini index adf2f1fcd9..8950af3e6e 100644 --- a/tox.ini +++ b/tox.ini @@ -337,7 +337,7 @@ commands_pre = aio-pika-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt aio-pika-2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt - kafka-python: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] + kafka-python: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt confluent-kafka: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] @@ -585,7 +585,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt From 801dcedcb86e2df095f587fc6a3fe1a14938a88b Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 14:47:09 -0600 Subject: [PATCH 163/200] Remove [test] package from boto instrumentation (#2251) Fixes #2191 --- .../pyproject.toml | 7 -- .../test-requirements.txt | 71 +++++++++++++++++++ tox.ini | 4 +- 3 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index 4a1f30175e..dd4dd690e8 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -33,13 +33,6 @@ dependencies = [ instruments = [ "boto~=2.0", ] -test = [ - "opentelemetry-instrumentation-boto[instruments]", - "markupsafe==2.0.1", - "moto~=2.0", - "opentelemetry-test-utils == 0.45b0.dev", - "docker==7.0.0" -] [project.entry-points.opentelemetry_instrumentor] boto = "opentelemetry.instrumentation.boto:BotoInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt new file mode 100644 index 0000000000..92c356ebe1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt @@ -0,0 +1,71 @@ +annotated-types==0.6.0 +asgiref==3.7.2 +attrs==23.2.0 +aws-sam-translator==1.85.0 +aws-xray-sdk==2.12.1 +boto==2.49.0 +boto3==1.34.44 +botocore==1.34.44 +certifi==2024.2.2 +cffi==1.16.0 +cfn-lint==0.85.2 +charset-normalizer==3.3.2 +cryptography==42.0.3 +Deprecated==1.2.14 +docker==7.0.0 +ecdsa==0.18.0 +graphql-core==3.2.3 +idna==3.6 +importlib-metadata==6.11.0 +importlib-resources==6.1.1 +iniconfig==2.0.0 +Jinja2==3.1.3 +jmespath==1.0.1 +jschema-to-python==1.2.3 +jsondiff==2.0.0 +jsonpatch==1.33 +jsonpickle==3.0.2 +jsonpointer==2.4 +jsonschema==4.21.1 +jsonschema-specifications==2023.12.1 +junit-xml==1.9 +MarkupSafe==2.1.5 +moto==2.3.2 +mpmath==1.3.0 +networkx==3.1 +packaging==23.2 +pbr==6.0.0 +pkgutil_resolve_name==1.3.10 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pyasn1==0.5.1 +pycparser==2.21 +pydantic==2.6.1 +pydantic_core==2.16.2 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +python-jose==3.3.0 +pytz==2024.1 +PyYAML==6.0.1 +referencing==0.33.0 +regex==2023.12.25 +requests==2.31.0 +responses==0.25.0 +rpds-py==0.18.0 +rsa==4.9 +s3transfer==0.10.0 +sarif-om==1.0.4 +six==1.16.0 +sshpubkeys==3.3.1 +sympy==1.12 +tomli==2.0.1 +typing_extensions==4.9.0 +urllib3==1.26.18 +Werkzeug==3.0.1 +wrapt==1.16.0 +xmltodict==0.13.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-boto diff --git a/tox.ini b/tox.ini index 8950af3e6e..6bad2f5e06 100644 --- a/tox.ini +++ b/tox.ini @@ -349,7 +349,7 @@ commands_pre = aws-lambda: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt - boto: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] + boto: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt boto3sqs: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] @@ -573,11 +573,11 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-flask/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] From fc864fe99aecdae35268e4011ef64ec22a19e22f Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 15:31:58 -0600 Subject: [PATCH 164/200] Remove [test] package from mysql instrumentation (#2294) Fixes #2207 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index 7f7b703266..f3c673c3d2 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -33,10 +33,6 @@ dependencies = [ instruments = [ "mysql-connector-python ~= 8.0", ] -test = [ - "opentelemetry-instrumentation-mysql[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] mysql = "opentelemetry.instrumentation.mysql:MySQLInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt new file mode 100644 index 0000000000..f113b768b1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +mysql-connector-python==8.3.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-mysql diff --git a/tox.ini b/tox.ini index 6bad2f5e06..7466b54e00 100644 --- a/tox.ini +++ b/tox.ini @@ -382,7 +382,7 @@ commands_pre = fastapi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt - mysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] + mysql: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt mysqlclient: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt @@ -608,9 +608,9 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] From ca8daea8bf0cb1ed941911270c45ec2840da1bfa Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 17:49:08 -0600 Subject: [PATCH 165/200] Remove [test] package from psycopg2 instrumentation (#2307) Fixes #2210 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index a300fa9fdd..26873924e4 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -33,10 +33,6 @@ dependencies = [ instruments = [ "psycopg2 >= 2.7.3.1", ] -test = [ - "opentelemetry-instrumentation-psycopg2[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] psycopg2 = "opentelemetry.instrumentation.psycopg2:Psycopg2Instrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt new file mode 100644 index 0000000000..ade3b5fd26 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +psycopg2==2.9.9 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-psycopg2 diff --git a/tox.ini b/tox.ini index 7466b54e00..40ddff3f7a 100644 --- a/tox.ini +++ b/tox.ini @@ -396,7 +396,7 @@ commands_pre = psycopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] - psycopg2: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] + psycopg2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt pymysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] @@ -590,10 +590,10 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt From b84d779104b8c511ae7b876f5a9f0db3f21654e6 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 20 Mar 2024 18:51:55 -0600 Subject: [PATCH 166/200] Remove [test] package from pymongo instrumentation (#2269) Fixes #2212 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index 6df765bfe0..eca94e5c6c 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -33,10 +33,6 @@ dependencies = [ instruments = [ "pymongo >= 3.1, < 5.0", ] -test = [ - "opentelemetry-instrumentation-pymongo[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] pymongo = "opentelemetry.instrumentation.pymongo:PymongoInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt new file mode 100644 index 0000000000..01d48e8dc4 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +dnspython==2.6.1 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pymongo==4.6.2 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pymongo diff --git a/tox.ini b/tox.ini index 40ddff3f7a..54bd2d19bd 100644 --- a/tox.ini +++ b/tox.ini @@ -392,7 +392,7 @@ commands_pre = pymemcache-3: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-3.txt pymemcache-4: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt - pymongo: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] + pymongo: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt psycopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] @@ -603,10 +603,10 @@ commands_pre = # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install # for your OS to install the required dependencies pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-elasticsearch/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt From 5207a784608717de95805b73dabfdaf934741650 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 21 Mar 2024 17:30:54 +0000 Subject: [PATCH 167/200] avoid losing repeated HTTP headers (#2266) * avoid loosing repeated HTTP headers * fix fof wsgi, test in falcon * add changelog * add more tests * linting * fix falcon and flask * remove unused test --------- Co-authored-by: Leighton Chen Co-authored-by: Diego Hurtado --- CHANGELOG.md | 2 + .../instrumentation/asgi/__init__.py | 18 ++++-- .../tests/test_asgi_custom_headers.py | 55 +++++++++++++++++++ .../tests/base_test.py | 11 ++++ .../tests/test_programmatic.py | 31 +++++++++++ .../instrumentation/wsgi/__init__.py | 8 ++- .../tests/test_wsgi_middleware.py | 32 +++++++++++ 7 files changed, 149 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fae8763b7..8797b9992a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2297](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2297)) - Ensure all http.server.duration metrics have the same description ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2298)) +- Avoid losing repeated HTTP headers + ([#2266](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2266)) ## Version 1.23.0/0.44b0 (2024-02-23) diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index d179f4fafa..d28d85f975 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -195,7 +195,7 @@ def client_response_hook(span: Span, message: dict): import urllib from functools import wraps from timeit import default_timer -from typing import Any, Awaitable, Callable, Tuple, cast +from typing import Any, Awaitable, Callable, Tuple from asgiref.compatibility import guarantee_single_callable @@ -347,11 +347,17 @@ def collect_custom_headers_attributes( - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-request-and-response-headers """ # Decode headers before processing. - headers: dict[str, str] = { - _key.decode("utf8"): _value.decode("utf8") - for (_key, _value) in scope_or_response_message.get("headers") - or cast("list[tuple[bytes, bytes]]", []) - } + headers: dict[str, str] = {} + raw_headers = scope_or_response_message.get("headers") + if raw_headers: + for _key, _value in raw_headers: + key = _key.decode().lower() + value = _value.decode() + if key in headers: + headers[key] += f",{value}" + else: + headers[key] = value + return sanitize.sanitize_header_values( headers, header_regexes, diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py index c50839f72f..7a9c91a3e7 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_custom_headers.py @@ -40,6 +40,24 @@ async def http_app_with_custom_headers(scope, receive, send): await send({"type": "http.response.body", "body": b"*"}) +async def http_app_with_repeat_headers(scope, receive, send): + message = await receive() + assert scope["type"] == "http" + if message.get("type") == "http.request": + await send( + { + "type": "http.response.start", + "status": 200, + "headers": [ + (b"Content-Type", b"text/plain"), + (b"custom-test-header-1", b"test-header-value-1"), + (b"custom-test-header-1", b"test-header-value-2"), + ], + } + ) + await send({"type": "http.response.body", "body": b"*"}) + + async def websocket_app_with_custom_headers(scope, receive, send): assert scope["type"] == "websocket" while True: @@ -121,6 +139,25 @@ def test_http_custom_request_headers_in_span_attributes(self): if span.kind == SpanKind.SERVER: self.assertSpanHasAttributes(span, expected) + def test_http_repeat_request_headers_in_span_attributes(self): + self.scope["headers"].extend( + [ + (b"custom-test-header-1", b"test-header-value-1"), + (b"custom-test-header-1", b"test-header-value-2"), + ] + ) + self.seed_app(self.app) + self.send_default_request() + self.get_all_output() + span_list = self.exporter.get_finished_spans() + expected = { + "http.request.header.custom_test_header_1": ( + "test-header-value-1,test-header-value-2", + ), + } + span = next(span for span in span_list if span.kind == SpanKind.SERVER) + self.assertSpanHasAttributes(span, expected) + def test_http_custom_request_headers_not_in_span_attributes(self): self.scope["headers"].extend( [ @@ -176,6 +213,24 @@ def test_http_custom_response_headers_in_span_attributes(self): if span.kind == SpanKind.SERVER: self.assertSpanHasAttributes(span, expected) + def test_http_repeat_response_headers_in_span_attributes(self): + self.app = otel_asgi.OpenTelemetryMiddleware( + http_app_with_repeat_headers, + tracer_provider=self.tracer_provider, + **self.constructor_params, + ) + self.seed_app(self.app) + self.send_default_request() + self.get_all_output() + span_list = self.exporter.get_finished_spans() + expected = { + "http.response.header.custom_test_header_1": ( + "test-header-value-1,test-header-value-2", + ), + } + span = next(span for span in span_list if span.kind == SpanKind.SERVER) + self.assertSpanHasAttributes(span, expected) + def test_http_custom_response_headers_not_in_span_attributes(self): self.app = otel_asgi.OpenTelemetryMiddleware( http_app_with_custom_headers, diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py b/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py index 6117521bb9..3c8073f261 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/base_test.py @@ -88,6 +88,14 @@ def _custom_response_headers(): resp.headers["my-secret-header"] = "my-secret-value" return resp + @staticmethod + def _repeat_custom_response_headers(): + headers = { + "content-type": "text/plain; charset=utf-8", + "my-custom-header": ["my-custom-value-1", "my-custom-header-2"], + } + return flask.Response("test response", headers=headers) + def _common_initialization(self): def excluded_endpoint(): return "excluded" @@ -106,6 +114,9 @@ def excluded2_endpoint(): self.app.route("/test_custom_response_headers")( self._custom_response_headers ) + self.app.route("/test_repeat_custom_response_headers")( + self._repeat_custom_response_headers + ) # pylint: disable=attribute-defined-outside-init self.client = Client(self.app, Response) diff --git a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py index 3bd2f74ba8..dec265907f 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py +++ b/instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py @@ -671,6 +671,22 @@ def test_custom_request_header_added_in_server_span(self): self.assertEqual(span.kind, trace.SpanKind.SERVER) self.assertSpanHasAttributes(span, expected) + def test_repeat_custom_request_header_added_in_server_span(self): + headers = [ + ("Custom-Test-Header-1", "Test Value 1"), + ("Custom-Test-Header-1", "Test Value 2"), + ] + resp = self.client.get("/hello/123", headers=headers) + self.assertEqual(200, resp.status_code) + span = self.memory_exporter.get_finished_spans()[0] + expected = { + "http.request.header.custom_test_header_1": ( + "Test Value 1, Test Value 2", + ), + } + self.assertEqual(span.kind, trace.SpanKind.SERVER) + self.assertSpanHasAttributes(span, expected) + def test_custom_request_header_not_added_in_internal_span(self): tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("test", kind=trace.SpanKind.SERVER): @@ -724,6 +740,21 @@ def test_custom_response_header_added_in_server_span(self): self.assertEqual(span.kind, trace.SpanKind.SERVER) self.assertSpanHasAttributes(span, expected) + def test_repeat_custom_response_header_added_in_server_span(self): + resp = self.client.get("/test_repeat_custom_response_headers") + self.assertEqual(resp.status_code, 200) + span = self.memory_exporter.get_finished_spans()[0] + expected = { + "http.response.header.content_type": ( + "text/plain; charset=utf-8", + ), + "http.response.header.my_custom_header": ( + "my-custom-value-1,my-custom-header-2", + ), + } + self.assertEqual(span.kind, trace.SpanKind.SERVER) + self.assertSpanHasAttributes(span, expected) + def test_custom_response_header_not_added_in_internal_span(self): tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("test", kind=trace.SpanKind.SERVER): diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py index afa1bf2a55..50d4f03dff 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -358,7 +358,6 @@ def collect_custom_request_headers_attributes(environ): OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SANITIZE_FIELDS ) ) - headers = { key[_CARRIER_KEY_PREFIX_LEN:].replace("_", "-"): val for key, val in environ.items() @@ -387,7 +386,12 @@ def collect_custom_response_headers_attributes(response_headers): ) response_headers_dict = {} if response_headers: - response_headers_dict = dict(response_headers) + for key, val in response_headers: + key = key.lower() + if key in response_headers_dict: + response_headers_dict[key] += "," + val + else: + response_headers_dict[key] = val return sanitize.sanitize_header_values( response_headers_dict, diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py index d71e584ca8..f74dd67867 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py @@ -115,6 +115,18 @@ def wsgi_with_custom_response_headers(environ, start_response): return [b"*"] +def wsgi_with_repeat_custom_response_headers(environ, start_response): + assert isinstance(environ, dict) + start_response( + "200 OK", + [ + ("my-custom-header", "my-custom-value-1"), + ("my-custom-header", "my-custom-value-2"), + ], + ) + return [b"*"] + + _expected_metric_names = [ "http.server.active_requests", "http.server.duration", @@ -711,6 +723,26 @@ def test_custom_response_headers_not_added_in_internal_span(self): for key, _ in not_expected.items(): self.assertNotIn(key, span.attributes) + @mock.patch.dict( + "os.environ", + { + OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE: "my-custom-header", + }, + ) + def test_repeat_custom_response_headers_added_in_server_span(self): + app = otel_wsgi.OpenTelemetryMiddleware( + wsgi_with_repeat_custom_response_headers + ) + response = app(self.environ, self.start_response) + self.iterate_response(response) + span = self.memory_exporter.get_finished_spans()[0] + expected = { + "http.response.header.my_custom_header": ( + "my-custom-value-1,my-custom-value-2", + ), + } + self.assertSpanHasAttributes(span, expected) + if __name__ == "__main__": unittest.main() From 74f58219d09dc7927e209f0e769eb713921ce0c5 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 11:58:12 -0600 Subject: [PATCH 168/200] Remove [test] package from redis instrumentation (#2274) Fixes #2215 --- .../pyproject.toml | 5 ----- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 6 +++--- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index 8511671ed6..35ca1119fe 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -34,11 +34,6 @@ dependencies = [ instruments = [ "redis >= 2.6", ] -test = [ - "opentelemetry-instrumentation-redis[instruments]", - "opentelemetry-sdk ~= 1.3", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] redis = "opentelemetry.instrumentation.redis:RedisInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt new file mode 100644 index 0000000000..90617f72e6 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +async-timeout==4.0.3 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +redis==5.0.1 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-redis diff --git a/tox.ini b/tox.ini index 54bd2d19bd..e20e855802 100644 --- a/tox.ini +++ b/tox.ini @@ -404,7 +404,7 @@ commands_pre = sqlite3: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] - redis: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-redis[test] + redis: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt remoulade: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] @@ -581,7 +581,7 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-redis[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt @@ -687,7 +687,7 @@ deps = python-dotenv==0.21.1 pytz==2024.1 PyYAML==5.3.1 - redis==4.6.0 + redis==5.0.1 remoulade==3.2.0 requests==2.25.0 six==1.16.0 From e7df01a26cf17ecf21cc185c3cfb040a7efd82d3 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 12:15:13 -0600 Subject: [PATCH 169/200] Remove [test] package from remoulade instrumentation (#2275) Fixes #2216 --- .../pyproject.toml | 5 ----- .../test-requirements.txt | 22 +++++++++++++++++++ tox.ini | 5 +++-- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index b8c9d2709b..3be544b2e1 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -33,11 +33,6 @@ dependencies = [ instruments = [ "remoulade >= 0.50", ] -test = [ - "opentelemetry-instrumentation-remoulade[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "opentelemetry-sdk ~= 1.10" -] [project.entry-points.opentelemetry_instrumentor] remoulade = "opentelemetry.instrumentation.remoulade:RemouladeInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt new file mode 100644 index 0000000000..c50dfde9b5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +prometheus_client==0.20.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +pytz==2024.1 +remoulade==3.2.0 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-remoulade diff --git a/tox.ini b/tox.ini index e20e855802..1b75230067 100644 --- a/tox.ini +++ b/tox.ini @@ -406,7 +406,7 @@ commands_pre = redis: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt - remoulade: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] + remoulade: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt requests: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt @@ -582,10 +582,10 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt @@ -679,6 +679,7 @@ deps = pymongo==4.6.2 PyMySQL==0.10.1 PyNaCl==1.5.0 + # prerequisite: install unixodbc pyodbc==4.0.39 pyrsistent==0.20.0 pytest==8.0.2 From 847e8faadc7985655754469f39fc1180a02a89fb Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 13:06:16 -0600 Subject: [PATCH 170/200] Remove [test] package from sklearn instrumentation (#2303) Fixes #2218 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 22 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index 28fa247159..3d98977347 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -32,10 +32,6 @@ dependencies = [ instruments = [ "scikit-learn ~= 0.24.0", ] -test = [ - "opentelemetry-instrumentation-sklearn[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] sklearn = "opentelemetry.instrumentation.sklearn:SklearnInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt new file mode 100644 index 0000000000..fc966b4d6a --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt @@ -0,0 +1,22 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +joblib==1.3.2 +numpy==1.24.4 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +scikit-learn==0.24.2 +scipy==1.10.1 +threadpoolctl==3.3.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-sklearn diff --git a/tox.ini b/tox.ini index 1b75230067..d9f718c10c 100644 --- a/tox.ini +++ b/tox.ini @@ -434,7 +434,7 @@ commands_pre = prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write[test] - sklearn: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] + sklearn: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt sqlalchemy-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-0.txt sqlalchemy-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlalchemy/test-requirements-1.txt @@ -580,12 +580,12 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt - ; python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt + ; pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt From a892b0b0f31446372e997e8c70d00e7933a20b21 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 13:49:38 -0600 Subject: [PATCH 171/200] Remove [test] package from psycopg instrumentation (#2309) Fixes #2308 --- .../pyproject.toml | 4 ---- .../test-requirements-0.txt | 20 +++++++++++++++++++ .../test-requirements-1.txt | 19 ++++++++++++++++++ tox.ini | 6 ++++-- 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml index a5a4da0b59..bc87236ca6 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml @@ -34,10 +34,6 @@ dependencies = [ instruments = [ "psycopg >= 3.1.0", ] -test = [ - "opentelemetry-instrumentation-psycopg[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] psycopg = "opentelemetry.instrumentation.psycopg:PsycopgInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt new file mode 100644 index 0000000000..4b57cb1ca5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt @@ -0,0 +1,20 @@ +asgiref==3.7.2 +attrs==23.2.0 +backports.zoneinfo==0.2.1 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +psycopg==3.1.18 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-psycopg diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt new file mode 100644 index 0000000000..d449374047 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +psycopg==3.1.18 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-psycopg diff --git a/tox.ini b/tox.ini index d9f718c10c..46cc0d8f53 100644 --- a/tox.ini +++ b/tox.ini @@ -394,7 +394,9 @@ commands_pre = pymongo: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt - psycopg: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] + py3{8,9}-test-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-0.txt + py3{10,11}-test-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt + pypy3-test-instrumentation-psycopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt psycopg2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt @@ -589,11 +591,11 @@ commands_pre = python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt From 4107d395cf11030702c9fca7e3ebdfa789bd1c73 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 15:44:53 -0600 Subject: [PATCH 172/200] Remove [test] package from resource-detector-container (#2319) Fixes #2228 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 16 ++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 resource/opentelemetry-resource-detector-container/test-requirements.txt diff --git a/resource/opentelemetry-resource-detector-container/pyproject.toml b/resource/opentelemetry-resource-detector-container/pyproject.toml index 9cb6685a2a..4ad1df12cd 100644 --- a/resource/opentelemetry-resource-detector-container/pyproject.toml +++ b/resource/opentelemetry-resource-detector-container/pyproject.toml @@ -27,9 +27,6 @@ dependencies = [ "opentelemetry-sdk ~= 1.12", ] -[project.optional-dependencies] -test = [] - [project.entry-points.opentelemetry_resource_detector] container = "opentelemetry.resource.detector.container:ContainerResourceDetector" diff --git a/resource/opentelemetry-resource-detector-container/test-requirements.txt b/resource/opentelemetry-resource-detector-container/test-requirements.txt new file mode 100644 index 0000000000..eee7aaa46d --- /dev/null +++ b/resource/opentelemetry-resource-detector-container/test-requirements.txt @@ -0,0 +1,16 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e resource/opentelemetry-resource-detector-container diff --git a/tox.ini b/tox.ini index 46cc0d8f53..293d7ecb95 100644 --- a/tox.ini +++ b/tox.ini @@ -456,7 +456,7 @@ commands_pre = sdkextension-aws: pip install {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] - resource-detector-container: pip install {toxinidir}/resource/opentelemetry-resource-detector-container[test] + resource-detector-container: pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt http: pip install {toxinidir}/util/opentelemetry-util-http ; In order to get a health coverage report, @@ -618,7 +618,7 @@ commands_pre = python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] # requires snappy headers to be available on the system python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] - python -m pip install -e {toxinidir}/resource/opentelemetry-resource-detector-container[test] + pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-aws-xray[test] python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] python -m pip install -e {toxinidir}/opentelemetry-distro[test] From bbcd5eebe3fe9efa28966d44aed1f2fb8e74d206 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 16:10:16 -0600 Subject: [PATCH 173/200] Remove [test] package from opentelemetry-resource-detector-azure (#2317) Fixes #2229 --- resource/opentelemetry-resource-detector-azure/pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/resource/opentelemetry-resource-detector-azure/pyproject.toml b/resource/opentelemetry-resource-detector-azure/pyproject.toml index ea4be96948..72260709f9 100644 --- a/resource/opentelemetry-resource-detector-azure/pyproject.toml +++ b/resource/opentelemetry-resource-detector-azure/pyproject.toml @@ -27,9 +27,6 @@ dependencies = [ "opentelemetry-sdk ~= 1.21", ] -[project.optional-dependencies] -test = [] - [project.entry-points.opentelemetry_resource_detector] azure_app_service = "opentelemetry.resource.detector.azure.app_service:AzureAppServiceResourceDetector" azure_vm = "opentelemetry.resource.detector.azure.vm:AzureVMResourceDetector" From 1f3bcd6555d1d906abc02a8686a430b29f8e4d12 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 16:38:24 -0600 Subject: [PATCH 174/200] Remove [test] package from propagator-aws-xray (#2320) Fixes #2230 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 21 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 propagator/opentelemetry-propagator-aws-xray/test-requirements.txt diff --git a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml index 4ece31fc53..6361de39a0 100644 --- a/propagator/opentelemetry-propagator-aws-xray/pyproject.toml +++ b/propagator/opentelemetry-propagator-aws-xray/pyproject.toml @@ -27,9 +27,6 @@ dependencies = [ "opentelemetry-api ~= 1.12", ] -[project.optional-dependencies] -test = [] - [project.entry-points.opentelemetry_propagator] xray = "opentelemetry.propagators.aws:AwsXRayPropagator" diff --git a/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt new file mode 100644 index 0000000000..b6b197bdcc --- /dev/null +++ b/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt @@ -0,0 +1,21 @@ +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +Deprecated==1.2.14 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +requests==2.31.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e propagator/opentelemetry-propagator-aws-xray diff --git a/tox.ini b/tox.ini index 293d7ecb95..fbaf36139d 100644 --- a/tox.ini +++ b/tox.ini @@ -462,7 +462,7 @@ commands_pre = ; In order to get a health coverage report, propagator-ot-trace: pip install {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] - propagator-aws-xray: pip install requests {toxinidir}/propagator/opentelemetry-propagator-aws-xray[test] + propagator-aws-xray: pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt ; we have to install packages in editable mode. coverage: python {toxinidir}/scripts/eachdist.py install --editable @@ -619,7 +619,7 @@ commands_pre = # requires snappy headers to be available on the system python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt - python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-aws-xray[test] + pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] python -m pip install -e {toxinidir}/opentelemetry-distro[test] From dc62f8de49462f1de1e534c7befc8f2135da264c Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 17:19:34 -0600 Subject: [PATCH 175/200] Remove [test] package from propagator-ot-trace (#2321) Fixes #2231 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 16 ++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 propagator/opentelemetry-propagator-ot-trace/test-requirements.txt diff --git a/propagator/opentelemetry-propagator-ot-trace/pyproject.toml b/propagator/opentelemetry-propagator-ot-trace/pyproject.toml index 4b73034617..41f374ee1b 100644 --- a/propagator/opentelemetry-propagator-ot-trace/pyproject.toml +++ b/propagator/opentelemetry-propagator-ot-trace/pyproject.toml @@ -28,9 +28,6 @@ dependencies = [ "opentelemetry-sdk ~= 1.12", ] -[project.optional-dependencies] -test = [] - [project.entry-points.opentelemetry_propagator] ottrace = "opentelemetry.propagators.ot_trace:OTTracePropagator" diff --git a/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt new file mode 100644 index 0000000000..69c1829a5c --- /dev/null +++ b/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt @@ -0,0 +1,16 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e propagator/opentelemetry-propagator-ot-trace diff --git a/tox.ini b/tox.ini index fbaf36139d..26749caaff 100644 --- a/tox.ini +++ b/tox.ini @@ -460,7 +460,7 @@ commands_pre = http: pip install {toxinidir}/util/opentelemetry-util-http ; In order to get a health coverage report, - propagator-ot-trace: pip install {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] + propagator-ot-trace: pip install -r {toxinidir}/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt propagator-aws-xray: pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt @@ -620,7 +620,7 @@ commands_pre = python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt - python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-ot-trace[test] + pip install -r {toxinidir}/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt python -m pip install -e {toxinidir}/opentelemetry-distro[test] commands = From 69fbfd608016a66f50f87df429338edc76b70b91 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 17:45:12 -0600 Subject: [PATCH 176/200] Remove [test] package from exporter-richconsole (#2322) Fixes #2232 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 21 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 exporter/opentelemetry-exporter-richconsole/test-requirements.txt diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index c8a509f643..9b9e9f3c6d 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -30,9 +30,6 @@ dependencies = [ "rich>=10.0.0", ] -[project.optional-dependencies] -test = [] - [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-richconsole" diff --git a/exporter/opentelemetry-exporter-richconsole/test-requirements.txt b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt new file mode 100644 index 0000000000..42d2ec7b4c --- /dev/null +++ b/exporter/opentelemetry-exporter-richconsole/test-requirements.txt @@ -0,0 +1,21 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +flaky==3.7.0 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +markdown-it-py==3.0.0 +mdurl==0.1.2 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +Pygments==2.17.2 +pytest==7.1.3 +pytest-benchmark==4.0.0 +rich==13.7.1 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e exporter/opentelemetry-exporter-richconsole diff --git a/tox.ini b/tox.ini index 26749caaff..2a3a575921 100644 --- a/tox.ini +++ b/tox.ini @@ -432,7 +432,7 @@ commands_pre = aiopg: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiopg/test-requirements.txt - richconsole: pip install flaky {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] + richconsole: pip install -r {toxinidir}/exporter/opentelemetry-exporter-richconsole/test-requirements.txt prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write[test] @@ -615,7 +615,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt - python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-richconsole[test] + pip install -r {toxinidir}/exporter/opentelemetry-exporter-richconsole/test-requirements.txt # requires snappy headers to be available on the system python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt From bc734282b9b2f3fd497c295d2b57e1b61d7c3068 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 18:01:24 -0600 Subject: [PATCH 177/200] Remove [test] package from exporter-prometheus-remote-write (#2323) Fixes #2233 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 24 +++++++++++++++++++ tox.ini | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml b/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml index a6dea9a9de..b0006a0682 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/pyproject.toml @@ -31,9 +31,6 @@ dependencies = [ "python-snappy ~= 0.6", ] -[project.optional-dependencies] -test = [] - [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/exporter/opentelemetry-exporter-prometheus-remote-write" diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt new file mode 100644 index 0000000000..40c4886fd7 --- /dev/null +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt @@ -0,0 +1,24 @@ +asgiref==3.7.2 +attrs==23.2.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +cramjam==2.8.1 +Deprecated==1.2.14 +idna==3.6 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +protobuf==4.25.3 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-snappy==0.7.1 +requests==2.31.0 +tomli==2.0.1 +typing_extensions==4.10.0 +urllib3==2.2.1 +wrapt==1.16.0 +zipp==3.17.0 +-e exporter/opentelemetry-exporter-prometheus-remote-write diff --git a/tox.ini b/tox.ini index 2a3a575921..d4c3f66927 100644 --- a/tox.ini +++ b/tox.ini @@ -434,7 +434,7 @@ commands_pre = richconsole: pip install -r {toxinidir}/exporter/opentelemetry-exporter-richconsole/test-requirements.txt - prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write[test] + prometheus: pip install -r {toxinidir}/exporter/opentelemetry-exporter-prometheus-remote-write/test-requirements.txt sklearn: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt From 24c1ccabc5f23023bae80d59005790b1b04743ec Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 19:16:41 -0600 Subject: [PATCH 178/200] Remove [test] package from sdk-extension-aws (#2324) Fixes #2234 --- .github/workflows/instrumentations_1.yml | 2 +- docs/index.rst | 2 +- .../pyproject.toml | 3 --- .../test-requirements.txt | 16 ++++++++++++++++ tox.ini | 10 +++++----- 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 978642a7a3..92e13609a2 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -31,7 +31,7 @@ jobs: - "richconsole" - "psycopg" - "prometheus-remote-write" - - "sdkextension-aws" + - "sdk-extension-aws" - "propagator-aws-xray" - "propagator-ot-trace" - "resource-detector-container" diff --git a/docs/index.rst b/docs/index.rst index 5203c377e4..e2bf32e12e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,7 +22,7 @@ installed separately via pip: pip install opentelemetry-exporter-{exporter} pip install opentelemetry-instrumentation-{instrumentation} - pip install opentelemetry-sdk-extension-{sdkextension} + pip install opentelemetry-sdk-extension-{sdk-extension} A complete list of packages can be found at the `Contrib repo instrumentation `_ diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml index 252f9bb6f7..52259bd52b 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml +++ b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml @@ -27,9 +27,6 @@ dependencies = [ "opentelemetry-sdk ~= 1.12", ] -[project.optional-dependencies] -test = [] - [project.entry-points.opentelemetry_id_generator] xray = "opentelemetry.sdk.extension.aws.trace.aws_xray_id_generator:AwsXRayIdGenerator" diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt new file mode 100644 index 0000000000..e569ade322 --- /dev/null +++ b/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt @@ -0,0 +1,16 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e sdk-extension/opentelemetry-sdk-extension-aws diff --git a/tox.ini b/tox.ini index d4c3f66927..4ceced1210 100644 --- a/tox.ini +++ b/tox.ini @@ -11,8 +11,8 @@ envlist = pypy3-test-resource-detector-container ; opentelemetry-sdk-extension-aws - py3{8,9,10,11}-test-sdkextension-aws - pypy3-test-sdkextension-aws + py3{8,9,10,11}-test-sdk-extension-aws + pypy3-test-sdk-extension-aws ; opentelemetry-distro py3{8,9,10,11}-test-distro @@ -454,7 +454,7 @@ commands_pre = httpx-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-0.txt httpx-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt - sdkextension-aws: pip install {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] + sdk-extension-aws: pip install -r {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt resource-detector-container: pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt @@ -518,7 +518,7 @@ commands = test-instrumentation-httpx: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/tests {posargs} test-instrumentation-asyncio: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/tests {posargs} test-util-http: pytest {toxinidir}/util/opentelemetry-util-http/tests {posargs} - test-sdkextension-aws: pytest {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/tests {posargs} + test-sdk-extension-aws: pytest {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/tests {posargs} test-resource-detector-container: pytest {toxinidir}/resource/opentelemetry-resource-detector-container/tests {posargs} test-propagator-aws: pytest {toxinidir}/propagator/opentelemetry-propagator-aws-xray/tests {posargs} test-propagator-ot-trace: pytest {toxinidir}/propagator/opentelemetry-propagator-ot-trace/tests {posargs} @@ -617,10 +617,10 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt pip install -r {toxinidir}/exporter/opentelemetry-exporter-richconsole/test-requirements.txt # requires snappy headers to be available on the system - python -m pip install -e {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws[test] pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt pip install -r {toxinidir}/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt + pip install -r {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt python -m pip install -e {toxinidir}/opentelemetry-distro[test] commands = From 4bb095e96105dafefe39a18a84c77008cbfe5c8e Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 19:31:51 -0600 Subject: [PATCH 179/200] Remove [test] package from opentelemetry-instrumentation (#2327) Fixes #2235 --- opentelemetry-instrumentation/pyproject.toml | 3 --- .../test-requirements.txt | 16 ++++++++++++++++ tox.ini | 4 +++- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 opentelemetry-instrumentation/test-requirements.txt diff --git a/opentelemetry-instrumentation/pyproject.toml b/opentelemetry-instrumentation/pyproject.toml index db389544c9..a20b005911 100644 --- a/opentelemetry-instrumentation/pyproject.toml +++ b/opentelemetry-instrumentation/pyproject.toml @@ -29,9 +29,6 @@ dependencies = [ "wrapt >= 1.0.0, < 2.0.0", ] -[project.optional-dependencies] -test = [] - [project.scripts] opentelemetry-bootstrap = "opentelemetry.instrumentation.bootstrap:run" opentelemetry-instrument = "opentelemetry.instrumentation.auto_instrumentation:run" diff --git a/opentelemetry-instrumentation/test-requirements.txt b/opentelemetry-instrumentation/test-requirements.txt new file mode 100644 index 0000000000..473a423bda --- /dev/null +++ b/opentelemetry-instrumentation/test-requirements.txt @@ -0,0 +1,16 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation diff --git a/tox.ini b/tox.ini index 4ceced1210..07e94f58d1 100644 --- a/tox.ini +++ b/tox.ini @@ -323,6 +323,8 @@ commands_pre = test: pip install opentelemetry-test-utils[test]@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils test: pip install {toxinidir}/opentelemetry-instrumentation + opentelemetry-instrumentation: pip install -r {toxinidir}/opentelemetry-instrumentation/test-requirements.txt + distro: pip install {toxinidir}/opentelemetry-distro asgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt @@ -565,11 +567,11 @@ commands_pre = python -m pip install {env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk python -m pip install {env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils python -m pip install -e {toxinidir}/util/opentelemetry-util-http[test] - python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt + pip install -r {toxinidir}/opentelemetry-instrumentation/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt From 35cb8c525498278a64b9f35e597b22d7ce573d84 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 19:59:31 -0600 Subject: [PATCH 180/200] Remove [test] package from distro (#2325) Fixes #2237 --- opentelemetry-distro/pyproject.toml | 1 - opentelemetry-distro/test-requirements.txt | 17 +++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 opentelemetry-distro/test-requirements.txt diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index 43c646b1d9..6872aa49c8 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -31,7 +31,6 @@ dependencies = [ otlp = [ "opentelemetry-exporter-otlp == 1.24.0.dev", ] -test = [] [project.entry-points.opentelemetry_configurator] configurator = "opentelemetry.distro:OpenTelemetryConfigurator" diff --git a/opentelemetry-distro/test-requirements.txt b/opentelemetry-distro/test-requirements.txt new file mode 100644 index 0000000000..978389dc9a --- /dev/null +++ b/opentelemetry-distro/test-requirements.txt @@ -0,0 +1,17 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e opentelemetry-distro diff --git a/tox.ini b/tox.ini index 07e94f58d1..955ea312cd 100644 --- a/tox.ini +++ b/tox.ini @@ -325,7 +325,7 @@ commands_pre = opentelemetry-instrumentation: pip install -r {toxinidir}/opentelemetry-instrumentation/test-requirements.txt - distro: pip install {toxinidir}/opentelemetry-distro + distro: pip install -r {toxinidir}/opentelemetry-distro/test-requirements.txt asgi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asgi/test-requirements.txt @@ -623,7 +623,7 @@ commands_pre = pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt pip install -r {toxinidir}/propagator/opentelemetry-propagator-ot-trace/test-requirements.txt pip install -r {toxinidir}/sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt - python -m pip install -e {toxinidir}/opentelemetry-distro[test] + pip install -r {toxinidir}/opentelemetry-distro/test-requirements.txt commands = python scripts/eachdist.py lint --check-only From 9cf995c62e2d61f30fc38c20e774e2be6141d4f7 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 20:53:30 -0600 Subject: [PATCH 181/200] Remove [test] package from sqlite3 instrumentation (#2277) Fixes #2220 --- .../pyproject.toml | 3 --- .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index 0ccdc2da06..ff881a91ed 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -31,9 +31,6 @@ dependencies = [ [project.optional-dependencies] instruments = [] -test = [ - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] sqlite3 = "opentelemetry.instrumentation.sqlite3:SQLite3Instrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt new file mode 100644 index 0000000000..16cfb33801 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-sqlite3 diff --git a/tox.ini b/tox.ini index 955ea312cd..25571d1ff3 100644 --- a/tox.ini +++ b/tox.ini @@ -406,7 +406,7 @@ commands_pre = pyramid: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt - sqlite3: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] + sqlite3: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt redis: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt @@ -598,11 +598,11 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-server/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg/test-requirements-1.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-requests/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install # for your OS to install the required dependencies From 0e66ef6e20f5a53b597d316a86d22edcedcc21b9 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 21:25:18 -0600 Subject: [PATCH 182/200] Remove [test] package from system-metrics instrumentation (#2279) Fixes #2222 --- .../pyproject.toml | 5 +---- .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index caf27ec5ab..3c179651d4 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ + "opentelemetry-instrumentation == 0.45b0.dev", "opentelemetry-api ~= 1.11", "opentelemetry-sdk ~= 1.11", "psutil ~= 5.9", @@ -33,10 +34,6 @@ dependencies = [ instruments = [ "psutil >= 5", ] -test = [ - "opentelemetry-instrumentation-system-metrics[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] system_metrics = "opentelemetry.instrumentation.system_metrics:SystemMetricsInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt new file mode 100644 index 0000000000..ee56025d5f --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +psutil==5.9.8 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-system-metrics diff --git a/tox.ini b/tox.ini index 25571d1ff3..c11927c9ba 100644 --- a/tox.ini +++ b/tox.ini @@ -416,7 +416,7 @@ commands_pre = starlette: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt - system-metrics: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] + system-metrics: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt tornado: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt @@ -615,9 +615,9 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt pip install -r {toxinidir}/exporter/opentelemetry-exporter-richconsole/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt # requires snappy headers to be available on the system pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt From c8889d7211bb48c5f7ae23ac993e5dbd92605307 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 21:39:57 -0600 Subject: [PATCH 183/200] Remove [test] package from tortoiseorm instrumentation (#2281) Fixes #2224 --- .../pyproject.toml | 4 --- .../test-requirements.txt | 25 +++++++++++++++++++ tox.ini | 4 +-- 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 9d32028bdd..89a906610b 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -34,10 +34,6 @@ instruments = [ "tortoise-orm >= 0.17.0", "pydantic >= 1.10.2" ] -test = [ - "opentelemetry-instrumentation-tortoiseorm[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] tortoiseorm = "opentelemetry.instrumentation.tortoiseorm:TortoiseORMInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt new file mode 100644 index 0000000000..0fafc56253 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt @@ -0,0 +1,25 @@ +aiosqlite==0.17.0 +annotated-types==0.6.0 +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +iso8601==1.1.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pydantic==2.6.2 +pydantic_core==2.16.3 +pypika-tortoise==0.1.6 +pytest==7.1.3 +pytest-benchmark==4.0.0 +pytz==2024.1 +tomli==2.0.1 +tortoise-orm==0.20.0 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-tortoiseorm diff --git a/tox.ini b/tox.ini index c11927c9ba..d6a5e21f89 100644 --- a/tox.ini +++ b/tox.ini @@ -420,7 +420,7 @@ commands_pre = tornado: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt - tortoiseorm: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] + tortoiseorm: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt jinja2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-jinja2/test-requirements.txt @@ -611,13 +611,13 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncpg/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymongo/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-httpx/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aws-lambda/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysql/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt pip install -r {toxinidir}/exporter/opentelemetry-exporter-richconsole/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt # requires snappy headers to be available on the system pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt pip install -r {toxinidir}/propagator/opentelemetry-propagator-aws-xray/test-requirements.txt From 4360b5f6e8d661f15c2d31a2600a3d27ee72db92 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 21:55:43 -0600 Subject: [PATCH 184/200] Remove [test] package from confluent-kafka instrumentation (#2287) Fixes #2196 --- .../pyproject.toml | 4 +--- .../test-requirements.txt | 18 ++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 4ded0836b2..3fd97ce493 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ + "opentelemetry-instrumentation == 0.45b0.dev", "opentelemetry-api ~= 1.12", "wrapt >= 1.0.0, < 2.0.0", ] @@ -29,9 +30,6 @@ dependencies = [ instruments = [ "confluent-kafka >= 1.8.2, <= 2.3.0", ] -test = [ - "opentelemetry-instrumentation-confluent-kafka[instruments]", -] [project.entry-points.opentelemetry_instrumentor] confluent_kafka = "opentelemetry.instrumentation.confluent_kafka:ConfluentKafkaInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt new file mode 100644 index 0000000000..be859a2ce1 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +confluent-kafka==2.3.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-confluent-kafka diff --git a/tox.ini b/tox.ini index d6a5e21f89..01f3f55557 100644 --- a/tox.ini +++ b/tox.ini @@ -341,7 +341,7 @@ commands_pre = kafka-python: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt - confluent-kafka: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] + confluent-kafka: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt grpc: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-grpc/test-requirements.txt @@ -590,7 +590,6 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-kafka-python/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-remoulade/test-requirements.txt ; pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sklearn/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymemcache/test-requirements-4.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-logging/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aiohttp-client/test-requirements.txt @@ -603,6 +602,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install # for your OS to install the required dependencies From 26479c8a34288c0e723633eee2a845571db76afc Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 22:21:36 -0600 Subject: [PATCH 185/200] Remove [test] package from pymysql instrumentation (#2272) Fixes #2272 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 19 +++++++++++++++++++ tox.ini | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 4018d29601..9e6028bf64 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -33,10 +33,6 @@ dependencies = [ instruments = [ "PyMySQL < 2", ] -test = [ - "opentelemetry-instrumentation-pymysql[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] pymysql = "opentelemetry.instrumentation.pymysql:PyMySQLInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt new file mode 100644 index 0000000000..cb6619c5de --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt @@ -0,0 +1,19 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +PyMySQL==1.1.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-dbapi +-e instrumentation/opentelemetry-instrumentation-pymysql diff --git a/tox.ini b/tox.ini index 01f3f55557..8fc54c7d23 100644 --- a/tox.ini +++ b/tox.ini @@ -402,7 +402,7 @@ commands_pre = psycopg2: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-psycopg2/test-requirements.txt - pymysql: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] + pymysql: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt pyramid: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pyramid/test-requirements.txt From 86a552ecc8f5525dab2c3ce2242cb0b81b9cc784 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 22:39:20 -0600 Subject: [PATCH 186/200] Remove [test] package from boto3sqs instrumentation (#2252) Fixes #2192 --- .../pyproject.toml | 4 ---- .../test-requirements.txt | 24 +++++++++++++++++++ tox.ini | 4 ++-- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 89e1e112d8..701c58251a 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -34,10 +34,6 @@ dependencies = [ instruments = [ "boto3 ~= 1.0", ] -test = [ - "opentelemetry-instrumentation-boto3sqs[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", -] [project.entry-points.opentelemetry_instrumentor] boto3 = "opentelemetry.instrumentation.boto3sqs:Boto3SQSInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt new file mode 100644 index 0000000000..2af3346e6d --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt @@ -0,0 +1,24 @@ +asgiref==3.7.2 +attrs==23.2.0 +boto3==1.34.44 +botocore==1.34.44 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +jmespath==1.0.1 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +python-dateutil==2.8.2 +s3transfer==0.10.0 +six==1.16.0 +tomli==2.0.1 +typing_extensions==4.9.0 +urllib3==1.26.18 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-boto3sqs diff --git a/tox.ini b/tox.ini index 8fc54c7d23..8b126e6cd0 100644 --- a/tox.ini +++ b/tox.ini @@ -353,7 +353,7 @@ commands_pre = boto: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt - boto3sqs: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] + boto3sqs: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt falcon-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-0.txt falcon-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-1.txt @@ -572,7 +572,6 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-dbapi/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt pip install -r {toxinidir}/opentelemetry-instrumentation/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-django/test-requirements-3.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-falcon/test-requirements-2.txt @@ -582,6 +581,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-cassandra/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt From 96655cefbc8f3dc76fb7357d48f53368890f50ed Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 23:06:44 -0600 Subject: [PATCH 187/200] Remove [test] package from _template (#2329) Fixes #2328 --- _template/pyproject.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/_template/pyproject.toml b/_template/pyproject.toml index 55607cc9b1..ca3da89a30 100644 --- a/_template/pyproject.toml +++ b/_template/pyproject.toml @@ -31,12 +31,6 @@ dependencies = [ "opentelemetry-api ~= 1.12", ] -[project.optional-dependencies] -test = [ - # add any test dependencies here - "", -] - [project.entry-points.opentelemetry_instrumentor] # REPLACE ME: the entrypoint for the instrumentor e.g # sqlalchemy = "opentelemetry.instrumentation.sqlalchemy:SQLAlchemyInstrumentor" From ada27842bd4596fb3adb7f5e952aafd114b6b78a Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Thu, 21 Mar 2024 23:31:47 -0600 Subject: [PATCH 188/200] Remove [test] package from pika instrumentation (#2306) Fixes #2209 --- .../pyproject.toml | 7 +------ .../test-requirements-0.txt | 18 ++++++++++++++++ .../test-requirements-1.txt | 18 ++++++++++++++++ tox.ini | 21 +++++++++++-------- 4 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt create mode 100644 instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index b11c9bbffc..487ea012a0 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ + "opentelemetry-instrumentation == 0.45b0.dev", "opentelemetry-api ~= 1.5", "packaging >= 20.0", "wrapt >= 1.0.0, < 2.0.0", @@ -33,12 +34,6 @@ dependencies = [ instruments = [ "pika >= 0.12.0", ] -test = [ - "opentelemetry-instrumentation-pika[instruments]", - "opentelemetry-test-utils == 0.45b0.dev", - "pytest", - "wrapt >= 1.0.0, < 2.0.0", -] [project.entry-points.opentelemetry_instrumentor] pika = "opentelemetry.instrumentation.pika:PikaInstrumentor" diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt new file mode 100644 index 0000000000..fb3c6def5a --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pika==0.13.1 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pika diff --git a/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt new file mode 100644 index 0000000000..d3ce673dab --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pika==1.3.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.10.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-pika diff --git a/tox.ini b/tox.ini index 8b126e6cd0..068b5d583e 100644 --- a/tox.ini +++ b/tox.ini @@ -258,6 +258,10 @@ envlist = pypy3-test-propagator-ot-trace ; opentelemetry-instrumentation-sio-pika + ; The numbers at the end of the environment names + ; below mean these dependencies are being used: + ; 0: pika>=0.12.0,<1.0.0 + ; 1: pika>=1.0.0 py3{8,9,10,11}-test-instrumentation-sio-pika-{0,1} pypy3-test-instrumentation-sio-pika-{0,1} @@ -300,8 +304,6 @@ deps = coverage: pytest coverage: pytest-cov grpc: pytest-asyncio - sio-pika-0: pika>=0.12.0,<1.0.0 - sio-pika-1: pika>=1.0.0 ; FIXME: add coverage testing ; FIXME: add mypy testing @@ -317,10 +319,10 @@ commands_pre = py3{8,9,10,11}: python -m pip install -U pip setuptools wheel ; Install common packages for all the tests. These are not needed in all the ; cases but it saves a lot of boilerplate in this file. - test: pip install opentelemetry-api[test]@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api - test: pip install opentelemetry-semantic-conventions[test]@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions - test: pip install opentelemetry-sdk[test]@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk - test: pip install opentelemetry-test-utils[test]@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils + test: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api + test: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions + test: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk + test: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils test: pip install {toxinidir}/opentelemetry-instrumentation opentelemetry-instrumentation: pip install -r {toxinidir}/opentelemetry-instrumentation/test-requirements.txt @@ -333,7 +335,8 @@ commands_pre = py3{10,11}-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt pypy3-test-instrumentation-celery: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt - sio-pika-{0,1}: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] + sio-pika-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/test-requirements-0.txt + sio-pika-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt aio-pika-0: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-0.txt aio-pika-1: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-1.txt @@ -582,7 +585,6 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-celery/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-boto3sqs/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pika[test] pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-aio-pika/test-requirements-2.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-redis/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt @@ -603,7 +605,8 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-urllib3/test-requirements-1.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-confluent-kafka/test-requirements.txt - python -m pip install -e {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql[test] + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pika/test-requirements-1.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-pymysql/test-requirements.txt # prerequisite: follow the instructions here https://github.com/PyMySQL/mysqlclient#install # for your OS to install the required dependencies pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-mysqlclient/test-requirements.txt From ca082a7c523f417d5bb6c682d76667e666946496 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 22 Mar 2024 23:56:29 +0100 Subject: [PATCH 189/200] elasticsearch: don't set body as db statement for bulk requests (#2355) * elasticsearch: don't set body as db statement for bulk requests bulk requests can be too big and diverse to make sense as db statement. Other than that the sanitizer currently only handles dicts so it's crashing. Closes #2150 Co-authored-by: Jason Mobarak Co-authored-by: Quentin Pradet * Update CHANGELOG * Please the linter --------- Co-authored-by: Jason Mobarak Co-authored-by: Quentin Pradet --- CHANGELOG.md | 2 ++ .../instrumentation/elasticsearch/__init__.py | 8 +++-- .../tests/test_elasticsearch.py | 34 +++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8797b9992a..7a10579947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2298)) - Avoid losing repeated HTTP headers ([#2266](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2266)) +- `opentelemetry-instrumentation-elasticsearch` Don't send bulk request body as db statement + ([#2355](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2355)) ## Version 1.23.0/0.44b0 (2024-02-23) diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py index dd72a5235e..0f5056de83 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py @@ -245,9 +245,11 @@ def wrapper(wrapped, _, args, kwargs): if method: attributes["elasticsearch.method"] = method if body: - attributes[SpanAttributes.DB_STATEMENT] = sanitize_body( - body - ) + # Don't set db.statement for bulk requests, as it can be very large + if isinstance(body, dict): + attributes[ + SpanAttributes.DB_STATEMENT + ] = sanitize_body(body) if params: attributes["elasticsearch.params"] = str(params) if doc_id: diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py index 0c84cf5cd6..6008108d79 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/tests/test_elasticsearch.py @@ -51,6 +51,8 @@ Article = helpers.Article +# pylint: disable=too-many-public-methods + @mock.patch( "elasticsearch.connection.http_urllib3.Urllib3HttpConnection.perform_request" @@ -486,3 +488,35 @@ def test_body_sanitization(self, _): sanitize_body(json.dumps(sanitization_queries.interval_query)), str(sanitization_queries.interval_query_sanitized), ) + + def test_bulk(self, request_mock): + request_mock.return_value = (1, {}, "") + + es = Elasticsearch() + es.bulk( + [ + { + "_op_type": "index", + "_index": "sw", + "_doc_type": "_doc", + "_id": 1, + "doc": {"name": "adam"}, + }, + { + "_op_type": "index", + "_index": "sw", + "_doc_type": "_doc", + "_id": 1, + "doc": {"name": "adam"}, + }, + ] + ) + + spans_list = self.get_finished_spans() + self.assertEqual(len(spans_list), 1) + span = spans_list[0] + + # Check version and name in span's instrumentation info + self.assertEqualSpanInstrumentationInfo( + span, opentelemetry.instrumentation.elasticsearch + ) From d06de3f9f135191812aa9390aee1e58d9c053210 Mon Sep 17 00:00:00 2001 From: samypr100 <3933065+samypr100@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:15:51 +0000 Subject: [PATCH 190/200] regression-fix: retain httpx.URL type on request.url (#2359) * fix: retain httpx.URL type on request.url This fixes a regression caused in #2020 where request.url stopped being of `httpx.URL` type, causing issues with request/response hooks. * Update CHANGELOG.md * tests: adding assertions to verify request.url on hooks is a httpx.URL * fixup: adjust check to consider httpx < 0.20.0 * fixup: keep code dry --------- Co-authored-by: Diego Hurtado Co-authored-by: Leighton Chen Co-authored-by: Srikanth Chekuri --- CHANGELOG.md | 2 ++ .../src/opentelemetry/instrumentation/httpx/__init__.py | 2 +- .../tests/test_httpx_integration.py | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a10579947..0373f30754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2297](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2297)) - Ensure all http.server.duration metrics have the same description ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/2298)) +- Fix regression in httpx `request.url` not being of type `httpx.URL` after `0.44b0` + ([#2359](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2359)) - Avoid losing repeated HTTP headers ([#2266](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2266)) - `opentelemetry-instrumentation-elasticsearch` Don't send bulk request body as db statement diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py index 53542e7ef3..e6609157c4 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py @@ -270,7 +270,7 @@ def _extract_parameters(args, kwargs): # In httpx >= 0.20.0, handle_request receives a Request object request: httpx.Request = args[0] method = request.method.encode() - url = remove_url_credentials(str(request.url)) + url = httpx.URL(remove_url_credentials(str(request.url))) headers = request.headers stream = request.stream extensions = request.extensions diff --git a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py index b8d7fbb6b6..c3f668cafe 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py @@ -51,12 +51,18 @@ HTTP_RESPONSE_BODY = "http.response.body" +def _is_url_tuple(request: "RequestInfo"): + """Determine if request url format is for httpx versions < 0.20.0.""" + return isinstance(request[1], tuple) and len(request[1]) == 4 + + def _async_call(coro: typing.Coroutine) -> asyncio.Task: loop = asyncio.get_event_loop() return loop.run_until_complete(coro) def _response_hook(span, request: "RequestInfo", response: "ResponseInfo"): + assert _is_url_tuple(request) or isinstance(request.url, httpx.URL) span.set_attribute( HTTP_RESPONSE_BODY, b"".join(response[2]), @@ -66,6 +72,7 @@ def _response_hook(span, request: "RequestInfo", response: "ResponseInfo"): async def _async_response_hook( span: "Span", request: "RequestInfo", response: "ResponseInfo" ): + assert _is_url_tuple(request) or isinstance(request.url, httpx.URL) span.set_attribute( HTTP_RESPONSE_BODY, b"".join([part async for part in response[2]]), @@ -73,11 +80,13 @@ async def _async_response_hook( def _request_hook(span: "Span", request: "RequestInfo"): + assert _is_url_tuple(request) or isinstance(request.url, httpx.URL) url = httpx.URL(request[1]) span.update_name("GET" + str(url)) async def _async_request_hook(span: "Span", request: "RequestInfo"): + assert _is_url_tuple(request) or isinstance(request.url, httpx.URL) url = httpx.URL(request[1]) span.update_name("GET" + str(url)) From 37aba928d45713842941c7efc992726a79ea7d8a Mon Sep 17 00:00:00 2001 From: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:46:10 -0700 Subject: [PATCH 191/200] Add cloud.account.id attribute by AwsLambdaInstrumentor (#2367) * Add cloud.account.id attribute by AwsLambdaInstrumentor * Changelog * Update test * lint --- CHANGELOG.md | 2 ++ .../instrumentation/aws_lambda/__init__.py | 10 ++++++++++ .../tests/test_aws_lambda_instrumentation_manual.py | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0373f30754..215221302d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2266](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2266)) - `opentelemetry-instrumentation-elasticsearch` Don't send bulk request body as db statement ([#2355](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2355)) +- AwsLambdaInstrumentor sets `cloud.account.id` span attribute + ([#2367](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2367)) ## Version 1.23.0/0.44b0 (2024-02-23) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index 130622f8c8..3ec22d4c0e 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -354,6 +354,16 @@ def _instrumented_lambda_handler_call( # noqa pylint: disable=too-many-branches lambda_context.aws_request_id, ) + # NOTE: `cloud.account.id` can be parsed from the ARN as the fifth item when splitting on `:` + # + # See more: + # https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#all-triggers + account_id = lambda_context.invoked_function_arn.split(":")[4] + span.set_attribute( + ResourceAttributes.CLOUD_ACCOUNT_ID, + account_id, + ) + exception = None try: result = call_wrapped(*args, **kwargs) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py index 2fa4aafee5..9bf6f47d7b 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py @@ -54,7 +54,7 @@ def __init__(self, aws_request_id, invoked_function_arn): MOCK_LAMBDA_CONTEXT = MockLambdaContext( aws_request_id="mock_aws_request_id", - invoked_function_arn="arn://mock-lambda-function-arn", + invoked_function_arn="arn:aws:lambda:us-east-1:123456:function:myfunction:myalias", ) MOCK_XRAY_TRACE_ID = 0x5FB7331105E8BB83207FA31D4D9CDB4C @@ -147,6 +147,11 @@ def test_active_tracing(self): { ResourceAttributes.FAAS_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn, SpanAttributes.FAAS_EXECUTION: MOCK_LAMBDA_CONTEXT.aws_request_id, + ResourceAttributes.CLOUD_ACCOUNT_ID: MOCK_LAMBDA_CONTEXT.invoked_function_arn.split( + ":" + )[ + 4 + ], }, ) From 24eadcf63d0d5dd78e38a88c2426439eb6e48e63 Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Thu, 28 Mar 2024 22:25:18 +0100 Subject: [PATCH 192/200] Update version to 1.25.0.dev/0.46b0.dev (#2376) --- .github/workflows/instrumentations_0.yml | 2 +- .github/workflows/instrumentations_1.yml | 2 +- .github/workflows/test.yml | 2 +- CHANGELOG.md | 2 + _template/version.py | 2 +- eachdist.ini | 4 +- .../prometheus_remote_write/version.py | 2 +- .../pyproject.toml | 2 +- .../exporter/richconsole/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/aio_pika/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_client/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/aiohttp_server/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/aiopg/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asgi/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/asyncio/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/asyncpg/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/aws_lambda/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/boto/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/boto3sqs/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/botocore/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/cassandra/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/celery/version.py | 2 +- .../pyproject.toml | 2 +- .../confluent_kafka/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/dbapi/version.py | 2 +- .../pyproject.toml | 10 +- .../instrumentation/django/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/elasticsearch/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/falcon/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/fastapi/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/flask/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/grpc/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/httpx/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/jinja2/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/kafka/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/logging/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/mysql/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/mysqlclient/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/pika/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/psycopg/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/psycopg2/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/pymemcache/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/pymongo/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/pymysql/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/pyramid/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/redis/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/remoulade/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/requests/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/sklearn/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlalchemy/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/sqlite3/version.py | 2 +- .../pyproject.toml | 8 +- .../instrumentation/starlette/version.py | 2 +- .../pyproject.toml | 2 +- .../instrumentation/system_metrics/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/tornado/version.py | 2 +- .../pyproject.toml | 4 +- .../instrumentation/tortoiseorm/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/urllib/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/urllib3/version.py | 2 +- .../pyproject.toml | 6 +- .../instrumentation/wsgi/version.py | 2 +- .../pyproject.toml | 94 +++++++++--------- .../contrib-instrumentations/version.py | 2 +- opentelemetry-distro/pyproject.toml | 4 +- .../src/opentelemetry/distro/version.py | 2 +- .../instrumentation/bootstrap_gen.py | 98 +++++++++---------- .../opentelemetry/instrumentation/version.py | 2 +- .../propagators/ot_trace/version.py | 2 +- .../resource/detector/container/version.py | 2 +- .../src/opentelemetry/util/http/version.py | 2 +- 112 files changed, 272 insertions(+), 270 deletions(-) diff --git a/.github/workflows/instrumentations_0.yml b/.github/workflows/instrumentations_0.yml index 5505fce008..256d160640 100644 --- a/.github/workflows/instrumentations_0.yml +++ b/.github/workflows/instrumentations_0.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1 + CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2 jobs: instrumentations-0: diff --git a/.github/workflows/instrumentations_1.yml b/.github/workflows/instrumentations_1.yml index 92e13609a2..59db21529a 100644 --- a/.github/workflows/instrumentations_1.yml +++ b/.github/workflows/instrumentations_1.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1 + CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2 jobs: instrumentations-1: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bc748551b..10c648e517 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: a1253585f66d63e7c05a19f070f3bfe0ab6460c1 + CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2 jobs: misc: diff --git a/CHANGELOG.md b/CHANGELOG.md index 215221302d..8ff90e611b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## Version 1.24.0/0.45b0 (2024-03-28) + - `opentelemetry-instrumentation-psycopg` Async Instrumentation for psycopg 3.x ([#2146](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2146)) diff --git a/_template/version.py b/_template/version.py index 2b23bc4994..ff4933b20b 100644 --- a/_template/version.py +++ b/_template/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/eachdist.ini b/eachdist.ini index 8d6bdbb6be..60f1154a83 100644 --- a/eachdist.ini +++ b/eachdist.ini @@ -16,7 +16,7 @@ sortfirst= ext/* [stable] -version=1.24.0.dev +version=1.25.0.dev packages= opentelemetry-sdk @@ -34,7 +34,7 @@ packages= opentelemetry-api [prerelease] -version=0.45b0.dev +version=0.46b0.dev packages= all diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py index 2b23bc4994..ff4933b20b 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/exporter/opentelemetry-exporter-richconsole/pyproject.toml b/exporter/opentelemetry-exporter-richconsole/pyproject.toml index 9b9e9f3c6d..9fb32c772c 100644 --- a/exporter/opentelemetry-exporter-richconsole/pyproject.toml +++ b/exporter/opentelemetry-exporter-richconsole/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ "opentelemetry-api ~= 1.12", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "rich>=10.0.0", ] diff --git a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py index 2b23bc4994..ff4933b20b 100644 --- a/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py +++ b/exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml index e79dac2866..73c10fffce 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml index b7c0e52b7c..17b92b2cf8 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py index f7a124c7b8..604195c10e 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml index 3ea2340d89..f85cfd6e39 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml index b6c54b658b..4a01639d37 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aiopg/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-dbapi == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-dbapi == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml index 81c83b07e9..a4072bac7d 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asgi/pyproject.toml @@ -26,9 +26,9 @@ classifiers = [ dependencies = [ "asgiref ~= 3.0", "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml index 5354ea3cb4..540da184be 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncio/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.14", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-test-utils == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-test-utils == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncio/src/opentelemetry/instrumentation/asyncio/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml index a1ec427a88..6cdd2e7294 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py +++ b/instrumentation/opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 70e1169eff..3088c47dbe 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -21,9 +21,9 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml index dd4dd690e8..87a323f996 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml index 701c58251a..2da67c9848 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py +++ b/instrumentation/opentelemetry-instrumentation-boto3sqs/src/opentelemetry/instrumentation/boto3sqs/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index d6584078ed..7b0b34d255 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "opentelemetry-propagator-aws-xray == 1.0.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml index c320f70aa9..85f187922e 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-cassandra/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py +++ b/instrumentation/opentelemetry-instrumentation-cassandra/src/opentelemetry/instrumentation/cassandra/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml index e789b54b3f..7b0027425f 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-celery/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py +++ b/instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml index 3fd97ce493..9baeaeb40e 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-api ~= 1.12", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml index 5ae0f09376..e726768535 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-dbapi/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py index 6340c1adfb..17627b21dc 100644 --- a/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-dbapi/src/opentelemetry/instrumentation/dbapi/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml index 65be04cb69..c8869d7b29 100644 --- a/instrumentation/opentelemetry-instrumentation-django/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-django/pyproject.toml @@ -25,15 +25,15 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-wsgi == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-wsgi == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] asgi = [ - "opentelemetry-instrumentation-asgi == 0.45b0.dev", + "opentelemetry-instrumentation-asgi == 0.46b0.dev", ] instruments = [ "django >= 1.10", diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml index 987cfb17c1..659366181a 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py +++ b/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml index dab9534bf9..93787a010d 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-falcon/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-wsgi == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-wsgi == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", "packaging >= 20.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py +++ b/instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml index 89f1c77e43..0e11179de2 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-asgi == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-asgi == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml index 8e0dd1f858..2bc1335a51 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-flask/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-wsgi == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-wsgi == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", "packaging >= 21.0", "importlib-metadata >= 4.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml index 056592dd42..750f76270a 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-grpc/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-sdk ~= 1.12", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml index 1a4da4a520..e4e5575d96 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py +++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml index 9bde62464a..6284496ebd 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-jinja2/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py +++ b/instrumentation/opentelemetry-instrumentation-jinja2/src/opentelemetry/instrumentation/jinja2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml index ba04c2467e..580c076a82 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.5", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py +++ b/instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml index 45e29c7026..57572ce634 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-logging/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py index 6340c1adfb..17627b21dc 100644 --- a/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py +++ b/instrumentation/opentelemetry-instrumentation-logging/src/opentelemetry/instrumentation/logging/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml index f3c673c3d2..481748c007 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysql/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-dbapi == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-dbapi == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysql/src/opentelemetry/instrumentation/mysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml index 7646a9be2b..c9db02e22f 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-dbapi == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-dbapi == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py +++ b/instrumentation/opentelemetry-instrumentation-mysqlclient/src/opentelemetry/instrumentation/mysqlclient/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml index 487ea012a0..a41b7297a8 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pika/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-api ~= 1.5", "packaging >= 20.0", "wrapt >= 1.0.0, < 2.0.0", diff --git a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py +++ b/instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml index bc87236ca6..d2328035fb 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-dbapi == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-dbapi == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg/src/opentelemetry/instrumentation/psycopg/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml index 26873924e4..399d5dc466 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-dbapi == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-dbapi == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py +++ b/instrumentation/opentelemetry-instrumentation-psycopg2/src/opentelemetry/instrumentation/psycopg2/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml index e37f566b0b..f7f3bc1905 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/src/opentelemetry/instrumentation/pymemcache/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml index eca94e5c6c..7c1c8a03a5 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymongo/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml index 9e6028bf64..858fea62fa 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pymysql/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-dbapi == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-dbapi == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py +++ b/instrumentation/opentelemetry-instrumentation-pymysql/src/opentelemetry/instrumentation/pymysql/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml index 4f6577d4a8..49a61287f6 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-pyramid/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-wsgi == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-wsgi == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml index 35ca1119fe..76b049b7c8 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-redis/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "wrapt >= 1.12.1", ] diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py +++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml index 3be544b2e1..ba23cc0b0a 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-remoulade/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py +++ b/instrumentation/opentelemetry-instrumentation-remoulade/src/opentelemetry/instrumentation/remoulade/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml index ce83ca93ac..6252ab3de9 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-requests/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py +++ b/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml index 3d98977347..ebda48982a 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sklearn/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py index f7a124c7b8..604195c10e 100644 --- a/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py +++ b/instrumentation/opentelemetry-instrumentation-sklearn/src/opentelemetry/instrumentation/sklearn/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml index bf5759e57b..338606aa6e 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", "packaging >= 21.0", "wrapt >= 1.11.2", ] diff --git a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml index ff881a91ed..05bda3d1d0 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-dbapi == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-dbapi == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py index 6340c1adfb..17627b21dc 100644 --- a/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py +++ b/instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml index a73d5b0455..69805b660c 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-starlette/pyproject.toml @@ -25,10 +25,10 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-instrumentation-asgi == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-instrumentation-asgi == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index 3c179651d4..fe60ca1251 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-api ~= 1.11", "opentelemetry-sdk ~= 1.11", "psutil ~= 5.9", diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml index e56a566410..ea1c48f011 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tornado/pyproject.toml @@ -24,9 +24,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml index 89a906610b..62e5da5b54 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py +++ b/instrumentation/opentelemetry-instrumentation-tortoiseorm/src/opentelemetry/instrumentation/tortoiseorm/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml index 08a0f90aca..1011912a53 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py index 6340c1adfb..17627b21dc 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" _instruments = tuple() diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml index 628cb46554..b5fafc0fe9 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-urllib3/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", "wrapt >= 1.0.0, < 2.0.0", ] diff --git a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py +++ b/instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml index 69b0e7ff41..e3e8bca651 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-wsgi/pyproject.toml @@ -25,9 +25,9 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", - "opentelemetry-semantic-conventions == 0.45b0.dev", - "opentelemetry-util-http == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", + "opentelemetry-semantic-conventions == 0.46b0.dev", + "opentelemetry-util-http == 0.46b0.dev", ] [project.optional-dependencies] diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py index 2b23bc4994..ff4933b20b 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 1cd2c37625..60d1d6740e 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -28,53 +28,53 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "opentelemetry-instrumentation-aio-pika==0.45b0.dev", - "opentelemetry-instrumentation-aiohttp-client==0.45b0.dev", - "opentelemetry-instrumentation-aiohttp-server==0.45b0.dev", - "opentelemetry-instrumentation-aiopg==0.45b0.dev", - "opentelemetry-instrumentation-asgi==0.45b0.dev", - "opentelemetry-instrumentation-asyncio==0.45b0.dev", - "opentelemetry-instrumentation-asyncpg==0.45b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.45b0.dev", - "opentelemetry-instrumentation-boto==0.45b0.dev", - "opentelemetry-instrumentation-boto3sqs==0.45b0.dev", - "opentelemetry-instrumentation-botocore==0.45b0.dev", - "opentelemetry-instrumentation-cassandra==0.45b0.dev", - "opentelemetry-instrumentation-celery==0.45b0.dev", - "opentelemetry-instrumentation-confluent-kafka==0.45b0.dev", - "opentelemetry-instrumentation-dbapi==0.45b0.dev", - "opentelemetry-instrumentation-django==0.45b0.dev", - "opentelemetry-instrumentation-elasticsearch==0.45b0.dev", - "opentelemetry-instrumentation-falcon==0.45b0.dev", - "opentelemetry-instrumentation-fastapi==0.45b0.dev", - "opentelemetry-instrumentation-flask==0.45b0.dev", - "opentelemetry-instrumentation-grpc==0.45b0.dev", - "opentelemetry-instrumentation-httpx==0.45b0.dev", - "opentelemetry-instrumentation-jinja2==0.45b0.dev", - "opentelemetry-instrumentation-kafka-python==0.45b0.dev", - "opentelemetry-instrumentation-logging==0.45b0.dev", - "opentelemetry-instrumentation-mysql==0.45b0.dev", - "opentelemetry-instrumentation-mysqlclient==0.45b0.dev", - "opentelemetry-instrumentation-pika==0.45b0.dev", - "opentelemetry-instrumentation-psycopg==0.45b0.dev", - "opentelemetry-instrumentation-psycopg2==0.45b0.dev", - "opentelemetry-instrumentation-pymemcache==0.45b0.dev", - "opentelemetry-instrumentation-pymongo==0.45b0.dev", - "opentelemetry-instrumentation-pymysql==0.45b0.dev", - "opentelemetry-instrumentation-pyramid==0.45b0.dev", - "opentelemetry-instrumentation-redis==0.45b0.dev", - "opentelemetry-instrumentation-remoulade==0.45b0.dev", - "opentelemetry-instrumentation-requests==0.45b0.dev", - "opentelemetry-instrumentation-sklearn==0.45b0.dev", - "opentelemetry-instrumentation-sqlalchemy==0.45b0.dev", - "opentelemetry-instrumentation-sqlite3==0.45b0.dev", - "opentelemetry-instrumentation-starlette==0.45b0.dev", - "opentelemetry-instrumentation-system-metrics==0.45b0.dev", - "opentelemetry-instrumentation-tornado==0.45b0.dev", - "opentelemetry-instrumentation-tortoiseorm==0.45b0.dev", - "opentelemetry-instrumentation-urllib==0.45b0.dev", - "opentelemetry-instrumentation-urllib3==0.45b0.dev", - "opentelemetry-instrumentation-wsgi==0.45b0.dev", + "opentelemetry-instrumentation-aio-pika==0.46b0.dev", + "opentelemetry-instrumentation-aiohttp-client==0.46b0.dev", + "opentelemetry-instrumentation-aiohttp-server==0.46b0.dev", + "opentelemetry-instrumentation-aiopg==0.46b0.dev", + "opentelemetry-instrumentation-asgi==0.46b0.dev", + "opentelemetry-instrumentation-asyncio==0.46b0.dev", + "opentelemetry-instrumentation-asyncpg==0.46b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.46b0.dev", + "opentelemetry-instrumentation-boto==0.46b0.dev", + "opentelemetry-instrumentation-boto3sqs==0.46b0.dev", + "opentelemetry-instrumentation-botocore==0.46b0.dev", + "opentelemetry-instrumentation-cassandra==0.46b0.dev", + "opentelemetry-instrumentation-celery==0.46b0.dev", + "opentelemetry-instrumentation-confluent-kafka==0.46b0.dev", + "opentelemetry-instrumentation-dbapi==0.46b0.dev", + "opentelemetry-instrumentation-django==0.46b0.dev", + "opentelemetry-instrumentation-elasticsearch==0.46b0.dev", + "opentelemetry-instrumentation-falcon==0.46b0.dev", + "opentelemetry-instrumentation-fastapi==0.46b0.dev", + "opentelemetry-instrumentation-flask==0.46b0.dev", + "opentelemetry-instrumentation-grpc==0.46b0.dev", + "opentelemetry-instrumentation-httpx==0.46b0.dev", + "opentelemetry-instrumentation-jinja2==0.46b0.dev", + "opentelemetry-instrumentation-kafka-python==0.46b0.dev", + "opentelemetry-instrumentation-logging==0.46b0.dev", + "opentelemetry-instrumentation-mysql==0.46b0.dev", + "opentelemetry-instrumentation-mysqlclient==0.46b0.dev", + "opentelemetry-instrumentation-pika==0.46b0.dev", + "opentelemetry-instrumentation-psycopg==0.46b0.dev", + "opentelemetry-instrumentation-psycopg2==0.46b0.dev", + "opentelemetry-instrumentation-pymemcache==0.46b0.dev", + "opentelemetry-instrumentation-pymongo==0.46b0.dev", + "opentelemetry-instrumentation-pymysql==0.46b0.dev", + "opentelemetry-instrumentation-pyramid==0.46b0.dev", + "opentelemetry-instrumentation-redis==0.46b0.dev", + "opentelemetry-instrumentation-remoulade==0.46b0.dev", + "opentelemetry-instrumentation-requests==0.46b0.dev", + "opentelemetry-instrumentation-sklearn==0.46b0.dev", + "opentelemetry-instrumentation-sqlalchemy==0.46b0.dev", + "opentelemetry-instrumentation-sqlite3==0.46b0.dev", + "opentelemetry-instrumentation-starlette==0.46b0.dev", + "opentelemetry-instrumentation-system-metrics==0.46b0.dev", + "opentelemetry-instrumentation-tornado==0.46b0.dev", + "opentelemetry-instrumentation-tortoiseorm==0.46b0.dev", + "opentelemetry-instrumentation-urllib==0.46b0.dev", + "opentelemetry-instrumentation-urllib3==0.46b0.dev", + "opentelemetry-instrumentation-wsgi==0.46b0.dev", ] [project.urls] diff --git a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py index 2b23bc4994..ff4933b20b 100644 --- a/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py +++ b/opentelemetry-contrib-instrumentations/src/opentelemetry/contrib-instrumentations/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/opentelemetry-distro/pyproject.toml b/opentelemetry-distro/pyproject.toml index 6872aa49c8..0cec60a63f 100644 --- a/opentelemetry-distro/pyproject.toml +++ b/opentelemetry-distro/pyproject.toml @@ -23,13 +23,13 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.45b0.dev", + "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-sdk ~= 1.13", ] [project.optional-dependencies] otlp = [ - "opentelemetry-exporter-otlp == 1.24.0.dev", + "opentelemetry-exporter-otlp == 1.25.0.dev", ] [project.entry-points.opentelemetry_configurator] diff --git a/opentelemetry-distro/src/opentelemetry/distro/version.py b/opentelemetry-distro/src/opentelemetry/distro/version.py index 2b23bc4994..ff4933b20b 100644 --- a/opentelemetry-distro/src/opentelemetry/distro/version.py +++ b/opentelemetry-distro/src/opentelemetry/distro/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 3591581c97..30a41b924a 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -18,179 +18,179 @@ libraries = [ { "library": "aio_pika >= 7.2.0, < 10.0.0", - "instrumentation": "opentelemetry-instrumentation-aio-pika==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-aio-pika==0.46b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.46b0.dev", }, { "library": "aiohttp ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.46b0.dev", }, { "library": "aiopg >= 0.13.0, < 2.0.0", - "instrumentation": "opentelemetry-instrumentation-aiopg==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-aiopg==0.46b0.dev", }, { "library": "asgiref ~= 3.0", - "instrumentation": "opentelemetry-instrumentation-asgi==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-asgi==0.46b0.dev", }, { "library": "asyncpg >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-asyncpg==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-asyncpg==0.46b0.dev", }, { "library": "boto~=2.0", - "instrumentation": "opentelemetry-instrumentation-boto==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto==0.46b0.dev", }, { "library": "boto3 ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-boto3sqs==0.46b0.dev", }, { "library": "botocore ~= 1.0", - "instrumentation": "opentelemetry-instrumentation-botocore==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-botocore==0.46b0.dev", }, { "library": "cassandra-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.46b0.dev", }, { "library": "scylla-driver ~= 3.25", - "instrumentation": "opentelemetry-instrumentation-cassandra==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-cassandra==0.46b0.dev", }, { "library": "celery >= 4.0, < 6.0", - "instrumentation": "opentelemetry-instrumentation-celery==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-celery==0.46b0.dev", }, { "library": "confluent-kafka >= 1.8.2, <= 2.3.0", - "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.46b0.dev", }, { "library": "django >= 1.10", - "instrumentation": "opentelemetry-instrumentation-django==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-django==0.46b0.dev", }, { "library": "elasticsearch >= 2.0", - "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-elasticsearch==0.46b0.dev", }, { "library": "falcon >= 1.4.1, < 3.1.2", - "instrumentation": "opentelemetry-instrumentation-falcon==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-falcon==0.46b0.dev", }, { "library": "fastapi ~= 0.58", - "instrumentation": "opentelemetry-instrumentation-fastapi==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-fastapi==0.46b0.dev", }, { "library": "flask >= 1.0", - "instrumentation": "opentelemetry-instrumentation-flask==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-flask==0.46b0.dev", }, { "library": "grpcio ~= 1.27", - "instrumentation": "opentelemetry-instrumentation-grpc==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-grpc==0.46b0.dev", }, { "library": "httpx >= 0.18.0", - "instrumentation": "opentelemetry-instrumentation-httpx==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-httpx==0.46b0.dev", }, { "library": "jinja2 >= 2.7, < 4.0", - "instrumentation": "opentelemetry-instrumentation-jinja2==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-jinja2==0.46b0.dev", }, { "library": "kafka-python >= 2.0", - "instrumentation": "opentelemetry-instrumentation-kafka-python==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-kafka-python==0.46b0.dev", }, { "library": "mysql-connector-python ~= 8.0", - "instrumentation": "opentelemetry-instrumentation-mysql==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysql==0.46b0.dev", }, { "library": "mysqlclient < 3", - "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-mysqlclient==0.46b0.dev", }, { "library": "pika >= 0.12.0", - "instrumentation": "opentelemetry-instrumentation-pika==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-pika==0.46b0.dev", }, { "library": "psycopg >= 3.1.0", - "instrumentation": "opentelemetry-instrumentation-psycopg==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg==0.46b0.dev", }, { "library": "psycopg2 >= 2.7.3.1", - "instrumentation": "opentelemetry-instrumentation-psycopg2==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-psycopg2==0.46b0.dev", }, { "library": "pymemcache >= 1.3.5, < 5", - "instrumentation": "opentelemetry-instrumentation-pymemcache==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymemcache==0.46b0.dev", }, { "library": "pymongo >= 3.1, < 5.0", - "instrumentation": "opentelemetry-instrumentation-pymongo==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymongo==0.46b0.dev", }, { "library": "PyMySQL < 2", - "instrumentation": "opentelemetry-instrumentation-pymysql==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-pymysql==0.46b0.dev", }, { "library": "pyramid >= 1.7", - "instrumentation": "opentelemetry-instrumentation-pyramid==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-pyramid==0.46b0.dev", }, { "library": "redis >= 2.6", - "instrumentation": "opentelemetry-instrumentation-redis==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-redis==0.46b0.dev", }, { "library": "remoulade >= 0.50", - "instrumentation": "opentelemetry-instrumentation-remoulade==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-remoulade==0.46b0.dev", }, { "library": "requests ~= 2.0", - "instrumentation": "opentelemetry-instrumentation-requests==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-requests==0.46b0.dev", }, { "library": "scikit-learn ~= 0.24.0", - "instrumentation": "opentelemetry-instrumentation-sklearn==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-sklearn==0.46b0.dev", }, { "library": "sqlalchemy", - "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-sqlalchemy==0.46b0.dev", }, { "library": "starlette ~= 0.13.0", - "instrumentation": "opentelemetry-instrumentation-starlette==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-starlette==0.46b0.dev", }, { "library": "psutil >= 5", - "instrumentation": "opentelemetry-instrumentation-system-metrics==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-system-metrics==0.46b0.dev", }, { "library": "tornado >= 5.1.1", - "instrumentation": "opentelemetry-instrumentation-tornado==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-tornado==0.46b0.dev", }, { "library": "tortoise-orm >= 0.17.0", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.46b0.dev", }, { "library": "pydantic >= 1.10.2", - "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-tortoiseorm==0.46b0.dev", }, { "library": "urllib3 >= 1.0.0, < 3.0.0", - "instrumentation": "opentelemetry-instrumentation-urllib3==0.45b0.dev", + "instrumentation": "opentelemetry-instrumentation-urllib3==0.46b0.dev", }, ] default_instrumentations = [ - "opentelemetry-instrumentation-asyncio==0.45b0.dev", - "opentelemetry-instrumentation-aws-lambda==0.45b0.dev", - "opentelemetry-instrumentation-dbapi==0.45b0.dev", - "opentelemetry-instrumentation-logging==0.45b0.dev", - "opentelemetry-instrumentation-sqlite3==0.45b0.dev", - "opentelemetry-instrumentation-urllib==0.45b0.dev", - "opentelemetry-instrumentation-wsgi==0.45b0.dev", + "opentelemetry-instrumentation-asyncio==0.46b0.dev", + "opentelemetry-instrumentation-aws-lambda==0.46b0.dev", + "opentelemetry-instrumentation-dbapi==0.46b0.dev", + "opentelemetry-instrumentation-logging==0.46b0.dev", + "opentelemetry-instrumentation-sqlite3==0.46b0.dev", + "opentelemetry-instrumentation-urllib==0.46b0.dev", + "opentelemetry-instrumentation-wsgi==0.46b0.dev", ] diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py index 2b23bc4994..ff4933b20b 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py index 2b23bc4994..ff4933b20b 100644 --- a/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py +++ b/propagator/opentelemetry-propagator-ot-trace/src/opentelemetry/propagators/ot_trace/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py index 2b23bc4994..ff4933b20b 100644 --- a/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py +++ b/resource/opentelemetry-resource-detector-container/src/opentelemetry/resource/detector/container/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py index 2b23bc4994..ff4933b20b 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.45b0.dev" +__version__ = "0.46b0.dev" From 955b483f7a35edd8df20d3751676a1da6e151ed3 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 3 Apr 2024 16:44:09 -0700 Subject: [PATCH 193/200] Remove context manager check (#2391) --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index 5ea4385ea0..114dadef75 100644 --- a/.pylintrc +++ b/.pylintrc @@ -81,6 +81,7 @@ disable=missing-docstring, missing-module-docstring, # temp-pylint-upgrade import-error, # needed as a workaround as reported here: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/290 cyclic-import, + not-context-manager # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From 805c72ceff2ca46a978037e0d3958d5630f5bbdd Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 4 Apr 2024 18:10:30 +0100 Subject: [PATCH 194/200] rename `type` to `asgi.event.type` in ASGI instrumentation (#2300) --- CHANGELOG.md | 10 ++++++++- .../instrumentation/asgi/__init__.py | 6 +++-- .../tests/test_asgi_middleware.py | 22 +++++++++---------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ff90e611b..0c361881fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Breaking changes + +- Rename `type` attribute to `asgi.event.type` in `opentelemetry-instrumentation-asgi` + ([#2300](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2300)) + ## Version 1.24.0/0.45b0 (2024-03-28) +### Added + - `opentelemetry-instrumentation-psycopg` Async Instrumentation for psycopg 3.x ([#2146](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2146)) @@ -30,9 +37,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - AwsLambdaInstrumentor sets `cloud.account.id` span attribute ([#2367](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2367)) + ## Version 1.23.0/0.44b0 (2024-02-23) -- Drop uspport for 3.7 +- Drop support for 3.7 ([#2151](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2151)) - `opentelemetry-resource-detector-azure` Added 10s timeout to VM Resource Detector ([#2119](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2119)) diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index d28d85f975..8e4d699cbb 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -672,7 +672,9 @@ async def otel_receive(): if receive_span.is_recording(): if message["type"] == "websocket.receive": set_status_code(receive_span, 200) - receive_span.set_attribute("type", message["type"]) + receive_span.set_attribute( + "asgi.event.type", message["type"] + ) return message return otel_receive @@ -703,7 +705,7 @@ async def otel_send(message: dict[str, Any]): elif message["type"] == "websocket.send": set_status_code(server_span, 200) set_status_code(send_span, 200) - send_span.set_attribute("type", message["type"]) + send_span.set_attribute("asgi.event.type", message["type"]) if ( server_span.is_recording() and server_span.kind == trace.SpanKind.SERVER diff --git a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py index 0b2a844d96..2a8fd1c1f0 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py @@ -268,20 +268,20 @@ def validate_outputs(self, outputs, error=None, modifiers=None): { "name": "GET / http receive", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "http.request"}, + "attributes": {"asgi.event.type": "http.request"}, }, { "name": "GET / http send", "kind": trace_api.SpanKind.INTERNAL, "attributes": { SpanAttributes.HTTP_STATUS_CODE: 200, - "type": "http.response.start", + "asgi.event.type": "http.response.start", }, }, { "name": "GET / http send", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "http.response.body"}, + "attributes": {"asgi.event.type": "http.response.body"}, }, { "name": "GET /", @@ -358,7 +358,7 @@ def add_more_body_spans(expected: list): more_body_span = { "name": "GET / http send", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "http.response.body"}, + "attributes": {"asgi.event.type": "http.response.body"}, } extra_spans = [more_body_span] * 3 expected[2:2] = extra_spans @@ -396,12 +396,12 @@ def add_body_and_trailer_span(expected: list): body_span = { "name": "GET / http send", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "http.response.body"}, + "attributes": {"asgi.event.type": "http.response.body"}, } trailer_span = { "name": "GET / http send", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "http.response.trailers"}, + "attributes": {"asgi.event.type": "http.response.trailers"}, } expected[2:2] = [body_span] expected[4:4] = [trailer_span] * 2 @@ -582,18 +582,18 @@ def test_websocket(self): { "name": "/ websocket receive", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "websocket.connect"}, + "attributes": {"asgi.event.type": "websocket.connect"}, }, { "name": "/ websocket send", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "websocket.accept"}, + "attributes": {"asgi.event.type": "websocket.accept"}, }, { "name": "/ websocket receive", "kind": trace_api.SpanKind.INTERNAL, "attributes": { - "type": "websocket.receive", + "asgi.event.type": "websocket.receive", SpanAttributes.HTTP_STATUS_CODE: 200, }, }, @@ -601,14 +601,14 @@ def test_websocket(self): "name": "/ websocket send", "kind": trace_api.SpanKind.INTERNAL, "attributes": { - "type": "websocket.send", + "asgi.event.type": "websocket.send", SpanAttributes.HTTP_STATUS_CODE: 200, }, }, { "name": "/ websocket receive", "kind": trace_api.SpanKind.INTERNAL, - "attributes": {"type": "websocket.disconnect"}, + "attributes": {"asgi.event.type": "websocket.disconnect"}, }, { "name": "/", From 85ca0a6b80af3e9406c0134fa0cfaf86f4017e32 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 5 Apr 2024 09:47:10 -0700 Subject: [PATCH 195/200] Change meta data service timeout to 200ms (#2387) --- .../CHANGELOG.md | 15 +++++++++++++++ .../opentelemetry/resource/detector/azure/vm.py | 6 ++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 resource/opentelemetry-resource-detector-azure/CHANGELOG.md diff --git a/resource/opentelemetry-resource-detector-azure/CHANGELOG.md b/resource/opentelemetry-resource-detector-azure/CHANGELOG.md new file mode 100644 index 0000000000..f92a5db8b1 --- /dev/null +++ b/resource/opentelemetry-resource-detector-azure/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased + +- Change meta data service timeout to 200ms + ([#2387](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2387)) + +## Version 0.1.2 (2024-01-25) + +- Initial CHANGELOG.md entry diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py index a4ba295ab9..da4c6563a5 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/vm.py @@ -71,10 +71,8 @@ def _get_azure_vm_metadata(): request = Request(_AZURE_VM_METADATA_ENDPOINT) request.add_header("Metadata", "True") try: - # TODO: Changed to 4s to fit into OTel SDK's 5 second timeout. - # Lengthen or allow user input if issue is resolved. - # See https://github.com/open-telemetry/opentelemetry-python/issues/3644 - with urlopen(request, timeout=4) as response: + # VM metadata service should not take more than 200ms on success case + with urlopen(request, timeout=0.2) as response: return loads(response.read()) except URLError: # Not on Azure VM From fdcbbddb6c753e5e9d494ba399a5b4bcab4afc3f Mon Sep 17 00:00:00 2001 From: Jeremy Voss Date: Fri, 5 Apr 2024 10:26:36 -0700 Subject: [PATCH 196/200] Azure resource detector 0.1.4 (#2394) --- .../src/opentelemetry/resource/detector/azure/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py index 97109f529b..f961659f70 100644 --- a/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py +++ b/resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.1.2" +__version__ = "0.1.4" From fdb2e141d4455a367f9e5fb1971a950c6a59178a Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Tue, 9 Apr 2024 10:49:26 -0700 Subject: [PATCH 197/200] Update contrib repo approvers list (#2395) --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c315b4a876..6968de717e 100644 --- a/README.md +++ b/README.md @@ -108,14 +108,20 @@ Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telem - [Aaron Abbott](https://github.com/aabmass), Google - [Jeremy Voss](https://github.com/jeremydvoss), Microsoft +- [Owais Lone](https://github.com/owais), Splunk +- [Pablo Collins](https://github.com/pmcollins), Splunk +- [Riccardo Magliocchetti](https://github.com/xrmx), Elastic - [Sanket Mehta](https://github.com/sanketmehta28), Cisco +- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io +- [Tammy Baylis](https://github.com/tammy-baylis-swi), SolarWinds Emeritus Approvers: +- [Ashutosh Goel](https://github.com/ashu658), Cisco - [Héctor Hernández](https://github.com/hectorhdzg), Microsoft -- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google +- [Nikolay Sokolik](https://github.com/oxeye-nikolay), Oxeye +- [Nikolay Sokolik](https://github.com/nikosokolik), Oxeye - [Nathaniel Ruiz Nowell](https://github.com/NathanielRN), AWS -- [Ashutosh Goel](https://github.com/ashu658), Cisco *Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).* @@ -129,7 +135,7 @@ Emeritus Maintainers: - [Alex Boten](https://github.com/codeboten), Lightstep - [Owais Lone](https://github.com/owais), Splunk -- [Srikanth Chekuri](https://github.com/srikanthccv), signoz.io +- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google *Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).* From 804a9090a111d20b63338012318fd00ff6178cb0 Mon Sep 17 00:00:00 2001 From: abstractOwl Date: Wed, 10 Apr 2024 10:05:38 -0700 Subject: [PATCH 198/200] Add AWS resource detector entry points (#2382) --- CHANGELOG.md | 3 +++ .../opentelemetry-sdk-extension-aws/pyproject.toml | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c361881fd..e5186ac7fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +- `opentelemetry-sdk-extension-aws` Register AWS resource detectors under the + `opentelemetry_resource_detector` entry point + ([#2382](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2382)) ### Breaking changes diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml index 52259bd52b..12b2b23ddc 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml +++ b/sdk-extension/opentelemetry-sdk-extension-aws/pyproject.toml @@ -30,6 +30,13 @@ dependencies = [ [project.entry-points.opentelemetry_id_generator] xray = "opentelemetry.sdk.extension.aws.trace.aws_xray_id_generator:AwsXRayIdGenerator" +[project.entry-points.opentelemetry_resource_detector] +aws_ec2 = "opentelemetry.sdk.extension.aws.resource.ec2:AwsEc2ResourceDetector" +aws_ecs = "opentelemetry.sdk.extension.aws.resource.ecs:AwsEcsResourceDetector" +aws_eks = "opentelemetry.sdk.extension.aws.resource.eks:AwsEksResourceDetector" +aws_elastic_beanstalk = "opentelemetry.sdk.extension.aws.resource.beanstalk:AwsBeanstalkResourceDetector" +aws_lambda = "opentelemetry.sdk.extension.aws.resource._lambda:AwsLambdaResourceDetector" + [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/sdk-extension/opentelemetry-sdk-extension-aws" From a5c48871fa299d7a65d3b1e30989e624792ad4b1 Mon Sep 17 00:00:00 2001 From: Changemyminds Date: Fri, 12 Apr 2024 00:57:19 +0800 Subject: [PATCH 199/200] feat: add opentelemetry-instrumentation-threading library (#2253) * feat: add opentelemetry-instrumentation-threading library * fix: update python file with black formatter * fix: modified title underline too short issue * fix: modified library sorted via isort tool * fix: modified CHANGELOG.md and remove unused parameter * test: migrated unit test cases from the #1582 to this project * chroe: updated the tox.ini test commands * fix: fixed the lint issue * feat: support ThreadPool and update document * fix: fixed the lint issue * refactor: remove redundant class and simplify capture OTel context usage * fix: removed unused parameter * test: added a new test case for thread pool * fix: remove unused return response * refactor: compared the array * fix: remove f-string * fix: fixed pylint issue * fix: test library * fix: updated CHANGELOG.md --------- Co-authored-by: Aaron Abbott --- CHANGELOG.md | 5 + docs/instrumentation/threading/threading.rst | 7 + instrumentation/README.md | 1 + .../LICENSE | 201 ++++++++++++++++ .../README.rst | 25 ++ .../pyproject.toml | 51 ++++ .../instrumentation/threading/__init__.py | 149 ++++++++++++ .../instrumentation/threading/package.py | 17 ++ .../instrumentation/threading/version.py | 15 ++ .../test-requirements.txt | 18 ++ .../tests/__init__.py | 0 .../tests/test_threading.py | 226 ++++++++++++++++++ .../pyproject.toml | 1 + .../instrumentation/bootstrap_gen.py | 1 + tox.ini | 8 + 15 files changed, 725 insertions(+) create mode 100644 docs/instrumentation/threading/threading.rst create mode 100644 instrumentation/opentelemetry-instrumentation-threading/LICENSE create mode 100644 instrumentation/opentelemetry-instrumentation-threading/README.rst create mode 100644 instrumentation/opentelemetry-instrumentation-threading/pyproject.toml create mode 100644 instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/package.py create mode 100644 instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py create mode 100644 instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt create mode 100644 instrumentation/opentelemetry-instrumentation-threading/tests/__init__.py create mode 100644 instrumentation/opentelemetry-instrumentation-threading/tests/test_threading.py diff --git a/CHANGELOG.md b/CHANGELOG.md index e5186ac7fa..911ae8fa70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rename `type` attribute to `asgi.event.type` in `opentelemetry-instrumentation-asgi` ([#2300](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2300)) +### Added + +- `opentelemetry-instrumentation-threading` Initial release for threading + ([#2253](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2253)) + ## Version 1.24.0/0.45b0 (2024-03-28) ### Added diff --git a/docs/instrumentation/threading/threading.rst b/docs/instrumentation/threading/threading.rst new file mode 100644 index 0000000000..06bca89a49 --- /dev/null +++ b/docs/instrumentation/threading/threading.rst @@ -0,0 +1,7 @@ +OpenTelemetry Threading Instrumentation +======================================= + +.. automodule:: opentelemetry.instrumentation.threading + :members: + :undoc-members: + :show-inheritance: diff --git a/instrumentation/README.md b/instrumentation/README.md index 0cce7e5de7..62caabd81a 100644 --- a/instrumentation/README.md +++ b/instrumentation/README.md @@ -43,6 +43,7 @@ | [opentelemetry-instrumentation-sqlite3](./opentelemetry-instrumentation-sqlite3) | sqlite3 | No | [opentelemetry-instrumentation-starlette](./opentelemetry-instrumentation-starlette) | starlette ~= 0.13.0 | Yes | [opentelemetry-instrumentation-system-metrics](./opentelemetry-instrumentation-system-metrics) | psutil >= 5 | No +| [opentelemetry-instrumentation-threading](./opentelemetry-instrumentation-threading) | threading | No | [opentelemetry-instrumentation-tornado](./opentelemetry-instrumentation-tornado) | tornado >= 5.1.1 | Yes | [opentelemetry-instrumentation-tortoiseorm](./opentelemetry-instrumentation-tortoiseorm) | tortoise-orm >= 0.17.0 | No | [opentelemetry-instrumentation-urllib](./opentelemetry-instrumentation-urllib) | urllib | Yes diff --git a/instrumentation/opentelemetry-instrumentation-threading/LICENSE b/instrumentation/opentelemetry-instrumentation-threading/LICENSE new file mode 100644 index 0000000000..1ef7dad2c5 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + 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. diff --git a/instrumentation/opentelemetry-instrumentation-threading/README.rst b/instrumentation/opentelemetry-instrumentation-threading/README.rst new file mode 100644 index 0000000000..93097dfcb6 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/README.rst @@ -0,0 +1,25 @@ +OpenTelemetry threading Instrumentation +======================================= + +|pypi| + +.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-threading.svg + :target: https://pypi.org/project/opentelemetry-instrumentation-threading/ + +This library provides instrumentation for the `threading` module to ensure that +the OpenTelemetry context is propagated across threads. It is important to note +that this instrumentation does not produce any telemetry data on its own. It +merely ensures that the context is correctly propagated when threads are used. + +Installation +------------ + +:: + + pip install opentelemetry-instrumentation-threading + +References +---------- + +* `OpenTelemetry Threading Tracing `_ +* `OpenTelemetry Project `_ diff --git a/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml new file mode 100644 index 0000000000..16874b13f9 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/pyproject.toml @@ -0,0 +1,51 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opentelemetry-instrumentation-threading" +dynamic = ["version"] +description = "Thread context propagation support for OpenTelemetry" +readme = "README.rst" +license = "Apache-2.0" +requires-python = ">=3.8" +authors = [ + { name = "OpenTelemetry Authors", email = "cncf-opentelemetry-contributors@lists.cncf.io" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "opentelemetry-api ~= 1.12", + "opentelemetry-instrumentation == 0.46b0.dev", + "wrapt >= 1.0.0, < 2.0.0", +] + +[project.optional-dependencies] +instruments = [] + +[project.entry-points.opentelemetry_instrumentor] +threading = "opentelemetry.instrumentation.threading:ThreadingInstrumentor" + +[project.urls] +Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-threading" + +[tool.hatch.version] +path = "src/opentelemetry/instrumentation/threading/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/src", + "/tests", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/opentelemetry"] diff --git a/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/__init__.py b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/__init__.py new file mode 100644 index 0000000000..be1eec139e --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/__init__.py @@ -0,0 +1,149 @@ +# 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. +""" +Instrument threading to propagate OpenTelemetry context. + +Usage +----- + +.. code-block:: python + + from opentelemetry.instrumentation.threading import ThreadingInstrumentor + + ThreadingInstrumentor().instrument() + +This library provides instrumentation for the `threading` module to ensure that +the OpenTelemetry context is propagated across threads. It is important to note +that this instrumentation does not produce any telemetry data on its own. It +merely ensures that the context is correctly propagated when threads are used. + + +When instrumented, new threads created using threading.Thread, threading.Timer, +or within futures.ThreadPoolExecutor will have the current OpenTelemetry +context attached, and this context will be re-activated in the thread's +run method or the executor's worker thread." +""" + +import threading +from concurrent import futures +from typing import Collection + +from wrapt import wrap_function_wrapper + +from opentelemetry import context +from opentelemetry.instrumentation.instrumentor import BaseInstrumentor +from opentelemetry.instrumentation.threading.package import _instruments +from opentelemetry.instrumentation.utils import unwrap + + +class ThreadingInstrumentor(BaseInstrumentor): + __WRAPPER_START_METHOD = "start" + __WRAPPER_RUN_METHOD = "run" + __WRAPPER_SUBMIT_METHOD = "submit" + + def instrumentation_dependencies(self) -> Collection[str]: + return _instruments + + def _instrument(self, **kwargs): + self._instrument_thread() + self._instrument_timer() + self._instrument_thread_pool() + + def _uninstrument(self, **kwargs): + self._uninstrument_thread() + self._uninstrument_timer() + self._uninstrument_thread_pool() + + @staticmethod + def _instrument_thread(): + wrap_function_wrapper( + threading.Thread, + ThreadingInstrumentor.__WRAPPER_START_METHOD, + ThreadingInstrumentor.__wrap_threading_start, + ) + wrap_function_wrapper( + threading.Thread, + ThreadingInstrumentor.__WRAPPER_RUN_METHOD, + ThreadingInstrumentor.__wrap_threading_run, + ) + + @staticmethod + def _instrument_timer(): + wrap_function_wrapper( + threading.Timer, + ThreadingInstrumentor.__WRAPPER_START_METHOD, + ThreadingInstrumentor.__wrap_threading_start, + ) + wrap_function_wrapper( + threading.Timer, + ThreadingInstrumentor.__WRAPPER_RUN_METHOD, + ThreadingInstrumentor.__wrap_threading_run, + ) + + @staticmethod + def _instrument_thread_pool(): + wrap_function_wrapper( + futures.ThreadPoolExecutor, + ThreadingInstrumentor.__WRAPPER_SUBMIT_METHOD, + ThreadingInstrumentor.__wrap_thread_pool_submit, + ) + + @staticmethod + def _uninstrument_thread(): + unwrap(threading.Thread, ThreadingInstrumentor.__WRAPPER_START_METHOD) + unwrap(threading.Thread, ThreadingInstrumentor.__WRAPPER_RUN_METHOD) + + @staticmethod + def _uninstrument_timer(): + unwrap(threading.Timer, ThreadingInstrumentor.__WRAPPER_START_METHOD) + unwrap(threading.Timer, ThreadingInstrumentor.__WRAPPER_RUN_METHOD) + + @staticmethod + def _uninstrument_thread_pool(): + unwrap( + futures.ThreadPoolExecutor, + ThreadingInstrumentor.__WRAPPER_SUBMIT_METHOD, + ) + + @staticmethod + def __wrap_threading_start(call_wrapped, instance, args, kwargs): + instance._otel_context = context.get_current() + return call_wrapped(*args, **kwargs) + + @staticmethod + def __wrap_threading_run(call_wrapped, instance, args, kwargs): + token = None + try: + token = context.attach(instance._otel_context) + return call_wrapped(*args, **kwargs) + finally: + context.detach(token) + + @staticmethod + def __wrap_thread_pool_submit(call_wrapped, instance, args, kwargs): + # obtain the original function and wrapped kwargs + original_func = args[0] + otel_context = context.get_current() + + def wrapped_func(*func_args, **func_kwargs): + token = None + try: + token = context.attach(otel_context) + return original_func(*func_args, **func_kwargs) + finally: + context.detach(token) + + # replace the original function with the wrapped function + new_args = (wrapped_func,) + args[1:] + return call_wrapped(*new_args, **kwargs) diff --git a/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/package.py b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/package.py new file mode 100644 index 0000000000..1bf177779b --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/package.py @@ -0,0 +1,17 @@ +# 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. + +_instruments = () + +_supports_metrics = False diff --git a/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py new file mode 100644 index 0000000000..ff4933b20b --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/version.py @@ -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.46b0.dev" diff --git a/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt new file mode 100644 index 0000000000..ffda21f234 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt @@ -0,0 +1,18 @@ +asgiref==3.7.2 +attrs==23.2.0 +confluent-kafka==2.3.0 +Deprecated==1.2.14 +importlib-metadata==6.11.0 +iniconfig==2.0.0 +packaging==23.2 +pluggy==1.4.0 +py==1.11.0 +py-cpuinfo==9.0.0 +pytest==7.1.3 +pytest-benchmark==4.0.0 +tomli==2.0.1 +typing_extensions==4.9.0 +wrapt==1.16.0 +zipp==3.17.0 +-e opentelemetry-instrumentation +-e instrumentation/opentelemetry-instrumentation-threading diff --git a/instrumentation/opentelemetry-instrumentation-threading/tests/__init__.py b/instrumentation/opentelemetry-instrumentation-threading/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/instrumentation/opentelemetry-instrumentation-threading/tests/test_threading.py b/instrumentation/opentelemetry-instrumentation-threading/tests/test_threading.py new file mode 100644 index 0000000000..15f67b8d61 --- /dev/null +++ b/instrumentation/opentelemetry-instrumentation-threading/tests/test_threading.py @@ -0,0 +1,226 @@ +# Copyright 2020, 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. + +import threading +from concurrent.futures import ThreadPoolExecutor +from typing import List + +from opentelemetry import trace +from opentelemetry.instrumentation.threading import ThreadingInstrumentor +from opentelemetry.test.test_base import TestBase + + +class TestThreading(TestBase): + def setUp(self): + super().setUp() + self._tracer = self.tracer_provider.get_tracer(__name__) + self._mock_span_contexts: List[trace.SpanContext] = [] + ThreadingInstrumentor().instrument() + + def tearDown(self): + ThreadingInstrumentor().uninstrument() + super().tearDown() + + def get_root_span(self): + return self._tracer.start_as_current_span("rootSpan") + + def test_trace_context_propagation_in_thread(self): + self.run_threading_test(threading.Thread(target=self.fake_func)) + + def test_trace_context_propagation_in_timer(self): + self.run_threading_test( + threading.Timer(interval=1, function=self.fake_func) + ) + + def run_threading_test(self, thread: threading.Thread): + with self.get_root_span() as span: + expected_span_context = span.get_span_context() + thread.start() + thread.join() + + # check result + self.assertEqual(len(self._mock_span_contexts), 1) + self.assertEqual( + self._mock_span_contexts[0], expected_span_context + ) + + def test_trace_context_propagation_in_thread_pool_with_multiple_workers( + self, + ): + max_workers = 10 + executor = ThreadPoolExecutor(max_workers=max_workers) + + expected_span_contexts: List[trace.SpanContext] = [] + futures_list = [] + for num in range(max_workers): + with self._tracer.start_as_current_span(f"trace_{num}") as span: + expected_span_context = span.get_span_context() + expected_span_contexts.append(expected_span_context) + future = executor.submit( + self.get_current_span_context_for_test + ) + futures_list.append(future) + + result_span_contexts = [future.result() for future in futures_list] + + # check result + self.assertEqual(result_span_contexts, expected_span_contexts) + + def test_trace_context_propagation_in_thread_pool_with_single_worker(self): + max_workers = 1 + with ThreadPoolExecutor(max_workers=max_workers) as executor: + # test propagation of the same trace context across multiple tasks + with self._tracer.start_as_current_span("task") as task_span: + expected_task_context = task_span.get_span_context() + future1 = executor.submit( + self.get_current_span_context_for_test + ) + future2 = executor.submit( + self.get_current_span_context_for_test + ) + + # check result + self.assertEqual(future1.result(), expected_task_context) + self.assertEqual(future2.result(), expected_task_context) + + # test propagation of different trace contexts across tasks in sequence + with self._tracer.start_as_current_span("task1") as task1_span: + expected_task1_context = task1_span.get_span_context() + future1 = executor.submit( + self.get_current_span_context_for_test + ) + + # check result + self.assertEqual(future1.result(), expected_task1_context) + + with self._tracer.start_as_current_span("task2") as task2_span: + expected_task2_context = task2_span.get_span_context() + future2 = executor.submit( + self.get_current_span_context_for_test + ) + + # check result + self.assertEqual(future2.result(), expected_task2_context) + + def fake_func(self): + span_context = self.get_current_span_context_for_test() + self._mock_span_contexts.append(span_context) + + @staticmethod + def get_current_span_context_for_test() -> trace.SpanContext: + return trace.get_current_span().get_span_context() + + def print_square(self, num): + with self._tracer.start_as_current_span("square"): + return num * num + + def print_cube(self, num): + with self._tracer.start_as_current_span("cube"): + return num * num * num + + def print_square_with_thread(self, num): + with self._tracer.start_as_current_span("square"): + cube_thread = threading.Thread(target=self.print_cube, args=(10,)) + + cube_thread.start() + cube_thread.join() + return num * num + + def calculate(self, num): + with self._tracer.start_as_current_span("calculate"): + square_thread = threading.Thread( + target=self.print_square, args=(num,) + ) + cube_thread = threading.Thread(target=self.print_cube, args=(num,)) + square_thread.start() + square_thread.join() + + cube_thread.start() + cube_thread.join() + + def test_without_thread_nesting(self): + square_thread = threading.Thread(target=self.print_square, args=(10,)) + + with self._tracer.start_as_current_span("root"): + square_thread.start() + square_thread.join() + + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 2) + + # pylint: disable=unbalanced-tuple-unpacking + target, root = spans[:2] + + self.assertIs(target.parent, root.get_span_context()) + self.assertIsNone(root.parent) + + def test_with_thread_nesting(self): + # + # Following scenario is tested. + # threadA -> methodA -> threadB -> methodB + # + + square_thread = threading.Thread( + target=self.print_square_with_thread, args=(10,) + ) + + with self._tracer.start_as_current_span("root"): + square_thread.start() + square_thread.join() + + spans = self.memory_exporter.get_finished_spans() + + self.assertEqual(len(spans), 3) + # pylint: disable=unbalanced-tuple-unpacking + cube, square, root = spans[:3] + + self.assertIs(cube.parent, square.get_span_context()) + self.assertIs(square.parent, root.get_span_context()) + self.assertIsNone(root.parent) + + def test_with_thread_multi_nesting(self): + # + # Following scenario is tested. + # / threadB -> methodB + # threadA -> methodA -> + # \ threadC -> methodC + # + calculate_thread = threading.Thread(target=self.calculate, args=(10,)) + + with self._tracer.start_as_current_span("root"): + calculate_thread.start() + calculate_thread.join() + + spans = self.memory_exporter.get_finished_spans() + + self.assertEqual(len(spans), 4) + + # pylint: disable=unbalanced-tuple-unpacking + cube, square, calculate, root = spans[:4] + + self.assertIs(cube.parent, calculate.get_span_context()) + self.assertIs(square.parent, calculate.get_span_context()) + self.assertIs(calculate.parent, root.get_span_context()) + self.assertIsNone(root.parent) + + def test_uninstrumented(self): + ThreadingInstrumentor().uninstrument() + + square_thread = threading.Thread(target=self.print_square, args=(10,)) + square_thread.start() + square_thread.join() + spans = self.memory_exporter.get_finished_spans() + self.assertEqual(len(spans), 1) + + ThreadingInstrumentor().instrument() diff --git a/opentelemetry-contrib-instrumentations/pyproject.toml b/opentelemetry-contrib-instrumentations/pyproject.toml index 60d1d6740e..7e4afad6f7 100644 --- a/opentelemetry-contrib-instrumentations/pyproject.toml +++ b/opentelemetry-contrib-instrumentations/pyproject.toml @@ -70,6 +70,7 @@ dependencies = [ "opentelemetry-instrumentation-sqlite3==0.46b0.dev", "opentelemetry-instrumentation-starlette==0.46b0.dev", "opentelemetry-instrumentation-system-metrics==0.46b0.dev", + "opentelemetry-instrumentation-threading==0.46b0.dev", "opentelemetry-instrumentation-tornado==0.46b0.dev", "opentelemetry-instrumentation-tortoiseorm==0.46b0.dev", "opentelemetry-instrumentation-urllib==0.46b0.dev", diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py index 30a41b924a..455d08e41a 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py @@ -191,6 +191,7 @@ "opentelemetry-instrumentation-dbapi==0.46b0.dev", "opentelemetry-instrumentation-logging==0.46b0.dev", "opentelemetry-instrumentation-sqlite3==0.46b0.dev", + "opentelemetry-instrumentation-threading==0.46b0.dev", "opentelemetry-instrumentation-urllib==0.46b0.dev", "opentelemetry-instrumentation-wsgi==0.46b0.dev", ] diff --git a/tox.ini b/tox.ini index 068b5d583e..420ae899f0 100644 --- a/tox.ini +++ b/tox.ini @@ -233,6 +233,10 @@ envlist = py3{6,8,9,10,11}-test-instrumentation-system-metrics pypy3-test-instrumentation-system-metrics + ; opentelemetry-instrumentation-threading + py3{8,9,10,11}-test-instrumentation-threading + pypy3-test-instrumentation-threading + ; opentelemetry-instrumentation-tornado py3{8,9,10,11}-test-instrumentation-tornado pypy3-test-instrumentation-tornado @@ -421,6 +425,8 @@ commands_pre = system-metrics: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt + threading: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt + tornado: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/test-requirements.txt tortoiseorm: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt @@ -517,6 +523,7 @@ commands = test-instrumentation-sqlite3: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-sqlite3/tests {posargs} test-instrumentation-starlette: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-starlette/tests {posargs} test-instrumentation-system-metrics: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/tests {posargs} + test-instrumentation-threading: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-threading/tests {posargs} test-instrumentation-tornado: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tornado/tests {posargs} test-instrumentation-tortoiseorm: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/tests {posargs} test-instrumentation-wsgi: pytest {toxinidir}/instrumentation/opentelemetry-instrumentation-wsgi/tests {posargs} @@ -620,6 +627,7 @@ commands_pre = pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-asyncio/test-requirements.txt pip install -r {toxinidir}/exporter/opentelemetry-exporter-richconsole/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-system-metrics/test-requirements.txt + pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-threading/test-requirements.txt pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-tortoiseorm/test-requirements.txt # requires snappy headers to be available on the system pip install -r {toxinidir}/resource/opentelemetry-resource-detector-container/test-requirements.txt From cc6508932edf0eda19fdb37f0092c699d60cd5a6 Mon Sep 17 00:00:00 2001 From: Povilas Versockas Date: Mon, 15 Apr 2024 16:34:52 +0300 Subject: [PATCH 200/200] feat: update otel dependencies --- .../pyproject.toml | 7 ++----- .../opentelemetry-instrumentation-botocore/pyproject.toml | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml index 97c0a01245..3aa065a09a 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/pyproject.toml @@ -22,16 +22,13 @@ classifiers = [ "Programming Language :: Python :: 3.8", ] dependencies = [ - "opentelemetry-instrumentation == 0.41b0", + "opentelemetry-instrumentation == 0.45b0", "opentelemetry-propagator-aws-xray == 1.0.1", - "opentelemetry-semantic-conventions == 0.41b0", + "opentelemetry-semantic-conventions == 0.45b0", ] [project.optional-dependencies] instruments = [] -test = [ - "opentelemetry-test-utils == 0.41b0", -] [project.urls] Homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-aws-lambda" diff --git a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml index c02c3bdf80..ad92b35417 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-botocore/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] dependencies = [ "opentelemetry-api ~= 1.12", - "opentelemetry-instrumentation == 0.41b0", - "opentelemetry-semantic-conventions == 0.41b0", + "opentelemetry-instrumentation == 0.45b0", + "opentelemetry-semantic-conventions == 0.45b0", "opentelemetry-propagator-aws-xray == 1.0.1", ]