-
Notifications
You must be signed in to change notification settings - Fork 635
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
Conversation
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 |
...proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py
Show resolved
Hide resolved
There was a problem hiding this 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
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 |
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.
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?
Checklist: