Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psycopg2-binary support #3186

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

joshowen
Copy link

@joshowen joshowen commented Jan 14, 2025

Fixes #610
Inspired by #1422

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • 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

Copy link

linux-foundation-easycla bot commented Jan 14, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@joshowen joshowen requested a review from a team as a code owner January 14, 2025 16:19
@joshowen joshowen mentioned this pull request Jan 14, 2025
10 tasks
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.

The kafka-python instrumentation had to handle it in a bit more complicated way in KafkaInstrumentor.instrumentation_dependencies. Why a similar change is not required here?

@joshowen
Copy link
Author

The kafka-python instrumentation had to handle it in a bit more complicated way in KafkaInstrumentor.instrumentation_dependencies. Why a similar change is not required here?

@xrmx good catch! This has been updated.

Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

I think would be nice to have this tested at CI, like adding psycopg2-binary package installed in a test-requirements.txt file in the same way was done for kafka-python

@@ -34,6 +34,7 @@ dependencies = [
[project.optional-dependencies]
instruments = [
"psycopg2 >= 2.7.3.1",
"psycopg2-binary >= 2.7.3.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this what we want tho?

Using pip install opentelemetry-instrumentation-psycopg2[instruments] would install both psycopg2-binary and psycopg2.

Copy link
Contributor

Choose a reason for hiding this comment

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

We are abusing optional dependencies to do discovery of things, I hope the opentelementry-instrumentation-x[instruments] is not documented anywhere.

@joshowen
Copy link
Author

I think would be nice to have this tested at CI, like adding psycopg2-binary package installed in a test-requirements.txt file in the same way was done for kafka-python

@emdneto Good idea. I've added the config to this PR.

tox.ini Show resolved Hide resolved
@xrmx
Copy link
Contributor

xrmx commented Jan 17, 2025

@joshowen please regenerate the workflows

@joshowen
Copy link
Author

@joshowen please regenerate the workflows

@xrmx done.

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.

DependencyConflict: requested: "psycopg2 >= 2.7.3.1" but found: "None"
4 participants