feat: update xray trace id generator for 'random-trace-id' flags changes
Description
Updates AwsXRayIdGenerator to define is_trace_id_random() to return True and update unit tests for core changes to add support for populating the random-trace-id flags in the W3C traceparent header based on the W3C trace context specification: https://www.w3.org/TR/trace-context-2/#random-trace-id-flag
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?
Unit tests have been updated to handle additional header flag.
Does This PR Require a Core Repo Change?
- [x] Yes. - Link to PR: https://github.com/open-telemetry/opentelemetry-python/pull/4854
- [ ] 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
I'm a bit confused, the title and CHANGELOG mention only xray but you're touching another half dozen instrumentations
I can update the title to be more descriptive. Essentially the main PR in the SDK repo adds the random trace id to the trace state section of the trace parent header. However, as a result of these changes, many unit tests broke in this repo since there were several instances where tests would hardcode the expected tracestate header, so a large portion of these changes are just fixing those tests to properly check the trace parent header. These changes are only unit test changes, so I didn't think it was worth mentioning in the changelog entry, but I can certainly modify this.
The only "real" changes in this PR are updating the Xray trace id generator to override the is_trace_id_random function to return True since it follows the W3C trace context definition for randomness.
@jj22ee could you please take a look at the opentelemetry-sdk-extension-aws changes?