Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Export SpanContext.IsRemote in OTLP #182

Merged
merged 19 commits into from
Apr 14, 2023

Conversation

axw
Copy link
Contributor

@axw axw commented Oct 25, 2021

Proposal to update OTLP to indicate whether a span's parent is remote.

@axw axw requested a review from a team October 25, 2021 06:25
@axw
Copy link
Contributor Author

axw commented Nov 29, 2021

@open-telemetry/specs-approvers can I please get some reviews on this?

Copy link

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

This is an important piece of information and aside from some small comments this OTEP looks like a good idea to me.

I have a small preference for using a field instead of attribute since we currently don't have any data modeling attributes I think, they are all informational. Memory analysis below but tl;dr, even if there was a bigger impact it seems too small to change this above fact about our data modeling.

Note that there likely won't be any significant memory impact on SDKs since we already have SpanContext.isRemote - in Java, we just modify here

https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/traces/SpanMarshaler.java#L43

to store parentContext instead of parentId and serialize based on it

https://github.com/open-telemetry/opentelemetry-java/blob/main/exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/traces/SpanMarshaler.java#L117

so there is zero impact on non-local-root spans. Where SDKs use generated protobuf objects, the relatively short-lived proto Span object will have one extra field only, but no long term storage should be needed.

For backends that receive the data, it is likely that there will be a byte or four (depending on alignment) of extra long term memory usage. Anyways it doesn't seem enough to factor into decision making.

text/0182-otlp-remote-parent.md Show resolved Hide resolved
text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
@anuraaga
Copy link

anuraaga commented Feb 3, 2022

@open-telemetry/specs-approvers Can you please review this otep?

text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
@axw axw requested a review from tigrannajaryan March 17, 2022 03:59
@tigrannajaryan
Copy link
Member

@axw sorry for late reply, this fall off my radar (and thanks for reminding). The proposal looks reasonable to me.

If we end up adding flags field to Span in OTLP as proposed here I think we can record the IsRemote as a bit in the flags (which makes it zero cost in memory and very small cost on the wire).

@tigrannajaryan
Copy link
Member

@bogdandrutu I think you discussed this in OpenCensus too. PTAL.

@Oberon00
Copy link
Member

Oberon00 commented May 20, 2022

If we end up adding flags field to Span in OTLP as proposed here I think we can record the IsRemote as a bit in the flags

This is a very nice idea that may lead to much trouble and head-scratching if whatever bit we choose gets a meaning assigned in W3C. Unless we make our "flags" larger than the W3C trace flags, but then it's not zero-cost (and in theory, the W3C trace flags field might have more bits an a future traceparent header version).

@tigrannajaryan
Copy link
Member

If we end up adding flags field to Span in OTLP as proposed here I think we can record the IsRemote as a bit in the flags

This is a very nice idea that may lead to much trouble and head-scratching if whatever bit we choose gets a meaning assigned in W3C. Unless we make our "flags" larger than the W3C trace flags, but then it's not zero-cost (and in theory, the W3C trace flags field might have more bits an a future traceparent header version).

Our flags are already larger than W3C trace flags. We reserve 8 bits for W3C trace flags (of which only 1 bit is defined by W3C currently) and the remaining 24 bits in our flags are available for anything else we want to use it for. If W3C in the future decides to come up with more than 8 bits of flags they have to do it in a very explicit way, in which case we can also follow what they do.

@Oberon00
Copy link
Member

I suggest we have the discussion regarding the naming

I strongly suggest to stay with "IsRemote" for storing what the spec already calls IsRemote in the API (where we can't rename it)

@carlosalberto
Copy link
Contributor

@open-telemetry/specs-approvers We have enough approvals so I will merge in the next couple of days. Please raise your voice if you want to do a review before that.

@carlosalberto
Copy link
Contributor

@axw We are ready to merge, but we need to get the lint check to pass. Can you check what's happening? https://app.circleci.com/pipelines/github/open-telemetry/oteps/1593/workflows/eadc0058-1700-47a1-b96a-60abff61c475/jobs/2588

Copy link

@graphaelli graphaelli left a comment

Choose a reason for hiding this comment

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

satisfy markdown-lint

text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
@graphaelli
Copy link

@carlosalberto would you accept the suggestions to address the markdown linting issues?

Copy link

@graphaelli graphaelli left a comment

Choose a reason for hiding this comment

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

another round of markdown-lint-fix

text/0182-otlp-remote-parent.md Show resolved Hide resolved
text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
text/0182-otlp-remote-parent.md Outdated Show resolved Hide resolved
@carlosalberto carlosalberto merged commit 6b62348 into open-telemetry:main Apr 14, 2023
@carlosalberto
Copy link
Contributor

Merged. Please start preparing the PR(s) to include this change in the Spec + proto repositories.

@axw axw deleted the remote-parent branch April 26, 2023 02:02
pyohannes pushed a commit to pyohannes/oteps that referenced this pull request May 23, 2023
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 23, 2024
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 30, 2024
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Oct 31, 2024
carlosalberto pushed a commit to carlosalberto/oteps that referenced this pull request Nov 1, 2024
carlosalberto pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Nov 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.