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
{{ message }}
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+10-9
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,16 @@
15
15
js extensions for the [open-telemetry](https://opentelemetry.io/) project, from [Aspecto](https://www.aspecto.io/) with :heart:
16
16
17
17
**Compatible with [otel v0.15.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v0.15.0)**
18
-
## Plugins
19
-
-[opentelemetry-plugin-kafkajs](./packages/plugin-kafkajs) - auto instrumentation for [`kafkajs`](https://kafka.js.org)[](https://www.npmjs.com/package/opentelemetry-plugin-kafkajs)
20
-
-[opentelemetry-plugin-aws-sdk](./packages/plugin-aws-sdk) - auto instrumentation for [`aws-sdk`](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/)[](https://www.npmjs.com/package/opentelemetry-plugin-aws-sdk)
21
-
-[opentelemetry-plugin-typeorm](./packages/plugin-typeorm) - auto instrumentation for [`TypeORM`](https://typeorm.io/)[](https://www.npmjs.com/package/opentelemetry-plugin-typeorm)
22
-
-[opentelemetry-plugin-sequelize](./packages/plugin-sequelize) - auto instrumentation for [`Sequelize`](https://sequelize.org/)
-[opentelemetry-instrumentation-kafkajs](./packages/instrumentation-kafkajs) - auto instrumentation for [`kafkajs`](https://kafka.js.org)[](https://www.npmjs.com/package/opentelemetry-instrumentation-kafkajs)
20
+
-[opentelemetry-instrumentation-aws-sdk](./packages/instrumentation-aws-sdk) - auto instrumentation for [`aws-sdk`](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/)[](https://www.npmjs.com/package/opentelemetry-instrumentation-aws-sdk)
21
+
-[opentelemetry-instrumentation-typeorm](./packages/instrumentation-typeorm) - auto instrumentation for [`TypeORM`](https://typeorm.io/)[](https://www.npmjs.com/package/opentelemetry-instrumentation-typeorm)
22
+
-[opentelemetry-instrumentation-sequelize](./packages/instrumentation-sequelize) - auto instrumentation for [`Sequelize`](https://sequelize.org/)
### Instrumentations in this repo are using opentelemetry [Instrumentation API](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation).
27
+
For documentation using with the old [plugin](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/trace/Plugin.ts) api, please go [here](https://github.com/aspecto-io/opentelemetry-ext-js/tree/4393fff108c477d05ecd02dd7d9552ea1d482853).
28
+
26
29
**Tested and verified against otel v0.15.0**
27
-
- Versions 0.2.x of the plugins are compatible with otel version v0.15.0
28
-
- Versions 0.1.x of the plugins are compatible with otel version v0.14.0
29
-
- Versions 0.0.x of the plugins are compatible with otel version v0.12.0
30
+
- Versions 0.0.x of the instrumentations are compatible with otel version v0.15.0
To load this plugin, specify it in the Node Tracer's configuration:
13
+
For further automatic instrumentation instruction see the [@opentelemetry/instrumentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation) package.
|`preRequestHook`|`AwsSdkRequestCustomAttributeFunction`| Hook called before request send, which allow to add custom attributes to span. |
37
44
|`responseHook`|`AwsSdkResponseCustomAttributeFunction`| Hook for adding custom attributes when response is received from aws. |
38
45
|`sqsProcessHook`|`AwsSdkSqsProcessCustomAttributeFunction`| Hook called after starting sqs `process` span (for each sqs received message), which allow to add custom attributes to it. |
39
-
|`suppressInternalInstrumentation`| boolean | Most aws operation use http request under the hood. If http instrumentation is enabled, each aws operation will also create an http/s child describing the communication with amazon servers. Setting the suppressInternalInstrumentation` config value to `true` will cause the plugin to suppress instrumentation of underlying operations, effectively causing those http spans to be non-recordable. |
46
+
|`suppressInternalInstrumentation`| boolean | Most aws operation use http request under the hood. If http instrumentation is enabled, each aws operation will also create an http/s child describing the communication with amazon servers. Setting the suppressInternalInstrumentation` config value to `true` will cause the instrumentation to suppress instrumentation of underlying operations, effectively causing those http spans to be non-recordable. |
40
47
41
48
42
49
43
50
## Span Attributes
44
-
This plugin patch the internal `Request` object, which means that each sdk operation will create a single span with attributes from 3 sources:
51
+
This instrumentation patch the internal `Request` object, which means that each sdk operation will create a single span with attributes from 3 sources:
45
52
46
53
### Default attributes
47
54
Each span will have the following attributes:
@@ -58,14 +65,12 @@ Each span will have the following attributes:
58
65
|`aws.error`| string | information about a service or networking error, as returned from AWS | "UriParameterError: Expected uri parameter to have length >= 1, but found "" for params.Bucket" |
59
66
60
67
### Custom User Attributes
61
-
The plugin user can configure a `preRequestHook` function which will be called before each request, with the request object and the corrosponding span.
68
+
The instrumentation user can configure a `preRequestHook` function which will be called before each request, with the request object and the corresponding span.
62
69
This hook can be used to add custom attributes to the span with any logic.
63
70
For example, user can add interesting attributes from the `request.params`, and write custom logic based on the service and operation.
@@ -82,10 +87,10 @@ Specific service logic currently implemented for:
82
87
83
88
---
84
89
85
-
This plugin is a work in progress. We implemented some of the specific trace semantics for some of the services, and strive to support more services and extend the already supported services in the future. You can [Open an Issue](https://github.com/aspecto-io/opentelemetry-ext-js/issues), or [Submit a Pull Request](https://github.com/aspecto-io/opentelemetry-ext-js/pulls) if you want to contribute.
90
+
This instrumentation is a work in progress. We implemented some of the specific trace semantics for some of the services, and strive to support more services and extend the already supported services in the future. You can [Open an Issue](https://github.com/aspecto-io/opentelemetry-ext-js/issues), or [Submit a Pull Request](https://github.com/aspecto-io/opentelemetry-ext-js/pulls) if you want to contribute.
86
91
87
92
## Potential Side Effects
88
-
The plugin is doing best effort to support the trace specification of open telemetry. For SQS, it involves defining new attributes on the `Messages` array, as well as on the manipulated types generated from this array (to set correct trace context for a single SQS message operation). Those properties are defined as [non-enumerable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) properties, so they have minimum side effect on the app. They will, however, show when using the `Object.getOwnPropertyDescriptors` and `Reflect.ownKeys` functions on SQS `Messages` array and for each `Message` in the array.
93
+
The instrumentation is doing best effort to support the trace specification of open telemetry. For SQS, it involves defining new attributes on the `Messages` array, as well as on the manipulated types generated from this array (to set correct trace context for a single SQS message operation). Those properties are defined as [non-enumerable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) properties, so they have minimum side effect on the app. They will, however, show when using the `Object.getOwnPropertyDescriptors` and `Reflect.ownKeys` functions on SQS `Messages` array and for each `Message` in the array.
Copy file name to clipboardExpand all lines: packages/instrumentation-aws-sdk/docs/sqs.md
+5-7
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ SQS is amazon's managed message queue. Thus, it should follow the [Open Telemetr
5
5
The following methods are automatically enhanced:
6
6
7
7
### sendMessage / sendMessageBatch
8
-
-[Messaging Attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes) are added by this plugin according to the spec.
8
+
-[Messaging Attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes) are added by this instrumentation according to the spec.
9
9
- Open Telemetry trace context is injected as SQS MessageAttributes, so the service receiving the message can link cascading spans to the trace which created the message.
10
10
11
11
### receiveMessage
12
-
-[Messaging Attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes) are added by this plugin according to the spec.
12
+
-[Messaging Attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes) are added by this instrumentation according to the spec.
13
13
- Additional "processing spans" are created for each message received by the application.
14
14
If an application invoked `receiveMessage`, and received a 10 messages batch, a single `messaging.operation` = `receive` span will be created for the `receiveMessage` operation, and 10 `messaging.operation` = `process` spans will be created, one for each message.
15
15
Those processing spans are created by the library. This behavior is partially implemented, [See discussion below](#processing-spans).
@@ -43,13 +43,11 @@ async function poll() {
43
43
}
44
44
```
45
45
46
-
Current implementation partially solves this issue by patching the `map` \ `forEach` \ `Filter` functions on the `Messages` array of `receiveMessage` result. This handles issues like the one above, but will not handle situations where the processing is done in other patterns (multiple map\forEach calls, index access to the array, other array operations, etc). This is currently an open issue in the plugin.
46
+
Current implementation partially solves this issue by patching the `map` \ `forEach` \ `Filter` functions on the `Messages` array of `receiveMessage` result. This handles issues like the one above, but will not handle situations where the processing is done in other patterns (multiple map\forEach calls, index access to the array, other array operations, etc). This is currently an open issue in the instrumentation.
47
47
48
-
User can add custom attributes to the `process` span, by setting a function to `sqsProcessHook` in plugin config. For example:
48
+
User can add custom attributes to the `process` span, by setting a function to `sqsProcessHook` in instrumentation config. For example:
0 commit comments