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

Audit and test opentelemetry-instrumentation-boto #3376

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

Conversation

itsvshreyas
Copy link

Description

An #956 was found in the wsgi instrumentation by integration tests in the core repository. The issue should have been caught by unit tests in the instrumentation using the NoOpTracerProvider.

The outcome of this issue is to ensure each instrumentation contains a test using the NoOpTracerProvider and that it does not rely on the OpenTelemetry SDK. This test is specific to boto.

Fixes #989

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [ x ] 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

  • [ x ] Ran the unit test TestBotoInstrumentationNoOpTracerProvider to ensure that the NoOpTracerProvider is correctly set and that no spans are created during the boto3 client operations.

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • [ x ] No.

Checklist:

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

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

Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
Signed-off-by: Venkata Shreyas Kabekkodu <[email protected]>
@itsvshreyas itsvshreyas requested a review from a team as a code owner March 20, 2025 05:42
Copy link

linux-foundation-easycla bot commented Mar 20, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@itsvshreyas itsvshreyas changed the title Feature/test boto 989 Audit and test opentelemetry-instrumentation-boto Mar 20, 2025
@itsvshreyas
Copy link
Author

itsvshreyas commented Mar 28, 2025

Hi @codeboten , Could you please review this PR or help in getting necessary approvals/reviews for this PR? Thanks!

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.

No need for a new file, just add the testcase to the other file

self.assertEqual(len(spans), 0)


if __name__ == "__main__":
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to run tests like this

Copy link
Author

Choose a reason for hiding this comment

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

We don't need to run tests like this

Okay, I removed it in my new commit as I moved the entire function to the other file.


# Ensure no spans are created
tracer = get_tracer_provider().get_tracer("test")
if isinstance(self.noop_tracer_provider, NoOpTracerProvider):
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this always true?

@itsvshreyas
Copy link
Author

No need for a new file, just add the testcase to the other file

When you said other file, you meant this right?

instrumentation/opentelemetry-instrumentation-boto/tests/test_boto_instrumentation.py

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.

Audit and test opentelemetry-instrumentation-boto
2 participants