Skip to content

Commit

Permalink
Merge branch 'httpx-semconv-migration' of github.com:emdneto/opentele…
Browse files Browse the repository at this point in the history
…metry-python-contrib into httpx-semconv-migration
  • Loading branch information
emdneto committed Jun 28, 2024
2 parents 9a562a8 + c66fa79 commit 603bc46
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `opentelemetry-instrumentation-aws-lambda` Bugfix: AWS Lambda event source key incorrect for SNS in instrumentation library.
([#2612](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2612))
- `opentelemetry-instrumentation-system-metrics` Permit to use psutil 6.0+.
([#2630](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2630))

### Added

Expand Down Expand Up @@ -46,7 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2300](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2300))
- Rename AwsLambdaInstrumentor span attributes `faas.id` to `cloud.resource_id`, `faas.execution` to `faas.invocation_id`
([#2372](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2372))
- Drop support for instrumenting elasticsearch client < 6`
- Drop support for instrumenting elasticsearch client < 6
([#2422](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2422))
- `opentelemetry-instrumentation-wsgi` Add `http.method` to `span.name`
([#2425](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2425))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import pymysql

import opentelemetry.instrumentation.pymysql
from opentelemetry import trace as trace_api
from opentelemetry.instrumentation.pymysql import PyMySQLInstrumentor
from opentelemetry.sdk import resources
from opentelemetry.test.test_base import TestBase
Expand Down Expand Up @@ -78,6 +79,20 @@ def test_custom_tracer_provider(self, mock_connect):

self.assertIs(span.resource, resource)

@mock.patch("pymysql.connect")
# pylint: disable=unused-argument
def test_no_op_tracer_provider(self, mock_connect):
PyMySQLInstrumentor().instrument(
tracer_provider=trace_api.NoOpTracerProvider()
)
cnx = pymysql.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), 0)

@mock.patch("pymysql.connect")
# pylint: disable=unused-argument
def test_instrument_connection(self, mock_connect):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [
dependencies = [
"opentelemetry-instrumentation == 0.47b0.dev",
"opentelemetry-api ~= 1.11",
"psutil ~= 5.9",
"psutil >= 5.9.0, < 7",
]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ importlib-metadata==6.11.0
iniconfig==2.0.0
packaging==24.0
pluggy==1.5.0
psutil==5.9.8
psutil==6.0.0
py-cpuinfo==9.0.0
pytest==7.4.4
pytest-benchmark==4.0.0
Expand Down

0 comments on commit 603bc46

Please sign in to comment.