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

docs(messaging): add gcp async batch publish example #545

Merged
merged 18 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ release.
([#21](https://github.com/open-telemetry/semantic-conventions/pull/21))
- Add `messaging.gcp_pubsub.message.ordering_key` attribute.
([#528](https://github.com/open-telemetry/semantic-conventions/pull/528))
- Add an example for gcp_pubsub asynchronous batch publish
([#548](https://github.com/open-telemetry/semantic-conventions/pull/545)).
alevenberg marked this conversation as resolved.
Show resolved Hide resolved

### Fixes

Expand Down
39 changes: 39 additions & 0 deletions docs/messaging/gcp-pubsub.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,43 @@ For Google Cloud Pub/Sub, the following additional attributes are defined:
| [`messaging.gcp_pubsub.message.ordering_key`](../attributes-registry/messaging.md) | string | The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. | `ordering_key` | Conditionally Required: If the message type has an ordering key set. |
<!-- endsemconv -->

## Examples

### Asynchronous Batch Publish Example

Given is a process P that asynchronously publishes 2 messages in a batch to a topic T on Pub/Sub.

```mermaid
flowchart LR;
subgraph PRODUCER
direction LR
CA[Span Create A]
CB[Span Create B]
P[Span Publish A B]
end
CA-. link .-P;
CB-. link .-P;

classDef producer fill:green
class P,CA,CB producer
classDef normal fill:green
class PA,PB,D1 normal
linkStyle 0,1 color:green,stroke:green
```

| Field or Attribute | Span Create A | Span Create B | Span Publish A B |
|-|-|-|-|
| Span name | `T create` | `T create` | `publish` |
| Parent | | | |
| Links | | | Span Create A, Span Create B |
| SpanKind | `PRODUCER` | `PRODUCER` | `PRODUCER` |
alevenberg marked this conversation as resolved.
Show resolved Hide resolved
| Status | `Ok` | `Ok` | `Ok` |
| `messaging.batch.message_count` | | | 2 |
| `messaging.destination.name` | `"T"` | `"T"` | |
alevenberg marked this conversation as resolved.
Show resolved Hide resolved
| `messaging.destination.template` | `"topic"` | `"topic"` | |
alevenberg marked this conversation as resolved.
Show resolved Hide resolved
| `messaging.operation` | `"create"` | `"create"` | `"publish"` |
| `messaging.message.id` | `"a1"` | `"a2"` | |
| `messaging.message.total_size_bytes` | `1` | `1` | |
alevenberg marked this conversation as resolved.
Show resolved Hide resolved
| `messaging.system` | `"gcp_pubsub"` | `"gcp_pubsub"` | |
alevenberg marked this conversation as resolved.
Show resolved Hide resolved

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
Loading