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

OTLP exporter is encoding invalid span/trace IDs in the logs fix #4006

Merged
merged 23 commits into from
Jul 11, 2024

Conversation

soumyadeepm04
Copy link
Contributor

Description

set the trace and span id fields to None for the returned log record in _encode_log if the corresponding ids are invalid. Fixed the test case accordingly.

Fixes #3828

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?

Test case already exists, modified it accordingly. Tested locally to ensure that the trace and span id fields are not present in the output if they are invalid.

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

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

@soumyadeepm04 soumyadeepm04 requested a review from a team June 28, 2024 23:18
@soumyadeepm04
Copy link
Contributor Author

I did not add or remove any public symbols so I have no clue why that test is failing. Could someone help me with this?

@xrmx
Copy link
Contributor

xrmx commented Jul 1, 2024

I did not add or remove any public symbols so I have no clue why that test is failing. Could someone help me with this?

I think you get that check failing because you are not on latest main. Please add a changelog entry

CHANGELOG.md Outdated Show resolved Hide resolved
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.

I guess we are missing a test for the behaviour, like asserting we are not serializing the fields if it is 0

@soumyadeepm04
Copy link
Contributor Author

soumyadeepm04 commented Jul 2, 2024

I guess we are missing a test for the behaviour, like asserting we are not serializing the fields if it is 0

Would you like me to add a test case for the same and if so, would that require me to add a test case both in the "opentelemetry-exporter-otlp-proto-grpc" and "opentelemetry-exporter-otlp-proto-http" directories?

@xrmx
Copy link
Contributor

xrmx commented Jul 3, 2024

I guess we are missing a test for the behaviour, like asserting we are not serializing the fields if it is 0

Would you like me to add a test case for the same and if so, would that require me to add a test case both in the "opentelemetry-exporter-otlp-proto-grpc" and "opentelemetry-exporter-otlp-proto-http" directories?

Yeah, please add a test to both the exporter because the internal helpers are not unit tested on their own

@lzchen lzchen merged commit ee1b008 into open-telemetry:main Jul 11, 2024
269 checks passed
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.

OTLP exporter is encoding invalid span/trace IDs in the logs
5 participants