Skip to content
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

Propagate FollowsFrom span relationships in SDK #190

Merged
merged 2 commits into from
Oct 14, 2019

Conversation

iredelmeier
Copy link
Member

[Closes #189]

opts.Reference.RelationshipType == apitrace.ChildOfRelationship {
parent = opts.Reference.SpanContext
remoteParent = true
if reference := opts.Reference; reference.SpanContext != core.EmptySpanContext() {
Copy link
Member

Choose a reason for hiding this comment

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

Reference is not defined in the specs. What does a follow from mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Then we should remove FollowsFrom completely.

Copy link
Contributor

Choose a reason for hiding this comment

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

Reference should be replaced simply with SpanContext in SpanOptions and add 'remoteParent bool' in SpanContext. Propagators should set it to true.
With remoteParent bool in SpanContext, there is no need for 'remote' parameters/fields in bunch of places.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why should remoteParent go in the span context? If you start a span with an explicit ChildOf or FollowsFrom, isn't that a sufficient indicator? I.e., this bit can be computed and stored in the SDK if needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Folks, remember that we have a OpenTracing compatibility story. OpenTracing defined FollowsFrom.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with @jmacd on both counts, particularly about not adding remoteParent to SpanContext - that feels to me like it would introduce more room for confusion. If we want to make the "remote" vs "local" aspect more explicit, what about something like renaming the start options so that they clearly indicate they're meant for remote parents only (e.g., RemoteChildOf)?

I also feel like this conversation should be moved outside of this PR, which is meant to be about what seems like a relatively contained bug based on the existing code.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were using the word "Relation", not "Reference", but that's not something for this PR. I see that StartSpanOptions has a Reference, but I think it would be clearer if we used Relation or Relationship.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why should remoteParent go in the span context? If you start a span with an explicit ChildOf or FollowsFrom, isn't that a sufficient indicator? I.e., this bit can be computed and stored in the SDK if needed.

Spec makes it seem like 'remoteParent' is part of SpanContext.

Anyway, as far as this PR goes the change looks fine.

opts.Reference.RelationshipType == apitrace.ChildOfRelationship {
parent = opts.Reference.SpanContext
remoteParent = true
if reference := opts.Reference; reference.SpanContext != core.EmptySpanContext() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were using the word "Relation", not "Reference", but that's not something for this PR. I see that StartSpanOptions has a Reference, but I think it would be clearer if we used Relation or Relationship.

@rghetia rghetia merged commit 849cdc7 into open-telemetry:master Oct 14, 2019
@iredelmeier iredelmeier deleted the respect-follows-from branch October 14, 2019 21:49
hstan referenced this pull request in hstan/opentelemetry-go Oct 15, 2020
* Move othttp instrumentation to contrib repo

* api/standard package has moved to semconv

* Replace othttp references with otelhttp

* Revert "api/standard package has moved to semconv"

This reverts commit eceaa351e438ff986af904fbeb40a9ff0eb79322 as the change has not yet
been published in a versioned module.  Leaving the revert commit in history
for ease of resurrection.

* reference correct contrib module version

* Add net/http/httptrace instrumentation

* add httptrace module to dependabot config

* fix precommit issues

* Add net/http example

* add httptrace example

* Restore response writer wrapper from opentelemery-go#979

* Add CHANGELOG entry

Co-authored-by: Tyler Yahn <[email protected]>
@pellared pellared added this to the untracked milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDK ignores "FollowsFrom" relationships
5 participants