Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The instrumentations in this repo are:
- strictly complies with [open telemetry semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/trace/semantic_conventions)
- up to date with latest SDK version

**Compatible with [SDK v0.20.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v0.20.0)**
**Compatible with [SDK v0.21.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v0.21.0)**
## Instrumentations
| Instrumentation Package | Instrumented Lib | NPM |
| --- | --- | --- |
Expand All @@ -52,10 +52,10 @@ The instrumentations in this repo are:


## Compatability Table
**Tested and verified against otel v0.20.0**

| Instrumentations Version | OpenTelemetry Version |
| --- | --- |
| 0.21.x | 0.21.0 |
| 0.5.x | 0.20.0 |
| 0.4.x | 0.19.0 |
| 0.3.x | 0.18.0 |
Expand Down
10 changes: 5 additions & 5 deletions detectors/node/resource-detector-deployment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.20.0"
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/resources": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0",
"@opentelemetry/resources": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0",
"opentelemetry-resource-detector-sync-api": "^0.5.0"
},
"devDependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"mocha": "^8.4.0",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"ts-node": "^9.1.1",
"typescript": "^4.0.5"
},
Expand Down
10 changes: 5 additions & 5 deletions detectors/node/resource-detector-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.20.0"
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/resources": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0",
"@opentelemetry/resources": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0",
"opentelemetry-resource-detector-sync-api": "^0.5.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"mocha": "^8.4.0",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"ts-node": "^9.1.1",
"typescript": "^4.0.5"
},
Expand Down
4 changes: 2 additions & 2 deletions detectors/resource-detector-sync-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.20.0"
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/resources": "^0.20.0"
"@opentelemetry/resources": "^0.21.0"
},
"devDependencies": {
"ts-node": "^9.1.1",
Expand Down
13 changes: 8 additions & 5 deletions packages/instrumentation-amqplib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@
"bugs": {
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0"
"@opentelemetry/instrumentation": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0"
},
"devDependencies": {
"@opentelemetry/core": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@opentelemetry/core": "^0.21.0",
"@types/amqplib": "^0.5.17",
"@types/lodash": "^4.14.168",
"@types/mocha": "^8.2.2",
Expand All @@ -51,7 +54,7 @@
"expect": "^26.6.2",
"lodash": "^4.17.21",
"mocha": "^8.4.0",
"opentelemetry-instrumentation-mocha": "^0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"opentelemetry-instrumentation-testing-utils": "^0.5.1",
"sinon": "^9.2.4",
"test-all-versions": "^5.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ describe('amqplib instrumentation callback model', function () {
beforeEach((done) => {
instrumentation.enable();
conn.createChannel(
context.bind((err, c) => {
context.bind(context.active(), (err, c) => {
channel = c;
// install an error handler, otherwise when we have tests that create error on the channel,
// it throws and crash process
channel.on('error', () => {});
channel.assertQueue(
queueName,
{ durable: false },
context.bind((err, ok) => {
context.bind(context.active(), (err, ok) => {
channel.purgeQueue(
queueName,
context.bind((err, ok) => {
context.bind(context.active(), (err, ok) => {
done();
})
);
Expand Down
15 changes: 9 additions & 6 deletions packages/instrumentation-aws-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,27 @@
"bugs": {
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/core": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0",
"@opentelemetry/core": "^0.21.0",
"@opentelemetry/instrumentation": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0",
"opentelemetry-propagation-utils": "^0.7.1"
},
"devDependencies": {
"@aws-sdk/client-s3": "3.13.1",
"@aws-sdk/client-sqs": "3.13.1",
"@aws-sdk/types": "3.13.1",
"@opentelemetry/tracing": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@opentelemetry/tracing": "^0.21.0",
"@types/mocha": "^8.2.2",
"aws-sdk": "^2.780.0",
"expect": "^26.6.2",
"mocha": "^8.4.0",
"nock": "^13.0.11",
"opentelemetry-instrumentation-mocha": "^0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"opentelemetry-instrumentation-testing-utils": "^0.5.1",
"test-all-versions": "^5.0.1",
"ts-node": "^9.1.1",
Expand Down
12 changes: 6 additions & 6 deletions packages/instrumentation-aws-sdk/src/aws-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,31 @@ export class AwsInstrumentation extends InstrumentationBase<typeof AWS> {
}

protected patchV3ConstructStack(moduleExports, moduleVersion: string) {
diag.debug(`applying patch to aws-sdk v3 constructStack`);
diag.debug(`aws-sdk instrumentation: applying patch to aws-sdk v3 constructStack`);
this._wrap(moduleExports, 'constructStack', this._getV3ConstructStackPatch.bind(this, moduleVersion));
return moduleExports;
}

protected unpatchV3ConstructStack(moduleExports) {
diag.debug(`applying unpatch to aws-sdk v3 constructStack`);
diag.debug(`aws-sdk instrumentation: applying unpatch to aws-sdk v3 constructStack`);
this._unwrap(moduleExports, 'constructStack');
return moduleExports;
}

protected patchV3SmithyClient(moduleExports) {
diag.debug(`applying patch to aws-sdk v3 client send`);
diag.debug(`aws-sdk instrumentation: applying patch to aws-sdk v3 client send`);
this._wrap(moduleExports.Client.prototype, 'send', this._getV3SmithyClientSendPatch.bind(this));
return moduleExports;
}

protected unpatchV3SmithyClient(moduleExports) {
diag.debug(`applying patch to aws-sdk v3 constructStack`);
diag.debug(`aws-sdk instrumentation: applying patch to aws-sdk v3 constructStack`);
this._unwrap(moduleExports.Client.prototype, 'send');
return moduleExports;
}

protected patchV2(moduleExports: typeof AWS, moduleVersion: string) {
diag.debug(`applying patch to ${AwsInstrumentation.component}`);
diag.debug(`aws-sdk instrumentation: applying patch to ${AwsInstrumentation.component}`);
this.unpatchV2(moduleExports);
this._wrap(moduleExports?.Request.prototype, 'send', this._getRequestSendPatch.bind(this, moduleVersion));
this._wrap(moduleExports?.Request.prototype, 'promise', this._getRequestPromisePatch.bind(this, moduleVersion));
Expand Down Expand Up @@ -405,7 +405,7 @@ export class AwsInstrumentation extends InstrumentationBase<typeof AWS> {
const span = self._startAwsV2Span(awsV2Request, requestMetadata, normalizedRequest, moduleVersion);
awsV2Request[self.REQUEST_SPAN_KEY] = span;
const activeContextWithSpan = trace.setSpan(context.active(), span);
const callbackWithContext = context.bind(callback, activeContextWithSpan);
const callbackWithContext = context.bind(activeContextWithSpan, callback);

self._callUserPreRequestHook(span, normalizedRequest);
self._registerV2CompletedEvent(span, awsV2Request, normalizedRequest, activeContextWithSpan);
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-aws-sdk/src/services/sqs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class SqsServiceExtension implements ServiceExtension {
propagation.inject(context.active(), attributes, sqsContextSetter);
} else {
diag.warn(
'OpenTelemetry aws-sdk instrumentation cannot set context propagation on SQS message due to maximum amount of MessageAttributes'
'aws-sdk instrumentation: cannot set context propagation on SQS message due to maximum amount of MessageAttributes'
);
}
return attributes;
Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation-aws-sdk/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export const bindPromise = (
): Promise<any> => {
const origThen = target.then;
target.then = function (onFulfilled, onRejected) {
const newOnFulfilled = context.bind(onFulfilled, contextForCallbacks);
const newOnRejected = context.bind(onRejected, contextForCallbacks);
const newOnFulfilled = context.bind(contextForCallbacks, onFulfilled);
const newOnRejected = context.bind(contextForCallbacks, onRejected);
const patchedPromise = origThen.call(this, newOnFulfilled, newOnRejected);
return rebindCount > 1 ? bindPromise(patchedPromise, contextForCallbacks, rebindCount - 1) : patchedPromise;
};
Expand Down
13 changes: 8 additions & 5 deletions packages/instrumentation-elasticsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,24 @@
"bugs": {
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/core": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0"
"@opentelemetry/core": "^0.21.0",
"@opentelemetry/instrumentation": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0"
},
"devDependencies": {
"@elastic/elasticsearch": "^7.8.0",
"@opentelemetry/api": "^0.21.0",
"@types/chai": "^4.2.15",
"@types/mocha": "^8.2.2",
"chai": "^4.3.0",
"expect": "^26.6.2",
"mocha": "^8.4.0",
"nock": "^13.0.9",
"opentelemetry-instrumentation-mocha": "^0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"opentelemetry-instrumentation-testing-utils": "^0.5.1",
"sinon": "^9.2.4",
"test-all-versions": "^5.0.1",
Expand Down
17 changes: 10 additions & 7 deletions packages/instrumentation-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,26 @@
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/core": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0"
"@opentelemetry/core": "^0.21.0",
"@opentelemetry/instrumentation": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0"
},
"devDependencies": {
"@opentelemetry/instrumentation-http": "^0.20.0",
"@opentelemetry/tracing": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@opentelemetry/instrumentation-http": "^0.21.0",
"@opentelemetry/tracing": "^0.21.0",
"@types/express": "4.17.8",
"@types/mocha": "^8.2.2",
"axios": "0.21.1",
"body-parser": "^1.19.0",
"expect": "^26.6.2",
"express": "4.17.1",
"mocha": "^8.4.0",
"opentelemetry-instrumentation-mocha": "^0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"opentelemetry-instrumentation-testing-utils": "^0.5.1",
"test-all-versions": "^5.0.1"
},
Expand Down
13 changes: 8 additions & 5 deletions packages/instrumentation-kafkajs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,21 @@
"bugs": {
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0"
"@opentelemetry/instrumentation": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0"
},
"devDependencies": {
"@opentelemetry/tracing": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@opentelemetry/tracing": "^0.21.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"kafkajs": "^1.12.0",
"mocha": "^8.4.0",
"opentelemetry-instrumentation-mocha": "^0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"opentelemetry-instrumentation-testing-utils": "^0.5.1",
"ts-node": "^9.1.1",
"typescript": "^3.9.5"
Expand Down
15 changes: 9 additions & 6 deletions packages/instrumentation-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,23 @@
"bugs": {
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/core": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0"
"@opentelemetry/core": "^0.21.0",
"@opentelemetry/instrumentation": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0"
},
"devDependencies": {
"@opentelemetry/tracing": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@opentelemetry/tracing": "^0.21.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"mocha": "^8.4.0",
"mongodb": "^3.6.4",
"mongoose": "5.11.15",
"opentelemetry-instrumentation-mocha": "^0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"opentelemetry-instrumentation-testing-utils": "^0.5.1",
"ts-node": "^9.1.1",
"typescript": "^4.0.3"
Expand Down
13 changes: 8 additions & 5 deletions packages/instrumentation-neo4j/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,21 @@
"bugs": {
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^0.21.0"
},
"dependencies": {
"@opentelemetry/api": "^0.20.0",
"@opentelemetry/instrumentation": "^0.20.0",
"@opentelemetry/semantic-conventions": "^0.20.0"
"@opentelemetry/instrumentation": "^0.21.0",
"@opentelemetry/semantic-conventions": "^0.21.0"
},
"devDependencies": {
"@opentelemetry/tracing": "^0.20.0",
"@opentelemetry/api": "^0.21.0",
"@opentelemetry/tracing": "^0.21.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"mocha": "^8.4.0",
"neo4j-driver": "^4.2.2",
"opentelemetry-instrumentation-mocha": "^0.0.1-rc.1",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.2",
"opentelemetry-instrumentation-testing-utils": "^0.5.1",
"test-all-versions": "^5.0.1",
"ts-node": "^9.1.1",
Expand Down
Loading