Conversation
rahulkanneri-2u
force-pushed
the
rahul/add-operation-name-to-create-span
branch
from
October 1, 2026 11:38
d0b0091 to
375896d
Compare
Adds an optional operation_name argument to function_trace() and TelemetryBackend.create_span(). Datadog uses it as the span operation name (keeping name as the resource), OpenTelemetry records it as an operation_name span attribute, and New Relic ignores it. Also corrects the README feature matrix, which still listed OpenTelemetry as not supporting span creation since 8.0.2.
rahulkanneri-2u
force-pushed
the
rahul/add-operation-name-to-create-span
branch
from
October 1, 2026 11:39
375896d to
4ee4944
Compare
robrap
reviewed
Oct 1, 2026
robrap
left a comment
Contributor
There was a problem hiding this comment.
Minor possible doc improvement.
| - ❌ | ||
| - ✅ | ||
| - ✅ | ||
| * - Operation name for a span (``function_trace(..., operation_name=...)``) |
Contributor
There was a problem hiding this comment.
Is this accurate? Does this help clarify that this is just a different version of create span?
Suggested change
| * - Operation name for a span (``function_trace(..., operation_name=...)``) | |
| * - Create span with operation name (``function_trace(..., operation_name=...)``) |
Contributor
There was a problem hiding this comment.
If we want to follow-up with a small PR for this, we can. Didn't want you to be blocked on this minor note.
robrap
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds an optional
operation_nameargument tofunction_trace()andTelemetryBackend.create_span(). This replaces #548, rebased onto 8.0.2 (which implementedOpenTelemetryBackend.create_span()).nameas the resource.operation_namespan attribute, since OTel has no separate operation name.FunctionTracehas no equivalent.Behavior is unchanged when
operation_nameis not passed. Also corrects the monitoring README feature matrix, which still listed OpenTelemetry as not supporting span creation since 8.0.2, and adds an operation-name row.JIRA:
N/A
Dependencies:
Supersedes #548. No other dependencies.
Merge deadline:
None
Installation instructions:
None
Testing instructions:
pip install -r requirements/test.txtpytest edx_django_utils/monitoringtest_create_span_with_operation_name, which checks:trace('some.operation', resource='some_function_name')start_as_current_span('some_function_name', attributes={'operation_name': 'some.operation'})FunctionTrace('some_function_name')Reviewers:
Merge checklist:
Post merge:
finished.
Author concerns:
TelemetryBackendsubclasses must update theircreate_spansignature to acceptoperation_name=None, otherwisefunction_trace()will raise aTypeError. This is noted in the changelog and is why the bump is a minor version (8.1.0).operation_name) is my choice. Happy to rename it (e.g.operation.name) if reviewers prefer a different convention.