Skip to content

Conversation

@andreamatt
Copy link

@andreamatt andreamatt commented Feb 9, 2026

Description

The cassandra instrumentation listed both cassandra-driver and scylla-driver in _instruments, which requires all listed packages to be installed. Since users install one or the other (they are alternative drivers for the same cassandra.cluster API), this should use _instruments_any so that having either driver installed is sufficient.

This follows the same pattern already used by the psycopg2 and kafka-python instrumentations, introduced in #3610. Cassandra was the only remaining instrumentation with multiple alternative packages listed under _instruments instead of _instruments_any.

Also splits test requirements into separate files for each driver and adds separate tox/CI environments to test both independently.

Fixes #2819

Type of change

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

How Has This Been Tested?

  • Verified original code fails with DependencyConflict: requested: "scylla-driver ~= 3.25" but found: "None" when only cassandra-driver is installed (3/4 tests fail)
  • Verified fix allows instrumentation to work with either driver installed (8/8 tests pass)
  • Added unit tests for instrumentation_dependencies() covering all four cases: only cassandra-driver, only scylla-driver, both installed, neither installed
  • Split test requirements and tox environments; both pass:
    • py313-test-instrumentation-cassandra-driver: 8/8 passed
    • py312-test-instrumentation-cassandra-scylla: 8/8 passed
  • Ran tox -e generate and tox -e generate-workflows to regenerate files

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 9, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@andreamatt andreamatt force-pushed the fix/cassandra-instruments-any branch from fdcc855 to b27f1e3 Compare February 9, 2026 16:41
@andreamatt andreamatt marked this pull request as ready for review February 9, 2026 16:51
@andreamatt andreamatt requested a review from a team as a code owner February 9, 2026 16:51
@andreamatt andreamatt marked this pull request as draft February 9, 2026 16:54
@andreamatt andreamatt force-pushed the fix/cassandra-instruments-any branch 2 times, most recently from 935feab to f96edf4 Compare February 9, 2026 17:02
@andreamatt andreamatt marked this pull request as ready for review February 10, 2026 08:44
Copy link
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, I think you are missing one piece of the puzzle that is to test both the implementation and not just one.
In short you have to split the test-requirements.txt in one for cassandra-driver and the other for scylla-driver and update tox.ini accordingly.
The split plus a ton of unrelated changes are available in this PR https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4180/changes

@andreamatt andreamatt force-pushed the fix/cassandra-instruments-any branch from f96edf4 to 51d855b Compare February 10, 2026 17:11
Copy link
Author

@andreamatt andreamatt left a comment

Choose a reason for hiding this comment

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

Done — split test requirements into separate files for cassandra-driver and scylla-driver, with separate tox environments for each. Both pass:

  • py313-test-instrumentation-cassandra-driver: 8/8 passed
  • py312-test-instrumentation-cassandra-scylla: 8/8 passed

@andreamatt andreamatt force-pushed the fix/cassandra-instruments-any branch from 51d855b to 7ba9c50 Compare February 10, 2026 19:05
The cassandra instrumentation listed both cassandra-driver and
scylla-driver in _instruments, which requires ALL listed packages to be
installed. Since users install one OR the other (they are alternative
drivers for the same API), this should use _instruments_any so that
having either driver installed is sufficient.

This follows the same pattern already used by psycopg2 and kafka-python
instrumentations, introduced in open-telemetry#3610.

Co-authored-by: Cursor <[email protected]>
@andreamatt andreamatt force-pushed the fix/cassandra-instruments-any branch from 7ba9c50 to de3f0f8 Compare February 11, 2026 10:01
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.

Missing cassandra spans in traces

3 participants