Skip to content

Conversation

@nikhilmantri0902
Copy link

Description

Fixes #4666

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?

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

  • Test A

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

@nikhilmantri0902 nikhilmantri0902 requested a review from a team as a code owner October 2, 2025 07:56
@xrmx xrmx moved this to Ready for review in @xrmx's Python PR digest Oct 3, 2025
@xrmx xrmx moved this from Ready for review to Reviewed PRs that need fixes in @xrmx's Python PR digest Oct 3, 2025
@nikhilmantri0902
Copy link
Author

@xrmx made changes as per your comments. thanks.

@xrmx xrmx moved this from Reviewed PRs that need fixes to Ready for review in @xrmx's Python PR digest Oct 6, 2025
@nikhilmantri0902
Copy link
Author

@xrmx I have made the changes as u said. Can you take a lookg again?

@nikhilmantri0902
Copy link
Author

@xrmx can you trigger the workflows once? I have fixed the errors

@nikhilmantri0902
Copy link
Author

@xrmx can you trigger the workflows once? I have fixed the errors

@nikhilmantri0902
Copy link
Author

can you trigger the workflows once @xrmx ?

@nikhilmantri0902
Copy link
Author

Fixed all errors. Please trigger workflows again @xrmx

span = SDKSpan(name="root", context=span_context, parent=None)
pb = _encode_span(span)
assert (pb.flags & PB2SpanFlags.SPAN_FLAGS_TRACE_FLAGS_MASK) == 0x00
assert (pb.flags & PB2SpanFlags.SPAN_FLAGS_TRACE_FLAGS_MASK) == 0x00 # pylint: disable=no-member
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this per testcase instead so we can have this only once, i.e. put this comment in first line of this class?

) -> int:
# Lower 8 bits: W3C TraceFlags
# Handle TraceFlags objects, regular ints, and test mocks
# TraceFlags is an int subclass, but we handle Mock objects in tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Again the code should not be aware of the mocks in tests, what tests are failing? Can we update the mocks to be speced against the class we need?

Copy link
Member

@emdneto emdneto Nov 6, 2025

Choose a reason for hiding this comment

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

for otlp-http-exporter the fix is small, need to add trace_flags to the mocked span context, here

Copy link
Member

Choose a reason for hiding this comment

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

for otlp-grpc-exporter will have to fix the same, but in more places here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Include trace flags in spans exported by the OTLPSpanExporter

3 participants