You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add the ability to use span links when consuming a message amqp plugin (#1972)
A config option was added that when set to true, it follows the spec behavior to link to the produce context instead of continuing the context. The default behavior will be as it is today, so one has to opt-in to this change via the config setting.
* Add the ability to use span links in AMQP plugin
* add default behavior
* Add in tests for useLinks option
* Updating tests to correct Semantic attributes
---------
Co-authored-by: Jamie Danielson <[email protected]>
|`publishHook`|`AmqplibPublishCustomAttributeFunction`| hook for adding custom attributes before publish message is sent. |
55
-
|`publishConfirmHook`|`AmqplibPublishConfirmCustomAttributeFunction`| hook for adding custom attributes after publish message is confirmed by the broker. |
56
-
|`consumeHook`|`AmqplibConsumeCustomAttributeFunction`| hook for adding custom attributes before consumer message is processed. |
57
-
|`consumeEndHook`|`AmqplibConsumeEndCustomAttributeFunction`| hook for adding custom attributes after consumer message is acked to server. |
|`publishHook`|`AmqplibPublishCustomAttributeFunction`| hook for adding custom attributes before publish message is sent. |
56
+
|`publishConfirmHook`|`AmqplibPublishConfirmCustomAttributeFunction`| hook for adding custom attributes after publish message is confirmed by the broker. |
57
+
|`consumeHook`|`AmqplibConsumeCustomAttributeFunction`| hook for adding custom attributes before consumer message is processed. |
58
+
|`consumeEndHook`|`AmqplibConsumeEndCustomAttributeFunction`| hook for adding custom attributes after consumer message is acked to server. |
|`useLinksForConsume`|`boolean`| read [Links for Consume](#links-for-consume) below |
59
61
60
62
### Consume Timeout
61
63
@@ -69,6 +71,22 @@ If timeout is not big enough, span might be closed with 'InstrumentationTimeout'
69
71
70
72
Default is 1 minute
71
73
74
+
### Links for Consume
75
+
76
+
By default, consume spans continue the trace where a message was produced. However, per the [spec](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/#consumer-spans), consume spans should be linked to the message's creation context. Setting to true, this will enable the behavior to follow the spec.
77
+
78
+
Default is false
79
+
80
+
## Running Tests Locally
81
+
82
+
To run the tests locally, you need to have a RabbitMQ server running. You can use the following command to start a RabbitMQ server using Docker:
83
+
84
+
```bash
85
+
npm run test:docker:run
86
+
```
87
+
88
+
By default, the tests that connect to RabbitMQ are skipped. To make sure these tests are run, you can set the `RUN_RABBIT_TESTS` environment variable to `true`
89
+
72
90
## Semantic Conventions
73
91
74
92
This package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)
0 commit comments