github open-telemetry/opentelemetry-python v1.46.0
Version 1.46.0/0.67b0

one hour ago

Added

  • opentelemetry-exporter-prometheus: Add preferred_aggregation parameter to PrometheusMetricReader (#5411)

  • opentelemetry-sdk: add support for the MetricProducer interface (#5419)

  • opentelemetry-api, opentelemetry-sdk: add experimental support for advisory attributes on metric instruments via the private _attributes_advisory keyword argument of Meter.create_* methods. (#5444)

  • opentelemetry-configuration: add configuration support for OTLP JSON exporters (#5669)

  • opentelemetry-sdk: align resource detector schema url conflict behavior with other languages (#5672)

  • opentelemetry-exporter-http-transport: add environment proxy support to the urllib3 transport, set its default connection pool size to 10, and prefer certifi's CA bundle when available (#5715)

  • opentelemetry-sdk: make Logger.enabled() respect the configured minimum severity and trace-based filtering (#5724)

  • opentelemetry-exporter-otlp-json-http, opentelemetry-exporter-otlp-json-file: export the log exporter at the package top level (#5733)

  • opentelemetry-test-utils: expose live-check reports and retained stdout/stderr, and add named Weaver configuration and advice-data options. (#5739)

  • opentelemetry-docker-tests: add declarative config end-to-end tests (#5740)

  • opentelemetry-configuration: add TLS/mTLS support to declarative configuration (#5781)

  • opentelemetry-sdk: add additional logs benchmarks and improve performance for disabled loggers (#5784)

  • opentelemetry-sdk, opentelemetry-configuration, opentelemetry-exporter-prometheus: enforce metric cardinality limits (default 2000) with the otel.metric.overflow attribute, configurable through View(aggregation_cardinality_limit=...), reader cardinality_limits and declarative configuration (#5809)

  • opentelemetry-api, opentelemetry-sdk: Add experimental _type keyword argument to Tracer.start_span and Tracer.start_as_current_span; the SDK validates span type and exposes it on ReadableSpan._type (#5819)

  • Add Python 3.15 and 3.15t support (#5833)

  • opentelemetry-semantic-conventions: update semantic conventions to 1.45.0 (#5885)

  • opentelemetry-api: tolerate future unknown keyword parameters in methods of the Tracer, Meter, Logger, TracerProvider, MeterProvider and LoggerProvider base classes without breaking existing implementations.

    These ABCs now derive from SignatureCompatABC, which wraps overrides that don't accept **kwargs at class-definition time so that keyword arguments they don't declare are dropped instead of being passed through. Performance-sensitive implementations can add **_kwargs to their overrides to avoid the extra wrapper layer. (#5886)

  • opentelemetry-configuration: support scope_info_enabled and resource_constant_labels for the Prometheus pull exporter (#5925)

Changed

  • opentelemetry-api: document baggage current context behavior. (#2432)

  • opentelemetry-api: stabilize the logs API as opentelemetry.logs (#5731)

  • opentelemetry-sdk: stabilize the logs SDK as opentelemetry.sdk.logs (#5732)

  • opentelemetry-exporter-otlp-proto-grpc, opentelemetry-exporter-otlp-proto-http, opentelemetry-exporter-otlp-json-http, opentelemetry-exporter-otlp-json-file: stabilize the log exporter as the public log_exporter module. opentelemetry-exporter-otlp-proto-common, opentelemetry-exporter-otlp-json-common: stabilize the log encoder as the public log_encoder module (#5733)

  • opentelemetry-sdk: inline util type annotations and delete stale .pyi stub file (#5799)

  • opentelemetry-configuration: bump declarative configuration schema to v1.2.0 and support the always_record sampler (#5926)

  • opentelemetry-api: make SeverityNumber an IntEnum so it compares directly against ints and other severities (#5930)

  • opentelemetry-api, opentelemetry-sdk: methods of the Tracer, Meter, Logger, TracerProvider, MeterProvider and LoggerProvider base classes and their implementations now accept **_kwargs: Never. Type checkers flag overrides that do not accept **_kwargs. Add **_kwargs to them to stay forward compatible and avoid the extra wrapper layer. (#5931)

  • [BREAKING] opentelemetry-api: align get_logger parameters (name: str, version: str | None = None, logger_provider at the end) with LoggerProvider.get_logger (previously instrumenting_module_name: str, instrumenting_library_version: str = ""), make optional arguments keyword-only (*) on both get_logger and LoggerProvider.get_logger, and drop ABC inheritance from LogRecord (#5934)

  • [BREAKING] opentelemetry-sdk: make Logs SDK signatures forward-compatible

    The optional arguments of BatchLogRecordProcessor (after exporter), LogRecordLimits (all) and LoggerProvider (after resource) are now keyword-only, so they can be reordered or deprecated later. Passing them positionally raises TypeError.

    LogRecordProcessor.shutdown() and LogRecordExporter.shutdown() now accept **kwargs, so that new keyword arguments can be added later without breaking custom implementations. Custom implementations should accept **kwargs in shutdown() too. (#6007)

  • [BREAKING] opentelemetry-sdk: add a timeout_millis argument to Logs SDK shutdown()

    LoggerProvider.shutdown(), LogRecordProcessor.shutdown() and LogRecordExporter.shutdown() now take a timeout_millis argument, matching the metrics SDK. Custom LogRecordProcessor and LogRecordExporter implementations must accept timeout_millis in shutdown().

    SynchronousMultiLogRecordProcessor and ConcurrentMultiLogRecordProcessor pass each log record processor the time remaining until the deadline. Processors whose shutdown starts after the deadline are still shut down, with a timeout of 0. ConcurrentMultiLogRecordProcessor.shutdown() returns at the deadline instead of waiting on processors that are still shutting down. (#6008)

Deprecated

  • opentelemetry-api: deprecate opentelemetry._logs in favor of opentelemetry.logs (#5731)
  • opentelemetry-sdk: deprecate opentelemetry.sdk._logs in favor of opentelemetry.sdk.logs (#5732)
  • opentelemetry-exporter-otlp-proto-grpc, opentelemetry-exporter-otlp-proto-http, opentelemetry-exporter-otlp-json-http, opentelemetry-exporter-otlp-json-file: deprecate the _log_exporter module in favor of log_exporter. opentelemetry-exporter-otlp-proto-common, opentelemetry-exporter-otlp-json-common: deprecate the _log_encoder module in favor of log_encoder (#5733)

Removed

  • opentelemetry-api: remove the private opentelemetry._logs._internal module and the deprecated LogRecord constructor arguments trace_id, span_id, and trace_flags (use context) (#5731)
  • opentelemetry-sdk: remove deprecated LoggingHandler and the OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED variable. For automatic standard library log export, install opentelemetry-instrumentation-logging and unset the old variable. Removed the deprecated LogExportResult, LogExporter, ConsoleLogExporter, InMemoryLogExporter, LogLimits, and LogDroppedAttributesWarning aliases and the private opentelemetry.sdk._logs._internal module. (#5732)

Fixed

  • opentelemetry-configuration: align generated model additional properties. (#5286)
  • opentelemetry-codegen-json: support decoding enums from names (#5402)
  • opentelemetry-exporter-otlp-proto-grpc: warn and fall back to the default instead of raising ValueError when a timeout environment variable holds an invalid value. (#5448)
  • opentelemetry-propagator-jaeger: strip only the leading uberctx- prefix when extracting a baggage key, so a carrier key that repeats the prefix keeps its inner literal (uberctx-a-uberctx-b now yields a-uberctx-b rather than a-b). (#5557)
  • opentelemetry-sdk: preserve parent tracestate in composite sampling, remove stale thresholds, and apply tracestate updates for root spans (#5579)
  • opentelemetry-sdk: keep spans mutable during on_ending span processor callbacks. Only the thread that called end() may mutate the span while the callbacks run, so ConcurrentMultiSpanProcessor now invokes _on_ending synchronously on that thread instead of through its thread pool. An exception raised by one processor's _on_ending is now logged and no longer prevents the remaining processors or on_end from running. (#5613)
  • opentelemetry-sdk: fix timeout_millis in metrics collection so slow observable callbacks raise MetricsTimeoutError (#5616)
  • opentelemetry-sdk: catch and log unhandled exceptions in MultiSpanProcessor (#5626)
  • opentelemetry-sdk: raise an error when a named View is defined without specifying instrument_name. (#5631)
  • opentelemetry-sdk: make the MetricReaderStorage tests assert on the storage under test instead of on process-global mock state, so an unrelated _ViewInstrumentMatch construction elsewhere in the test session can no longer fail them (#5639)
  • opentelemetry-sdk: fail any test that leaves a PeriodicExportingMetricReader ticker thread running, and shut down the four readers that were leaking one into the rest of the test session (#5641)
  • opentelemetry-sdk: add validation for export_timeout_millis <= 0 in BatchSpanProcessor (#5650)
  • opentelemetry-exporter-otlp-proto-grpc: Add warning when endpoint path is silently dropped by gRPC exporter (#5654)
  • opentelemetry-sdk: add validation for export_timeout_millis <= 0 in PeriodicExportingMetricReader (#5656)
  • opentelemetry-sdk: apply the specified status precedence in Span.set_status so Ok > Error > Unset is enforced explicitly, an Unset status is always ignored, and a status that repeats the code already recorded no longer replaces or drops the description recorded with it (#5662)
  • opentelemetry-sdk: Fix View initialization to detect bracket character pattern wildcards ([, ]) in instrument_name when name is set. (#5674)
  • opentelemetry-sdk: count logs dropped by SimpleLogRecordProcessor's recursion guard on otel.sdk.processor.log.processed with error.type=recursion (#5676)
  • opentelemetry-api, opentelemetry-propagator-b3, opentelemetry-propagator-jaeger, opentelemetry-opentracing-shim: update propagators and OpenTracing shim to check span_context.is_valid instead of identity with INVALID_SPAN_CONTEXT (#5695) (#5696)
  • opentelemetry-api: make AnyValue and AttributeValue explicit type aliases (#5703)
  • opentelemetry-exporter-zipkin-json: warn and fall back to the default instead of raising ValueError when OTEL_EXPORTER_ZIPKIN_TIMEOUT holds a non-integer value; the same fix is applied to opentelemetry-exporter-zipkin-proto-http. (#5704)
  • opentelemetry-exporter-prometheus: warn and fall back to the default port instead of raising ValueError when OTEL_EXPORTER_PROMETHEUS_PORT holds a non-integer value in the auto-configured metric reader. (#5705)
  • opentelemetry-sdk: fix thread leak bug in resource initialization logic for long running resource detectors (#5706)
  • opentelemetry-sdk: add return type annotation to InMemoryLogRecordExporter.init (#5709)
  • opentelemetry-exporter-otlp-proto-http: restore requests as the default HTTP transport so proxy environment variables such as HTTPS_PROXY are honored again (#5714)
  • opentelemetry-api: log the BoundedAttributes drop warning only once per record (#5727)
  • opentelemetry-sdk: fix TraceIdRatioBased sampler validation for NaN rate values (#5737)
  • opentelemetry-test-utils: require Weaver 0.27.0 or later for WeaverLiveCheck and fix its shutdown sequence. Make readiness polling quiet and add a configurable startup timeout. Reuse completed reports on repeated end calls; raise when no completed report request is available instead of returning an empty report. (#5738)
  • opentelemetry-sdk: omit histogram min/max when record_min_max is disabled (#5741)
  • opentelemetry-sdk: add return type annotations to SynchronousMultiLogRecordProcessor and ConcurrentMultiLogRecordProcessor (#5742)
  • opentelemetry-api: fix quadratic time parsing of the tracestate header and discard tracestate headers longer than 8192 characters (#5746)
  • opentelemetry-api: drop the new attribute instead of the oldest one when BoundedAttributes is full (#5776)
  • opentelemetry-propagator-jaeger: Accept a URL-encoded uber-trace-id header on extract (#5793)
  • opentelemetry-exporter-prometheus: prevent greedy regex from stripping compound unit tokens (#5798)
  • opentelemetry-configuration: align declarative configuration env-var parsing with the spec (#5805)
  • opentelemetry-configuration: treat timeout of 0 as infinite (#5806)
  • opentelemetry-sdk: allow zero schedule delay in batch span and log record processors (#5807)
  • opentelemetry-configuration: Fix literal bracket matching and enforce case-sensitive configuration wildcard semantics. (#5808)
  • opentelemetry-sdk: match Views by instrument unit exactly instead of using an fnmatch pattern, so UCUM annotated units such as [degF] are selected correctly. (#5816)
  • opentelemetry-api: limit traceparent header length to 512 characters in TraceContextTextMapPropagator during extraction (#5818)
  • opentelemetry-api: make W3CBaggagePropagator compliant with the W3C Baggage spec (#5823)
  • opentelemetry-configuration: fix container and host resource detectors and warn instead of failing on unloadable detectors (#5854)
  • opentelemetry-api: truncate byte array attribute values when attribute value length limit is set (#5855)
  • opentelemetry-sdk: Align delta and async metric start timestamps (#5859)
  • opentelemetry-sdk: use unit {log_record} and update description for otel.sdk.processor.log.queue.size (#5893)
  • opentelemetry-configuration: apply schema defaults to absent BatchSpanProcessor and OTLP exporter fields (endpoint, timeout, compression) instead of falling back to OTEL_* environment variables (#5914)
  • opentelemetry-configuration: ignore structured headers entries with a null value instead of overriding headers_list with an empty header. (#5921)
  • opentelemetry-configuration: pass custom sampler plugin configuration to the opentelemetry_sampler entry point factory as keyword arguments (#5923)
  • opentelemetry-configuration: validate that configured TLS and mTLS files exist and are readable at startup for OTLP HTTP exporters. (#5929)
  • opentelemetry-sdk, opentelemetry-test-utils: include instrumentation_scope in ReadableLogRecord.to_json(), shut down executor in ConcurrentMultiLogRecordProcessor.shutdown(), clear exception reference on copied LogRecord in BatchLogRecordProcessor.on_emit(), and add logs helpers to TestBase (#5934)
  • opentelemetry-sdk: fix ReadableSpan.attributes type hint so it is no longer optional (#5956)
  • opentelemetry-sdk: merge sampler attributes into span start attributes (#5975)

Don't miss a new opentelemetry-python release

NewReleases is sending notifications on new releases.