Skip to content

Commit

Permalink
Revamp messaging metrics to support generic operations (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova authored Jun 14, 2024
1 parent 3df6e56 commit cde003c
Show file tree
Hide file tree
Showing 17 changed files with 634 additions and 329 deletions.
13 changes: 13 additions & 0 deletions .chloggen/1006.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
change_type: breaking

component: messaging

note: |
Support generic operations in messaging and rename metrics:
- Make `messaging.operation.name` required and `messaging.operation.type` conditionally required when type is applicable.
- Rename `messaging.publish.messages` metric to `messaging.client.published.messages`
- Unify `messaging.publish.duration` and `messaging.receive.duration` metrics into `messaging.client.operation.duration`
- Unify `messaging.receive.messages` and `messaging.process.messages` metrics into `messaging.client.consumed.messages`
issues: [1006, 947, 937]
15 changes: 8 additions & 7 deletions docs/attributes-registry/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ size should be used.

`messaging.operation.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process` | One or more messages are delivered to or processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| Value | Description | Stability |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `create` | A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `deliver` | Deprecated. Use `process` instead. | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `process`. |
| `process` | One or more messages are processed by a consumer. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `publish` | One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `receive` | One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `settle` | One or more messages are settled. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`messaging.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

Expand Down
5 changes: 3 additions & 2 deletions docs/faas/aws-lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,15 @@ Function F: | Span ProcBatch |

| Field or Attribute | Span Prod1 | Span Prod2 | Span ProcBatch | Span Proc1 | Span Proc2 |
|-|-|-|-|-|-|
| Span name | `Q send` | `Q send` | `Q process` | `Q process` | `Q process` |
| Span name | `send Q` | `send Q` | `process Q` | `process Q` | `process Q` |
| Parent | | | | Span ProcBatch | Span ProcBatch |
| Links | | | | Span Prod1 | Span Prod2 |
| SpanKind | `PRODUCER` | `PRODUCER` | `CONSUMER` | `CONSUMER` | `CONSUMER` |
| Status | `Ok` | `Ok` | `Ok` | `Ok` | `Ok` |
| `messaging.system` | `aws_sqs` | `aws_sqs` | `aws_sqs` | `aws_sqs` | `aws_sqs` |
| `messaging.destination.name` | `Q` | `Q` | `Q` | `Q` | `Q` |
| `messaging.operation.type` | | | `process` | `process` | `process` |
| `messaging.operation.name` | `send` | `send` | `process` | `process` | `process` |
| `messaging.operation.type` | `publish` | `publish` | `process` | `process` | `process` |
| `messaging.message.id` | | | | `"a1"` | `"a2"` |

Note that if Span Prod1 and Span Prod2 were sent to different queues, Span ProcBatch would not have
Expand Down
Loading

0 comments on commit cde003c

Please sign in to comment.