-
Notifications
You must be signed in to change notification settings - Fork 757
Feature: Include trace flags in spans exported by the OTLPSpanExporter #4761
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
base: main
Are you sure you want to change the base?
Feature: Include trace flags in spans exported by the OTLPSpanExporter #4761
Conversation
...roto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py
Outdated
Show resolved
Hide resolved
...roto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py
Outdated
Show resolved
Hide resolved
...roto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py
Outdated
Show resolved
Hide resolved
|
@xrmx made changes as per your comments. thanks. |
exporter/opentelemetry-exporter-otlp-proto-common/tests/test_trace_encoder.py
Outdated
Show resolved
Hide resolved
exporter/opentelemetry-exporter-otlp-proto-common/tests/test_trace_encoder.py
Outdated
Show resolved
Hide resolved
exporter/opentelemetry-exporter-otlp-proto-common/tests/test_trace_encoder.py
Outdated
Show resolved
Hide resolved
|
@xrmx I have made the changes as u said. Can you take a lookg again? |
|
@xrmx can you trigger the workflows once? I have fixed the errors |
|
@xrmx can you trigger the workflows once? I have fixed the errors |
...roto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py
Outdated
Show resolved
Hide resolved
...roto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py
Outdated
Show resolved
Hide resolved
...roto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py
Outdated
Show resolved
Hide resolved
|
can you trigger the workflows once @xrmx ? |
|
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 |
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.
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 |
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.
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?
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.
for otlp-http-exporter the fix is small, need to add trace_flags to the mocked span context, here
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.
for otlp-grpc-exporter will have to fix the same, but in more places here
Description
Fixes #4666
Type of change
Please delete options that are not relevant.
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
Does This PR Require a Contrib Repo Change?
Checklist: