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

Non-immediate and Non-causal Links between Spans #826

Open
eyakimov-bbg opened this issue Aug 18, 2020 · 2 comments
Open

Non-immediate and Non-causal Links between Spans #826

eyakimov-bbg opened this issue Aug 18, 2020 · 2 comments
Labels
area:semantic-conventions Related to semantic conventions area:span-relationships Related to span relationships release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory

Comments

@eyakimov-bbg
Copy link

What are you trying to achieve?

The current specification (references in additional context) only models relationships between Spans at a very basic level of parent and an arbitrary link (possibly with attributes). Systems can exhibit various kinds of links, such as "child of"/"follows from" or "immediate"/"non-immediate" which are known to the system but can not currently be expressed. This issue focuses on the latter distinction but opens up the wider area of defining the semantics of types of relationships/links that can exist and how they can be handled by downstream systems.

Consider the following use-cases where a relationship exists between Spans, however, the relationship is not "causal" (i.e. the previous span didn't directly cause the second span) and it may express a non-immediate linkage between them.

  • Correlating Subscription event with the individual send events of a PubSub, i.e. my Publish() somehow Links to the original Subscribe() span
  • A record gets written to a database/cache for non-immediate consumption, at a later point in time (either milliseconds or hours/days later), another event consumes such an update, it might be interesting to correlate the consumer span with the setter span.

Although it is arguable whether this is a "Link" as it's not causal, it can add considerable value to the observability of a system and as such I'd like to prompt some consideration of whether the semantics of such a relationship should be supported.

This distinction between (non-)immediate/(non-)causal will likely have little impact at instrumentation time but may be very necessary for downstream handling of a tracing system. For example, It's unlikely that I'd ever look at a timeline/Gantt-chart for a non-immediate/non-causal chart. However I might want to easily navigate through all traces in a subscription, or likewise to see all consumption of a record/cached value.

Given the need to handle such relationships differently upon consumption, and given that this context is known at instrumentation time, it would be desirable to capture it, ideally by having well-defined link semantics that can be expressed when adding the Link.

Additional context.

The current specification allows Spans to both reference a parent as well as have additional links. As described in

A related issue exists #65 which focuses on the child/follows relationship, but I think many of the same considerations would apply here as well.

I don't have a concrete suggestions for how to solve this, but I believe that some form of "link type" definition is necessary. This could consist of something like the following traits:

  • causal/non-causal
  • immediate/non-immediate
  • parent/not (implied by setting parent span)
  • child/follows

The above traits may also be somewhat related, i.e. I don't see how a parent or child concept would exist unless the link is causal.

@eyakimov-bbg eyakimov-bbg added the spec:trace Related to the specification/trace directory label Aug 18, 2020
@Oberon00 Oberon00 added area:span-relationships Related to span relationships area:semantic-conventions Related to semantic conventions area:api Cross language API specification issue labels Aug 18, 2020
@Oberon00
Copy link
Member

Oberon00 commented Aug 18, 2020

One problem I can see is that the parent-child relationship is a special kind of link that does not support attributes. However, they could be added as span attributes instead.
Another problem is that both links and the parent span must be fully specified when creating the span already, so you can't add links later. Are you aware of this limitation? It seems like non-immediate links are exactly links added while the span is already started. There is an related issue #454 "Please (re)-allow recording links after Span creation time" Currently you could work-around this by creating child spans with the desired link.

@eyakimov-bbg
Copy link
Author

Thanks for the input Christian,

One problem I can see is that the parent-child relationship is a special kind of link that does not support attributes

In some ways, I see the parent relationship as a constraint on the other traits (i.e. its probably causal and immediate), however, whether the child/follows trait probably does make sense to set on the parent relationship as per the illustration on #65 (comment)

Another problem is that both links and the parent span must be fully specified when creating the span already

Funny enough, it seems that I added that issue under a different GitHub account too ^^. I do think that this is valuable as it gives more flexibility to developers to discover relationships during the span processing rather than beforehand, however, IMO it doesn't change "how" you describe these relationships which is what this issue is focusing on.

(Apologies for the deleted comment, wrong account)

@Oberon00 Oberon00 removed the area:api Cross language API specification issue label Aug 19, 2020
@andrewhsu andrewhsu added release:required-for-ga Must be resolved before GA release, or nice to have before GA priority:p3 Lowest priority level priority:p2 Medium priority level and removed priority:p3 Lowest priority level labels Aug 21, 2020
@andrewhsu andrewhsu added release:after-ga Not required before GA release, and not going to work on before GA and removed priority:p2 Medium priority level release:required-for-ga Must be resolved before GA release, or nice to have before GA labels Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions area:span-relationships Related to span relationships release:after-ga Not required before GA release, and not going to work on before GA spec:trace Related to the specification/trace directory
Projects
None yet
Development

No branches or pull requests

3 participants