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

Add paragraph about usage of parent-child relationship #1414

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .chloggen/messaging-parent-child-trace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: enhancement
component: messaging
note: Clarify the possibility to have a parent-child trace structure in messaging conventions
issues: [1282]
23 changes: 21 additions & 2 deletions docs/messaging/messaging-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,23 @@ batch of messages, or for no message at all (if it is signalled that no
messages were received). For each message it accounts for, the "Process" or
"Receive" span SHOULD link to the message's creation context.

> [!IMPORTANT]
> These conventions use spans links as the default mechanism to correlate
> producers and consumer(s) because:
>
> - It is the only consistent trace structure that can be guaranteed,
> given the many different messaging systems models available.
>
> - It is the only option to correlate produce and consumer(s) in batch scenarios
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
> as a span can only have a single parent.
>
> - Offers a consistent experience for users analysing traces from different
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
> messaging systems.

joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
Exclusively for single messages scenarios, "Process" or "Receive" span MAY
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
use the message's creation context as its parent, thus achieving a direct
parent-child relationship between producer and consumer(s).
lmolkova marked this conversation as resolved.
Show resolved Hide resolved

"Settle" spans SHOULD be created for every manually or automatically triggered
settlement operation. A single "Settle" span can account for a single message
or for multiple messages (in case messages are passed for settling as batches).
Expand Down Expand Up @@ -467,17 +484,19 @@ flowchart LR;
R2[Span Process A 2]
end
P-. link .-R1;
P-- parent -->R1;
P-. link .-R2;
P-- parent -->R2;

classDef normal fill:green
class P,R1,R2 normal
linkStyle 0,1 color:green,stroke:green
linkStyle 0,1,2,3 color:green,stroke:green
```

| Field or Attribute | Span Publish A | Span Process A 1| Span Process A 2 |
|-|-|-|-|
| Span name | `publish T` | `consume T` | `consume T` |
| Parent | | | |
| Parent (optional) | | `publish T` | `publish T` |
| Links | | `publish T` | `publish T` |
| SpanKind | `PRODUCER` | `CONSUMER` | `CONSUMER` |
| `server.address` | `"ms"` | `"ms"` | `"ms"` |
Expand Down
Loading