Skip to content

Conversation

@Annosha
Copy link

@Annosha Annosha commented Oct 26, 2024

Fixes #3006

Description

This PR improves the OTLPExporterMixin class by adding detailed version-checking logic to handle different versions of the backoff library. This prevents potential issues with unsupported versions and enhances error handling when the backoff package is missing or incompatible.

In this PR I've tried to:

  • Imported Version and InvalidVersion from the packaging.version module to parse the backoff library version using semantic versioning.
  • Added _check_backoff_version to verify if the backoff package is installed, check its version, and ensure it meets minimum compatibility requirements.
  • Conditional Logging Based on Version Check

Note: If these changes are approved, I will proceed with implementing version checking in other relevant areas.

Fixes # 3006

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

tox -e opentelemetry-api
tox -e opentelemetry-sdk
tox -e ruff

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@Annosha Annosha requested a review from a team as a code owner October 26, 2024 18:38
@Annosha Annosha changed the title backoff version checking in exporter.py #3006 backoff version checking in exporter.py Oct 27, 2024

from deprecated import deprecated
from google.rpc.error_details_pb2 import RetryInfo
from packaging.version import InvalidVersion, Version
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to use these classes?

@lzchen
Copy link
Contributor

lzchen commented Oct 30, 2024

@Annosha

See this comment

@Annosha
Copy link
Author

Annosha commented Nov 1, 2024

Closing this PR since the issue isn't relevant any more.

@Annosha Annosha closed this Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better version checking for backoff package in OTLP exporters

2 participants