版本发布 8
- `opentelemetry-sdk`: Add `host` resource detector support to declarative file configuration via `detection_development.detectors[].host` ([#5002](https://github.com/open-telemetry/opentelemetry-python/pull/5002)) - `opentelemetry-sdk`: Add `container` resource detector support to declarative file configuration via `detection_development.detectors[].container`, using entry point loading of the `opentelemetry-resource-detector-containerid` contrib package ([#5004](https://github.com/open-telemetry/opentelemetry-python/pull/5004)) - `opentelemetry-sdk`: Add `create_tracer_provider`/`configure_tracer_provider` to declarative file configuration, enabling TracerProvider instantiation from config files without reading env vars ([#4985](https://github.com/open-telemetry/opentelemetry-python/pull/4985)) - Enabled the flake8-tidy-import plugins rules for the ruff linter. These rules throw warnings for relative imports in the modules. ([#5019](https://github.com/open-telemetry/opentelemetry-python/pull/5019)) - `opentelemetry-sdk`: Fix `AttributeError` in `ExplicitBucketHistogramAggregation` when applied to non-Histogram instruments without explicit boundaries ([#5034](https://github.com/open-telemetry/opentelemetry-python/pull/5034)) - Fix `BatchLogRecordProcessor` default `schedule_delay_millis` from 5000ms to 1000ms to comply with the OTel specification. Note: logs may be exported 5x more frequently by default (e.g. for users who don't explicitly set the `OTEL_BLRP_SCHEDULE_DELAY` env var). ([#4998](https://github.com/open-telemetry/opentelemetry-python/pull/4998)) - `opentelemetry-sdk`: Add `process` resource detector support to declarative file configuration via `detection_development.detectors[].process` ([#5001](https://github.com/open-telemetry/opentelemetry-python/pull/5001)) - `opentelemetry-sdk`: Add shared `_parse_headers` helper for declarative config OTLP exporters ([#5021](https://github.com/open-telemetry/opentelemetry-python/pull/5021)) - `opentelemetry-api`: Replace a broad exception in attribute cleaning tests to satisfy pylint in the `lint-opentelemetry-api` CI job - `opentelemetry-sdk`: Add `create_meter_provider`/`configure_meter_provider` to declarative file configuration, enabling MeterProvider instantiation from config files without reading env vars ([#4987](https://github.com/open-telemetry/opentelemetry-python/pull/4987)) - `opentelemetry-sdk`: Add `create_resource` and `create_propagator`/`configure_propagator` to declarative file configuration, enabling Resource and propagator instantiation from config files without reading env vars ([#4979](https://github.com/open-telemetry/opentelemetry-python/pull/4979)) - `opentelemetry-sdk`: Map Python `CRITICAL` log level to OTel `FATAL` severity text per the specification ([#4984](https://github.com/open-telemetry/opentelemetry-python/issues/4984)) - `opentelemetry-sdk`: Add file configuration support with YAML/JSON loading, environment variable substitution, and schema validation against the vendored OTel config JSON schema ([#4898](https://github.com/open-telemetry/opentelemetry-python/pull/4898)) - Fix intermittent CI failures in `getting-started` and `tracecontext` jobs caused by GitHub git CDN SHA propagation lag by installing contrib packages from the already-checked-out local copy instead of a second git clone ([#4958](https://github.com/open-telemetry/opentelemetry-python/pull/4958)) - `opentelemetry-sdk`: fix type annotations on `MetricReader` and related types ([#4938](https://github.com/open-telemetry/opentelemetry-python/pull/4938/)) - `opentelemetry-sdk`: implement log creation metric ([#4935](https://github.com/open-telemetry/opentelemetry-python/pull/4935)) - `opentelemetry-sdk`: implement metric reader metrics ([#4970](https://github.com/open-telemetry/opentelemetry-python/pull/4970)) - `opentelemetry-sdk`: implement processor metrics ([#5012](https://github.com/open-telemetry/opentelemetry-python/pull/5012)) - `opentelemetry-sdk`: upgrade vendored OTel configuration schema from v1.0.0-rc.3 to v1.0.0 ([#4965](https://github.com/open-telemetry/opentelemetry-python/pull/4965)) - improve check-links ci job ([#4978](https://github.com/open-telemetry/opentelemetry-python/pull/4978)) - Resolve some Pyright type errors in Span/ReadableSpan and utility stubs ([#4973](https://github.com/open-telemetry/opentelemetry-python/pull/4973)) - `opentelemetry-exporter-prometheus`: Fix metric name prefix ([#4895](https://github.com/open-telemetry/opentelemetry-python/pull/4895)) - `opentelemetry-api`, `opentelemetry-sdk`: Add deepcopy support for `BoundedAttributes` and `BoundedList` ([#4934](https://github.com/open-telemetry/opentelemetry-python/pull/4934)) - `opentelemetry-proto-json`, `opentelemetry-codegen-json`: Implement custom protoc plugin to generate OTLP JSON class definitions ([#4910](https://github.com/open-telemetry/opentelemetry-python/pull/4910)) - Add configurable `max_export_batch_size` to OTLP HTTP metrics exporter ([#4576](https://github.com/open-telemetry/opentelemetry-python/pull/4576)) - `opentelemetry-sdk`: Implement experimental Meter configurator ([#4966](https://github.com/open-telemetry/opentelemetry-python/pull/4966)) - `opentelemetry-exporter-otlp-proto-http`: use consistent protobuf for export request ([#5015](https://github.com/open-telemetry/opentelemetry-python/pull/5015)) - `opentelemetry-sdk`: cache TracerConfig into the tracer, this changes an internal interface. Only one Tracer with the same instrumentation scope will be created ([#5007](https://github.com/open-telemetry/opentelemetry-python/pull/5007)) - Redo OTLPMetricExporter unit tests of `max_export_batch_size` to use real `export` ([#5036](https://github.com/open-telemetry/opentelemetry-python/pull/5036)) - `opentelemetry-sdk`: Implement experimental Logger configurator ([#4980](https://github.com/open-telemetry/opentelemetry-python/pull/4980))
- `opentelemetry-sdk`: deprecate `LoggingHandler` in favor of `opentelemetry-instrumentation-logging`, see `opentelemetry-instrumentation-logging` documentation ([#4919](https://github.com/open-telemetry/opentelemetry-python/pull/4919)) - `opentelemetry-sdk`: Clarify log processor error handling expectations in documentation ([#4915](https://github.com/open-telemetry/opentelemetry-python/pull/4915)) - bump semantic-conventions to v1.40.0 ([#4941](https://github.com/open-telemetry/opentelemetry-python/pull/4941)) - Add stale PR GitHub Action ([#4926](https://github.com/open-telemetry/opentelemetry-python/pull/4926)) - `opentelemetry-sdk`: Drop unused Jaeger exporter environment variables (exporter removed in 1.22.0) ([#4918](https://github.com/open-telemetry/opentelemetry-python/issues/4918)) - `opentelemetry-sdk`: Clarify timeout units in environment variable documentation ([#4906](https://github.com/open-telemetry/opentelemetry-python/pull/4906)) - `opentelemetry-exporter-otlp-proto-grpc`: Fix re-initialization of gRPC channel on UNAVAILABLE error ([#4825](https://github.com/open-telemetry/opentelemetry-python/pull/4825)) - `opentelemetry-exporter-prometheus`: Fix duplicate HELP/TYPE declarations for metrics with different label sets ([#4868](https://github.com/open-telemetry/opentelemetry-python/issues/4868)) - Allow loading all resource detectors by setting `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` to `*` ([#4819](https://github.com/open-telemetry/opentelemetry-python/pull/4819)) - `opentelemetry-sdk`: Fix the type hint of the `_metrics_data` property to allow `None` ([#4837](https://github.com/open-telemetry/opentelemetry-python/pull/4837)). - Regenerate opentelemetry-proto code with v1.9.0 release ([#4840](https://github.com/open-telemetry/opentelemetry-python/pull/4840)) - Add python 3.14 support ([#4798](https://github.com/open-telemetry/opentelemetry-python/pull/4798)) - Silence events API warnings for internal users ([#4847](https://github.com/open-telemetry/opentelemetry-python/pull/4847)) - opentelemetry-sdk: make it possible to override the default processors in the SDK configurator ([#4806](https://github.com/open-telemetry/opentelemetry-python/pull/4806)) - Prevent possible endless recursion from happening in `SimpleLogRecordProcessor.on_emit`, ([#4799](https://github.com/open-telemetry/opentelemetry-python/pull/4799)) and ([#4867](https://github.com/open-telemetry/opentelemetry-python/pull/4867)). - Implement span start/end metrics ([#4880](https://github.com/open-telemetry/opentelemetry-python/pull/4880)) - Add environment variable carriers to API ([#4609](https://github.com/open-telemetry/opentelemetry-python/pull/4609)) - Add experimental composable rule based sampler ([#4882](https://github.com/open-telemetry/opentelemetry-python/pull/4882)) - Make ConcurrentMultiSpanProcessor fork safe ([#4862](https://github.com/open-telemetry/opentelemetry-python/pull/4862)) - `opentelemetry-exporter-otlp-proto-http`: fix retry logic and error handling for connection failures in trace, metric, and log exporters ([#4709](https://github.com/open-telemetry/opentelemetry-python/pull/4709)) - `opentelemetry-sdk`: avoid RuntimeError during iteration of view instrument match dictionary in MetricReaderStorage.collect() ([#4891](https://github.com/open-telemetry/opentelemetry-python/pull/4891)) - Implement experimental TracerConfigurator ([#4861](https://github.com/open-telemetry/opentelemetry-python/pull/4861)) - `opentelemetry-sdk`: Fix instrument creation race condition ([#4913](https://github.com/open-telemetry/opentelemetry-python/pull/4913)) - bump semantic-conventions to v1.39.0 ([#4914](https://github.com/open-telemetry/opentelemetry-python/pull/4914)) - `opentelemetry-sdk`: automatically generate configuration models using OTel config JSON schema ([#4879](https://github.com/open-telemetry/opentelemetry-python/pull/4879))
- Add missing Prometheus exporter documentation ([#4485](https://github.com/open-telemetry/opentelemetry-python/pull/4485)) - Overwrite logging.config.fileConfig and logging.config.dictConfig to ensure the OTLP `LogHandler` remains attached to the root logger. Fix a bug that can cause a deadlock to occur over `logging._lock` in some cases ([#4636](https://github.com/open-telemetry/opentelemetry-python/pull/4636)). - otlp-http-exporter: set default value for param `timeout_sec` in `_export` method ([#4691](https://github.com/open-telemetry/opentelemetry-python/pull/4691)) - Update OTLP gRPC/HTTP exporters: calling shutdown will now interrupt exporters that are sleeping before a retry attempt, and cause them to return failure immediately. Update BatchSpan/LogRecordProcessors: shutdown will now complete after 30 seconds of trying to finish exporting any buffered telemetry, instead of continuing to export until all telemetry was exported. ([#4638](https://github.com/open-telemetry/opentelemetry-python/pull/4638)).
- Update OTLP proto to v1.7 [#4645](https://github.com/open-telemetry/opentelemetry-python/pull/4645). - Add `event_name` as a top level field in the `LogRecord`. Events are now simply logs with the `event_name` field set, the logs SDK should be used to emit events ([#4652](https://github.com/open-telemetry/opentelemetry-python/pull/4652)). - Update OTLP gRPC/HTTP exporters: the export timeout is now inclusive of all retries and backoffs. A +/-20% jitter was added to all backoffs. A pointless 32 second sleep that occurred after all retries had completed/failed was removed. ([#4564](https://github.com/open-telemetry/opentelemetry-python/pull/4564)). - Update ConsoleLogExporter.export to handle LogRecord's containing bytes type in the body ([#4614](https://github.com/open-telemetry/opentelemetry-python/pull/4614/)). - opentelemetry-sdk: Fix invalid `type: ignore` that causes mypy to ignore the whole file ([#4618](https://github.com/open-telemetry/opentelemetry-python/pull/4618)) - Add `span_exporter` property back to `BatchSpanProcessor` class ([#4621](https://github.com/open-telemetry/opentelemetry-python/pull/4621)) - Fix license field in pyproject.toml files ([#4625](https://github.com/open-telemetry/opentelemetry-python/pull/4625)) - Update logger level to NOTSET in logs example ([#4637](https://github.com/open-telemetry/opentelemetry-python/pull/4637)) - Logging API accepts optional `context`; deprecates `trace_id`, `span_id`, `trace_flags`. ([#4597](https://github.com/open-telemetry/opentelemetry-python/pull/4597)) and ([#4668](https://github.com/open-telemetry/opentelemetry-python/pull/4668)) - sdk: use context instead of trace_id,span_id for initializing LogRecord ([#4653](https://github.com/open-telemetry/opentelemetry-python/pull/4653)) - Rename LogRecordProcessor.emit to on_emit ([#4648](https://github.com/open-telemetry/opentelemetry-python/pull/4648)) - Logging API hide std_to_otel function to convert python logging severity to otel severity ([#4649](https://github.com/open-telemetry/opentelemetry-python/pull/4649)) - proto: relax protobuf version requirement to support v6 ([#4620](https://github.com/open-telemetry/opentelemetry-python/pull/4620)) - Bump semantic-conventions to 1.36.0 ([#4669](https://github.com/open-telemetry/opentelemetry-python/pull/4669)) - Set expected User-Agent in HTTP headers for grpc OTLP exporter ([#4658](https://github.com/open-telemetry/opentelemetry-python/pull/4658))
- typecheck: add sdk/resources and drop mypy ([#4578](https://github.com/open-telemetry/opentelemetry-python/pull/4578)) - Refactor `BatchLogRecordProcessor` to simplify code and make the control flow more clear ([#4562](https://github.com/open-telemetry/opentelemetry-python/pull/4562/) and [#4535](https://github.com/open-telemetry/opentelemetry-python/pull/4535)). - Use PEP702 for marking deprecations ([#4522](https://github.com/open-telemetry/opentelemetry-python/pull/4522)) - Refactor `BatchLogRecordProcessor` and `BatchSpanProcessor` to simplify code and make the control flow more clear ([#4562](https://github.com/open-telemetry/opentelemetry-python/pull/4562/) [#4535](https://github.com/open-telemetry/opentelemetry-python/pull/4535), and [#4580](https://github.com/open-telemetry/opentelemetry-python/pull/4580)). - Remove log messages from `BatchLogRecordProcessor.emit`, this caused the program to crash at shutdown with a max recursion error ([#4586](https://github.com/open-telemetry/opentelemetry-python/pull/4586)). - Configurable max retry timeout for grpc exporter ([#4333](https://github.com/open-telemetry/opentelemetry-python/pull/4333)) - opentelemetry-api: allow importlib-metadata 8.7.0 ([#4593](https://github.com/open-telemetry/opentelemetry-python/pull/4593)) - opentelemetry-test-utils: assert explicit bucket boundaries in histogram metrics ([#4595](https://github.com/open-telemetry/opentelemetry-python/pull/4595)) - Bump semantic conventions to 1.34.0 ([#4599](https://github.com/open-telemetry/opentelemetry-python/pull/4599)) - Drop support for Python 3.8 ([#4520](https://github.com/open-telemetry/opentelemetry-python/pull/4520))
This is a patch release on the previous 1.33.0/0.54b0 release, fixing the issue(s) below. - Remove log messages from `BatchLogRecordProcessor.emit`, this caused the program to crash at shutdown with a max recursion error ([#4586](https://github.com/open-telemetry/opentelemetry-python/pull/4586)).
- Fix user agent in OTLP HTTP metrics exporter ([#4475](https://github.com/open-telemetry/opentelemetry-python/pull/4475)) - Improve performance of baggage operations ([#4466](https://github.com/open-telemetry/opentelemetry-python/pull/4466)) - sdk: remove duplicated constant definitions for `environment_variables` ([#4491](https://github.com/open-telemetry/opentelemetry-python/pull/4491)) - api: Revert record `BaseException` change in `trace_api.use_span()` ([#4494](https://github.com/open-telemetry/opentelemetry-python/pull/4494)) - Improve CI by cancelling stale runs and setting timeouts ([#4498](https://github.com/open-telemetry/opentelemetry-python/pull/4498)) - Patch logging.basicConfig so OTel logs don't cause console logs to disappear ([#4436](https://github.com/open-telemetry/opentelemetry-python/pull/4436)) - Bump semantic conventions to 1.32.0 ([#4530](https://github.com/open-telemetry/opentelemetry-python/pull/4530)) - Fix ExplicitBucketHistogramAggregation to handle multiple explicit bucket boundaries advisories ([#4521](https://github.com/open-telemetry/opentelemetry-python/pull/4521)) - opentelemetry-sdk: Fix serialization of objects in log handler ([#4528](https://github.com/open-telemetry/opentelemetry-python/pull/4528))
This is a patch release on the previous 1.31.0/0.52b0 release, fixing the issue(s) below. - api: Revert record `BaseException` change in `trace_api.use_span()` ([#4494](https://github.com/open-telemetry/opentelemetry-python/pull/4494))