版本发布 8
- Fix overwritten log attributes in vertexai instrumentation ([#3925](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3925)) - Add the `GEN_AI_OUTPUT_TYPE`, `GEN_AI_REQUEST_CHOICE_COUNT` and `GEN_AI_REQUEST_SEED` sem conv request attributes to events/spans generated in the stable instrumentation. This was added pre sem conv 1.36 so it should be in the stable instrumentation. See ([#4011](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4011)).
- Ensure log event is written and completion hook is called even when model call results in exception. Put new log event (` gen_ai.client.inference.operation.details`) behind the flag `OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental`. Ensure same sem conv attributes are on the log and span. Fix an issue where the instrumentation would crash when a pydantic.BaseModel class was passed as the response schema ([#3905](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3905)). - Add the `GEN_AI_OUTPUT_TYPE` sem conv request attributes to events/spans generated in the stable instrumentation. This was added pre sem conv 1.36 so it should be in the stable instrumentation. Fix a bug in how system instructions were recorded in the `gen_ai.system.message` log event. It will now always be recorded as `{"content" : "text of system instructions"}`. See ([#4011](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4011)).
- Fix service tier attribute names: use `GEN_AI_OPENAI_REQUEST_SERVICE_TIER` for request attributes and `GEN_AI_OPENAI_RESPONSE_SERVICE_TIER` for response attributes. ([#3920](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3920)) - Added support for OpenAI embeddings instrumentation ([#3461](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3461)) - Record prompt and completion events regardless of span sampling decision. ([#3226](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3226)) - Filter out attributes with the value of NotGiven instances ([#3760](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3760)) - Migrate off the deprecated events API to use the logs API ([#3625](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3628))
- Add jsonlines support to fsspec uploader ([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3791](#3791)) - Rename "fsspec_upload" entry point and classes to more generic "upload" ([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3798](#3798)) - Record content-type and use canonical paths in fsspec genai uploader ([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3795](#3795)) - Make inputs / outputs / system instructions optional params to `on_completion`, ([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3802](#3802)). - Use a SHA256 hash of the system instructions as it's upload filename, and check if the file exists before re-uploading it, ([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3814](#3814)).
- Initial barebones package skeleton: minimal instrumentor stub, version module, and packaging metadata/entry point. ([#3805](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3805)) - Implement OpenAI Agents span processing aligned with GenAI semantic conventions. ([#3817](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3817)) - Input and output according to GenAI spec. ([#3824](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3824))
### Fixed - `opentelemetry-instrumentation-fastapi`: Fix middleware ordering to cover all exception handling use cases. ([#3664](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3664)) - `opentelemetry-instrumentation-asgi`: Make all user hooks failsafe and record exceptions in hooks. ([#3664](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3664)) - `opentelemetry-instrumentation-fastapi`: Fix memory leak in `uninstrument_app()` by properly removing apps from the tracking set ([#3688](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3688)) - `opentelemetry-instrumentation-tornado` Fix server (request) duration metric calculation ([#3679](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3679)) - `opentelemetry-instrumentation-tornado`: Fix to properly skip all server telemetry when URL excluded. ([#3680](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3680)) - `opentelemetry-instrumentation`: Avoid calls to `context.detach` with `None` token. ([#3673](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3673)) - `opentelemetry-instrumentation-starlette`/`opentelemetry-instrumentation-fastapi`: Fixes a crash when host-based routing is used ([#3507](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3507)) - Fix documentation order of sections and headers for Django, Flask, MySQL, mysqlclient, psycopg, psycopg2, pymysql, sqlalchemy instrumentations. ([#3719](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3719)) - `opentelemetry-instrumentation-asgi` Fixed an issue where FastAPI reports IP instead of URL. ([#3670](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3670)) - `opentelemetry-instrumentation-httpx`: fix missing metric response attributes when tracing is disabled ([#3615](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3615)) - `opentelemetry-instrumentation-fastapi`: Don't pass bounded server_request_hook when using `FastAPIInstrumentor.instrument()` ([#3701](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3701)) ### Added - `opentelemetry-util-genai` Add a utility to parse the `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable. Add `gen_ai_latest_experimental` as a new value to the Sem Conv stability flag ([#3716](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3716)). - `opentelemetry-instrumentation-confluent-kafka` Add support for confluent-kafka <=2.11.0 ([#3685](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3685)) - `opentelemetry-instrumentation-system-metrics`: Add `cpython.gc.collected_objects` and `cpython.gc.uncollectable_objects` metrics ([#3666](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3666)) - `opentelemetry-sdk-extension-aws` Add AWS X-Ray Remote Sampler with initial Rules Poller implementation ([#3366](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3366)) - `opentelemetry-instrumentation`: add support for `OTEL_PYTHON_AUTO_INSTRUMENTATION_EXPERIMENTAL_GEVENT_PATCH` to inform opentelemetry-instrument about gevent monkeypatching ([#3699](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3699)) - `opentelemetry-instrumentation`: botocore: Add support for AWS Step Functions semantic convention attributes ([#3737](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3737)) - `opentelemetry-instrumentation-botocore`: Add support for SNS semantic convention attribute aws.sns.topic.arn ([#3734](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3734)) - `opentelemetry-instrumentation`: botocore: upgrade moto package from 5.0.9 to 5.1.11 ([#3736](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3736))
This is a patch release on the previous 1.34.0/0.55b0 release, fixing the issue(s) below.
### Added - `opentelemetry-instrumentation-aiokafka` Add instrumentation of `consumer.getmany` (batch) ([#3257](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3257)) ### Fixed - `opentelemetry-instrumentation-system-metrics`: fix loading on Google Cloud Run ([#3533](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3533)) - `opentelemetry-instrumentation-fastapi`: fix wrapping of middlewares ([#3012](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3012)) - `opentelemetry-instrumentation-starlette` Remove max version constraint on starlette ([#3456](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3456)) - `opentelemetry-instrumentation-starlette` Fix memory leak and double middleware ([#3529](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3529)) - `opentelemetry-instrumentation-urllib3`: proper bucket boundaries in stable semconv http duration metrics ([#3518](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3518)) - `opentelemetry-instrumentation-urllib`: proper bucket boundaries in stable semconv http duration metrics ([#3519](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3519)) - `opentelemetry-instrumentation-falcon`: proper bucket boundaries in stable semconv http duration ([#3525](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3525)) - `opentelemetry-instrumentation-wsgi`: add explicit http duration buckets for stable semconv ([#3527](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3527)) - `opentelemetry-instrumentation-asgi`: add explicit http duration buckets for stable semconv ([#3526](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3526)) - `opentelemetry-instrumentation-flask`: proper bucket boundaries in stable semconv http duration ([#3523](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3523)) - `opentelemetry-instrumentation-django`: proper bucket boundaries in stable semconv http duration ([#3524](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3524)) - `opentelemetry-instrumentation-grpc`: support non-list interceptors ([#3520](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3520)) - `opentelemetry-instrumentation-botocore` Ensure spans end on early stream closure for Bedrock Streaming APIs ([#3481](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3481)) - `opentelemetry-instrumentation-sqlalchemy` Respect suppress_instrumentation functionality ([#3477](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3477)) - `opentelemetry-instrumentation-botocore`: fix handling of tool input in Bedrock ConverseStream ([#3544](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3544)) - `opentelemetry-instrumentation-botocore` Add type check when extracting tool use from Bedrock request message content ([#3548](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3548)) - `opentelemetry-instrumentation-dbapi` Respect suppress_instrumentation functionality ([#3460](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3460)) - `opentelemetry-resource-detector-container` Correctly parse container id when using systemd and cgroupsv1 ([#3429](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3429)) ### Breaking changes - `opentelemetry-instrumentation-botocore` Use `cloud.region` instead of `aws.region` span attribute as per semantic conventions. ([#3474](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3474)) - `opentelemetry-instrumentation-fastapi`: Drop support for FastAPI versions earlier than `0.92` ([#3012](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3012)) - `opentelemetry-resource-detector-container`: rename package name to `opentelemetry-resource-detector-containerid` ([#3536](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3536)) ### Added - `opentelemetry-instrumentation-aiohttp-client` Add support for HTTP metrics ([#3517](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3517)) - `opentelemetry-instrumentation-httpx` Add support for HTTP metrics ([#3513](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3513)) - `opentelemetry-instrumentation` Allow re-raising exception when instrumentation fails ([#3545](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3545)) ### Deprecated - Drop support for Python 3.8, bump baseline to Python 3.9. ([#3399](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3399))