Skip to content

chore(deps): update opentelemetry-python monorepo to v1.40.0#838

Merged
olavloite merged 2 commits intogoogleapis:mainfrom
renovate-bot:renovate/opentelemetry-python-monorepo
Mar 5, 2026
Merged

chore(deps): update opentelemetry-python monorepo to v1.40.0#838
olavloite merged 2 commits intogoogleapis:mainfrom
renovate-bot:renovate/opentelemetry-python-monorepo

Conversation

@renovate-bot
Copy link
Contributor

@renovate-bot renovate-bot commented Mar 4, 2026

This PR contains the following updates:

Package Change Age Confidence
opentelemetry-api ==1.38.0==1.40.0 age confidence
opentelemetry-sdk ==1.38.0==1.40.0 age confidence

Release Notes

open-telemetry/opentelemetry-python (opentelemetry-api)

v1.40.0

Compare Source

  • opentelemetry-sdk: deprecate LoggingHandler in favor of opentelemetry-instrumentation-logging, see opentelemetry-instrumentation-logging documentation
    (#​4919)
  • opentelemetry-sdk: Clarify log processor error handling expectations in documentation
    (#​4915)
  • bump semantic-conventions to v1.40.0
    (#​4941)
  • Add stale PR GitHub Action
    (#​4926)
  • opentelemetry-sdk: Drop unused Jaeger exporter environment variables (exporter removed in 1.22.0)
    (#​4918)
  • opentelemetry-sdk: Clarify timeout units in environment variable documentation
    (#​4906)
  • opentelemetry-exporter-otlp-proto-grpc: Fix re-initialization of gRPC channel on UNAVAILABLE error
    (#​4825)
  • opentelemetry-exporter-prometheus: Fix duplicate HELP/TYPE declarations for metrics with different label sets
    (#​4868)
  • Allow loading all resource detectors by setting OTEL_EXPERIMENTAL_RESOURCE_DETECTORS to *
    (#​4819)
  • opentelemetry-sdk: Fix the type hint of the _metrics_data property to allow None
    (#​4837).
  • Regenerate opentelemetry-proto code with v1.9.0 release
    (#​4840)
  • Add python 3.14 support
    (#​4798)
  • Silence events API warnings for internal users
    (#​4847)
  • opentelemetry-sdk: make it possible to override the default processors in the SDK configurator
    (#​4806)
  • Prevent possible endless recursion from happening in SimpleLogRecordProcessor.on_emit,
    (#​4799) and (#​4867).
  • Implement span start/end metrics
    (#​4880)
  • Add environment variable carriers to API
    (#​4609)
  • Add experimental composable rule based sampler
    (#​4882)
  • Make ConcurrentMultiSpanProcessor fork safe
    (#​4862)
  • opentelemetry-exporter-otlp-proto-http: fix retry logic and error handling for connection failures in trace, metric, and log exporters
    (#​4709)
  • opentelemetry-sdk: avoid RuntimeError during iteration of view instrument match dictionary in MetricReaderStorage.collect()
    (#​4891)
  • Implement experimental TracerConfigurator
    (#​4861)
  • opentelemetry-sdk: Fix instrument creation race condition
    (#​4913)
  • bump semantic-conventions to v1.39.0
    (#​4914)
  • opentelemetry-sdk: automatically generate configuration models using OTel config JSON schema
    (#​4879)

v1.39.1: Version 1.39.1/0.60b1

Compare Source

This is a patch release on the previous 1.39.0/0.60b0 release, fixing the issue(s) below.

  • Silence events API warnings for internal users (#​4847)

v1.39.0

Compare Source

  • opentelemetry-api: Convert objects of any type other than AnyValue in attributes to string to be exportable
    (#​4808)

  • docs: Added sqlcommenter example
    (#​4734)

  • build: bump ruff to 0.14.1
    (#​4782)

  • Add opentelemetry-exporter-credential-provider-gcp as an optional dependency to opentelemetry-exporter-otlp-proto-grpc
    and opentelemetry-exporter-otlp-proto-http
    (#​4760)

  • feat: implement on ending in span processor
    (#​4775)

  • semantic-conventions: Bump to 1.38.0
    (#​4791)

  • [BREAKING] Remove LogData and extend SDK LogRecord to have instrumentation scope
    (#​4676)

  • [BREAKING] Rename several classes from Log to LogRecord
    (#​4647)

    Migration Guide:

    LogData has been removed. Users should update their code as follows:

    • For Log Exporters: Change from Sequence[LogData] to Sequence[ReadableLogRecord]

      # Before
      from opentelemetry.sdk._logs import LogData
      def export(self, batch: Sequence[LogData]) -> LogRecordExportResult:
          ...
      
      # After
      from opentelemetry.sdk._logs import ReadableLogRecord
      def export(self, batch: Sequence[ReadableLogRecord]) -> LogRecordExportResult:
          ...
    • For Log Processors: Use ReadWriteLogRecord for processing, ReadableLogRecord for exporting

      # Before
      from opentelemetry.sdk._logs import LogData
      def on_emit(self, log_data: LogData):
          ...
      
      # After
      from opentelemetry.sdk._logs import ReadWriteLogRecord, ReadableLogRecord
      def on_emit(self, log_record: ReadWriteLogRecord):
          # Convert to ReadableLogRecord before exporting
          readable = ReadableLogRecord(
              log_record=log_record.log_record,
              resource=log_record.resource or Resource.create({}),
              instrumentation_scope=log_record.instrumentation_scope,
              limits=log_record.limits,
          )
          ...
    • Accessing log data: Use the same attributes on ReadableLogRecord/ReadWriteLogRecord

      • log_record.log_record - The API LogRecord (contains body, severity, attributes, etc.)
      • log_record.resource - The Resource
      • log_record.instrumentation_scope - The InstrumentationScope (now included, was in LogData before)
      • log_record.limits - The LogRecordLimits
  • Mark the Events API/SDK as deprecated. The Logs API/SDK should be used instead, an event is now a LogRecord with the event_name field set
    (#​4654).

  • Fix type checking for built-in metric exporters
    (#​4820)


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate-bot renovate-bot requested a review from a team as a code owner March 4, 2026 16:10
@trusted-contributions-gcf trusted-contributions-gcf bot added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 4, 2026
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. label Mar 4, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 4, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the OpenTelemetry Python monorepo dependencies, specifically opentelemetry-api and opentelemetry-sdk, to their latest stable version 1.40.0. This upgrade incorporates a range of bug fixes, performance improvements, and new features, while also introducing some breaking changes related to logging and event handling that consumers of these libraries should be aware of. The update ensures the project benefits from the latest advancements in OpenTelemetry's Python implementation.

Highlights

  • Dependency Updates: Updated opentelemetry-api and opentelemetry-sdk from version 1.38.0 to 1.40.0, bringing in several new features, bug fixes, and some breaking changes from the OpenTelemetry Python project.
  • Logging and Events API Changes: The LoggingHandler in opentelemetry-sdk has been deprecated in favor of opentelemetry-instrumentation-logging. Additionally, the Events API/SDK has been marked as deprecated, with LogRecord now being the recommended approach for events. This includes breaking changes related to LogData and renaming of log-related classes.
  • New Features and Improvements: Introduced support for Python 3.14, implemented span start/end metrics, added an experimental composable rule-based sampler, and made the ConcurrentMultiSpanProcessor fork-safe. Experimental TracerConfigurator has also been implemented.
  • Exporter Fixes and Enhancements: Fixed re-initialization issues for gRPC channels in opentelemetry-exporter-otlp-proto-grpc and addressed duplicate HELP/TYPE declarations in opentelemetry-exporter-prometheus. Retry logic and error handling for connection failures in opentelemetry-exporter-otlp-proto-http have also been improved.
Changelog
  • requirements.txt
    • Updated opentelemetry-api from 1.38.0 to 1.40.0.
    • Updated opentelemetry-sdk from 1.38.0 to 1.40.0.
Activity
  • The pull request was automatically generated by renovate-bot to update dependencies.
  • Automerge is disabled, requiring manual merging after review.
  • The PR is configured to rebase automatically if conflicts arise or upon manual retry.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates opentelemetry-api and opentelemetry-sdk to version 1.40.0. While reviewing the changes, I noticed that the test configurations in noxfile.py use outdated, pinned versions of these dependencies (1.27.0). This means the tests are not validating the effects of this upgrade. I've added a comment to address this to ensure the project's stability and correctness after the update.

Note: Security Review has been skipped due to the limited scope of the PR.

opentelemetry-api==1.38.0 \
--hash=sha256:2891b0197f47124454ab9f0cf58f3be33faca394457ac3e09daba13ff50aa582 \
--hash=sha256:f4c193b5e8acb0912b06ac5b16321908dd0843d75049c091487322284a3eea12
opentelemetry-api==1.40.0 \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The opentelemetry-api and opentelemetry-sdk dependencies are being updated to 1.40.0, but the test environments defined in noxfile.py are hardcoded to use version 1.27.0 for both unit and system tests.

This discrepancy means that the tests are not running against the new versions of these dependencies, and any potential regressions or issues introduced by this upgrade could be missed.

To ensure the stability of the project, please update the pinned versions in noxfile.py to match the versions in this pull request.

For example, in noxfile.py:

# in system() session
session.install("opentelemetry-api==1.40.0")
session.install("opentelemetry-sdk==1.40.0")

# in unit() session
session.install("opentelemetry-api==1.40.0")
session.install("opentelemetry-sdk==1.40.0")

This will ensure that your test suite properly validates the updated dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the version restrictions for OpenTelemetry in the tests.

@trusted-contributions-gcf trusted-contributions-gcf bot added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 5, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 5, 2026
@forking-renovate
Copy link

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@olavloite olavloite merged commit 4df9ee3 into googleapis:main Mar 5, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants