opentelemetry-python
opentelemetry-python copied to clipboard
OTLP exporter is encoding invalid span/trace IDs in the logs fix
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.
- [x] 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:
- [x] No.
Checklist:
- [x] Followed the style guidelines of this project
- [ ] Changelogs have been updated
- [ ] Unit tests have been added
- [ ] Documentation has been updated