Skip to content

Commit e2040ef

Browse files
Merge branch 'main' into dbapi-semconv-opt-in
2 parents bd608f0 + 2caa924 commit e2040ef

33 files changed

Lines changed: 509 additions & 60 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
- Bump `pylint` to `4.0.5`
1717
([#4244](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4244))
18+
- `opentelemetry-instrumentation-sqlite3`: Add uninstrument, error status, suppress, and no-op tests
19+
([#4335](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4335))
20+
21+
### Fixed
22+
23+
- `opentelemetry-instrumentation-pika` Use `ObjectProxy` instead of `BaseObjectProxy` for `ReadyMessagesDequeProxy` to restore iterability with wrapt 2.x
24+
([#4461](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4461))
25+
- `opentelemetry-instrumentation-dbapi` Use `ObjectProxy` instead of `BaseObjectProxy` for `TracedCursorProxy` to restore iterability with wrapt 2.x
26+
([#4427](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4427))
27+
- `opentelemetry-instrumentation-flask`: Clean up environ keys in `_teardown_request` to prevent duplicate execution
28+
([#4341](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4341))
29+
- `opentelemetry-instrumentation-flask`: Stop reading the deprecated (from 3.1) `flask.__version__` attribute; resolve the Flask version via `importlib.metadata`
30+
([#4422](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4422))
31+
- `opentelemetry-instrumentation-celery`: Coerce non-string values to strings in `CeleryGetter.get()` to prevent `TypeError` in `TraceState.from_header()` when Celery request attributes contain ints
32+
([#4360](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4360))
33+
- `opentelemetry-instrumentation-aiohttp-server`: Use `canonical` attribute of the `Resource` as a span name
34+
([#3896](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3896))
1835

1936
### Breaking changes
2037

@@ -1167,15 +1184,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11671184

11681185
### Added
11691186

1170-
- Support `aio_pika` 9.x (([#1670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1670])
1187+
- Support `aio_pika` 9.x ([#1670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1670))
11711188
- `opentelemetry-instrumentation-redis` Add `sanitize_query` config option to allow query sanitization. ([#1572](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1572))
11721189
- `opentelemetry-instrumentation-elasticsearch` Add optional db.statement query sanitization.
11731190
([#1598](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1598))
11741191
- `opentelemetry-instrumentation-celery` Record exceptions as events on the span.
11751192
([#1573](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1573))
11761193
- Add metric instrumentation for urllib
11771194
([#1553](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1553))
1178-
- `opentelemetry/sdk/extension/aws` Implement [`aws.ecs.*`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud_provider/aws/ecs.md) and [`aws.logs.*`](https://opentelemetry.io/docs/reference/specification/resource/semantic_conventions/cloud_provider/aws/logs/) resource attributes in the `AwsEcsResourceDetector` detector when the ECS Metadata v4 is available
1195+
- `opentelemetry/sdk/extension/aws` Implement [`aws.ecs.*`](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/aws/ecs/) and [`aws.logs.*`](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/aws/logs/) resource attributes in the `AwsEcsResourceDetector` detector when the ECS Metadata v4 is available
11791196
([#1212](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1212))
11801197
- `opentelemetry-instrumentation-aio-pika` Support `aio_pika` 8.x
11811198
([#1481](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1481))
@@ -1371,7 +1388,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13711388
- Add a test for asgi using NoOpTracerProvider
13721389
([#1367](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1367))
13731390

1374-
## [1.12.0rc2-0.32b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc2-0.32b0) - 2022-07-01
1391+
## [1.12.0rc2-0.32b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc2) - 2022-07-01
13751392

13761393
- Pyramid: Only categorize 500s server exceptions as errors
13771394
([#1037](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1037))
@@ -2005,7 +2022,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
20052022
- `opentelemetry-instrumentation-grpc` Add tests for grpc span attributes, grpc `abort()` conditions
20062023
([#236](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/236))
20072024
- Add README and example app for Prometheus Remote Write Exporter
2008-
([#227](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/227]))
2025+
([#227](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/227))
20092026
- `opentelemetry-instrumentation-botocore` Adds a field to report the number of retries it take to complete an API call
20102027
([#275](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/275))
20112028
- `opentelemetry-instrumentation-requests` Use instanceof to check if responses are valid Response objects
@@ -2392,8 +2409,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23922409
- `opentelemetry-ext-http-requests` Updates for core library changes
23932410

23942411
- `Added support for PyPy3` Initial release
2395-
2396-
## [#1033](https://github.com/open-telemetryopentelemetry-python-contrib/issues/1033)
2412+
([#1033](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1033))
23972413

23982414
## Version 0.1a0 (2019-09-30)
23992415

CONTRIBUTING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Please also read the [OpenTelemetry Contributor Guide](https://github.com/open-t
4242
- [Guideline for GenAI instrumentations](#guideline-for-genai-instrumentations)
4343
- [Get Involved](#get-involved)
4444
- [Expectations from contributors](#expectations-from-contributors)
45+
- [Guidelines for native OpenTelemetry instrumentation](#guidelines-for-native-opentelemetry-instrumentation)
4546
- [Updating supported Python versions](#updating-supported-python-versions)
4647
- [Bumping the Python baseline](#bumping-the-python-baseline)
4748
- [Adding support for a new Python release](#adding-support-for-a-new-python-release)
@@ -293,7 +294,7 @@ Some of the tox targets install packages from the [OpenTelemetry Python Core Rep
293294
CORE_REPO_SHA=c49ad57bfe35cfc69bfa863d74058ca9bec55fc3 tox
294295
```
295296

296-
The continuous integration overrides that environment variable with as per the configuration [here](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/.github/workflows/test_0.yml#L14).
297+
The continuous 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#L17).
297298

298299
## Style Guide
299300

@@ -307,6 +308,9 @@ The continuous integration overrides that environment variable with as per the c
307308

308309
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.
309310

311+
- Find or create a new [Issue](https://github.com/open-telemetry/opentelemetry-python-contrib/issues) describing the tool or framework to instrument and its use cases to support with OpenTelemetry.
312+
- Be familiar with the [expectations from contributors](#expectations-from-contributors) that apply.
313+
- If you're a tool or framework maintainer, please consider using the OpenTelemetry API directly to support [native instrumentation](#guidelines-for-native-opentelemetry-instrumentation) instead of adding a new community instrumentation library.
310314
- Follow semantic conventions
311315
- The instrumentation should follow the semantic conventions defined [here](https://github.com/open-telemetry/semantic-conventions/tree/main/docs).
312316
- To ensure consistency, we encourage contributions that align with [STABLE](https://opentelemetry.io/docs/specs/otel/document-status/#lifecycle-status) semantic conventions if available. This approach helps us avoid potential confusion and reduces the need to support multiple outdated versions of semantic conventions. However, we are still open to considering exceptional cases where changes are well justified.
@@ -384,6 +388,16 @@ Instrumentations that relate to [Generative AI](https://opentelemetry.io/docs/sp
384388

385389
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.
386390

391+
### Guidelines for native OpenTelemetry instrumentation
392+
393+
The preferred approach to supporting instrumentation of a tool or framework is native OpenTelemetry instrumentation. Compared to adding a new instrumentation library to this community repository, native instrumentation is better for:
394+
395+
* continued support by framework experts long-term
396+
* access to more context for critical paths and correlations
397+
* granularity and performance
398+
399+
To support native instrumentation, the tool or framework should use the [OpenTelemetry API](https://opentelemetry-python.readthedocs.io/en/latest/) directly to emit traces, metrics, and logs.
400+
387401
## Updating supported Python versions
388402

389403
### Bumping the Python baseline

docs-requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ PyMySQL~=1.1.1
4444
pymssql~=2.3.2
4545
pyramid>=1.7
4646
redis>=2.6
47-
remoulade>=0.50
47+
remoulade[limits]>=5.0.0 ; python_version >= "3.12"
48+
remoulade>=0.50.0 ; python_version < "3.12"
4849
sqlalchemy>=1.0
4950
starlette~=0.50
5051
tornado>=5.1.1
5152
tortoise-orm>=0.17.0
53+
wrapt~=2.1
5254

5355
# required by opamp
5456
uuid_utils

docs/nitpick-exceptions.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ py-class=
4444
psycopg.Connection
4545
psycopg.AsyncConnection
4646
ObjectProxy
47+
wrapt.proxies.ObjectProxy
4748
fastapi.applications.FastAPI
4849
starlette.applications.Starlette
4950
_contextvars.Token

instrumentation-genai/opentelemetry-instrumentation-anthropic/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Fix compatibility with wrapt 2.x by using positional arguments in `wrap_function_wrapper()` calls
11+
([#4445](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4445))
12+
1013
### Added
1114

1215
- Add async Anthropic message stream wrappers and manager wrappers, with wrapper

instrumentation-genai/opentelemetry-instrumentation-anthropic/src/opentelemetry/instrumentation/anthropic/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def _instrument(self, **kwargs: Any) -> None:
101101

102102
# Patch Messages.create
103103
wrap_function_wrapper(
104-
module="anthropic.resources.messages",
105-
name="Messages.create",
106-
wrapper=messages_create(handler),
104+
"anthropic.resources.messages",
105+
"Messages.create",
106+
messages_create(handler),
107107
)
108108

109109
def _uninstrument(self, **kwargs: Any) -> None:

instrumentation-genai/opentelemetry-instrumentation-anthropic/tests/requirements.latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ anthropic
4040
pytest==7.4.4
4141
pytest-vcr==1.0.2
4242
pytest-asyncio==0.21.0
43-
wrapt==1.16.0
43+
wrapt==2.1.2
4444
# test with the latest version of opentelemetry-api, sdk, and semantic conventions
4545

4646
-e opentelemetry-instrumentation

instrumentation-genai/opentelemetry-instrumentation-langchain/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Fix compatibility with wrapt 2.x by using positional arguments in `wrap_function_wrapper()` calls
11+
([#4445](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4445))
1012
- Added span support for genAI langchain llm invocation.
1113
([#3665](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3665))
1214
- Added support to call genai utils handler for langchain LLM invocations.

instrumentation-genai/opentelemetry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def _instrument(self, **kwargs: Any):
8383
)
8484

8585
wrap_function_wrapper(
86-
module="langchain_core.callbacks",
87-
name="BaseCallbackManager.__init__",
88-
wrapper=_BaseCallbackManagerInitWrapper(otel_callback_handler),
86+
"langchain_core.callbacks",
87+
"BaseCallbackManager.__init__",
88+
_BaseCallbackManagerInitWrapper(otel_callback_handler),
8989
)
9090

9191
def _uninstrument(self, **kwargs: Any):

instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Import `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` from
11+
`opentelemetry.util.genai.environment_variables` instead of re-defining it locally,
12+
making `opentelemetry-util-genai` the single source of truth for this constant.
13+
([#4455](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4455))
14+
- Fix compatibility with wrapt 2.x by using positional arguments in `wrap_function_wrapper()` calls
15+
([#4445](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4445))
1016
- Fix `ChoiceBuffer` crash on streaming tool-call deltas with `arguments=None`
1117
([#4350](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4350))
1218
- Fix `StreamWrapper` missing `.headers` and other attributes when using `with_raw_response` streaming

0 commit comments

Comments
 (0)