Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

feat: support core experimental versions ^0.28.0 #228

Merged
merged 14 commits into from
Jun 2, 2022
8 changes: 0 additions & 8 deletions .github/workflows/daily-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ jobs:
env:
NEO4J_AUTH: neo4j/test

rabbitmq:
image: rabbitmq:3
ports:
- 22221:5672
env:
RABBITMQ_DEFAULT_USER: username
RABBITMQ_DEFAULT_PASS: password


steps:
- uses: actions/checkout@v2
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ jobs:
env:
NEO4J_AUTH: neo4j/test

rabbitmq:
image: rabbitmq:3
ports:
- 22221:5672
env:
RABBITMQ_DEFAULT_USER: username
RABBITMQ_DEFAULT_PASS: password

steps:

- uses: actions/checkout@v2
Expand All @@ -47,8 +39,13 @@ jobs:
- name: Fetch all history for all tags and branches
run: git fetch

- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14

- name: Install Dependencies
run: yarn
run: yarn install

- name: Build
run: yarn build:ci
Expand Down
3 changes: 2 additions & 1 deletion 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 stable v1.0.1](https://github.com/open-telemetry/opentelemetry-js/releases/tag/stable%2Fv1.0.1) and [SDK experimental v0.27.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.27.0)**
**Compatible with [SDK stable ^1.0.0](https://github.com/open-telemetry/opentelemetry-js/tree/stable/v1.0.0) and [SDK experimental ^0.28.0](https://github.com/open-telemetry/opentelemetry-js/tree/v0.28.0/experimental/packages)**
## Instrumentations
| Instrumentation Package | Instrumented Lib | NPM |
| --- | --- | --- |
Expand Down Expand Up @@ -64,6 +64,7 @@ The instrumentations in this repo are:

| Instrumentations Version | OpenTelemetry Core | OpenTelemetry Experimental |
| --- | --- | --- |
| 0.28.x | ^1.0.0 | ^0.28.0 |
| 0.27.x | ^1.0.1 | ^0.27.0 |
| 0.26.x | ^1.0.0 | ^0.26.0 |
| 0.25.x | 0.25.0 | --- |
Expand Down
6 changes: 3 additions & 3 deletions detectors/node/resource-detector-deployment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"test": "mocha",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha",
"watch": "tsc -w",
Expand All @@ -33,15 +33,15 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/resources": "^1.0.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"opentelemetry-resource-detector-sync-api": "^0.26.0"
},
"devDependencies": {
"@opentelemetry/api": "^1.0.2",
"@opentelemetry/api": "^1.0.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"mocha": "^8.4.0",
Expand Down
6 changes: 3 additions & 3 deletions detectors/node/resource-detector-git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scripts": {
"postinstall": "node dist/src/persist-on-post-install.js || exit 0",
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"test": "mocha",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha",
"watch": "tsc -w",
Expand All @@ -34,7 +34,7 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/resources": "^1.0.0",
Expand All @@ -43,7 +43,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@opentelemetry/api": "^1.0.2",
"@opentelemetry/api": "^1.0.0",
"@types/mocha": "^8.2.2",
"@types/node": "^14.0.0",
"expect": "^26.6.2",
Expand Down
6 changes: 3 additions & 3 deletions detectors/node/resource-detector-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"test": "mocha",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha",
"watch": "tsc -w",
Expand All @@ -33,7 +33,7 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/resources": "^1.0.0",
Expand All @@ -42,7 +42,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@opentelemetry/api": "^1.0.2",
"@opentelemetry/api": "^1.0.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"mocha": "^8.4.0",
Expand Down
7 changes: 4 additions & 3 deletions detectors/resource-detector-sync-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"watch": "tsc -w",
"version:update": "node ../../scripts/version-update.js",
"version": "yarn run version:update"
Expand All @@ -30,13 +30,14 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/resources": "^1.0.0"
},
"devDependencies": {
"ts-node": "^9.1.1",
"typescript": "4.3.4"
"typescript": "4.3.4",
"@opentelemetry/api": "^1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/instrumentation-elasticsearch/.tav.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'@elastic/elasticsearch':
versions: "*"
versions: ">=5 <8"
commands:
- yarn test
10 changes: 5 additions & 5 deletions packages/instrumentation-elasticsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"scripts": {
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"watch": "tsc -w",
"version:update": "node ../../scripts/version-update.js",
"version": "yarn run version:update",
Expand All @@ -42,17 +42,17 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/core": "^1.0.0",
"@opentelemetry/instrumentation": "^0.27.0",
"@opentelemetry/instrumentation": "^0.28.0",
"@opentelemetry/semantic-conventions": "^1.0.0"
},
"devDependencies": {
"@elastic/elasticsearch": "^7.8.0",
"@opentelemetry/api": "^1.0.2",
"@opentelemetry/contrib-test-utils": "^0.28.0",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.30.0",
"@types/chai": "^4.2.15",
"@types/mocha": "^8.2.2",
"chai": "^4.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ElasticsearchInstrumentation extends InstrumentationBase<typeof ela
({ path, operationClassName }) =>
new InstrumentationNodeModuleFile<any>(
`@elastic/elasticsearch/api/${path}`,
['*'],
['>=5 <8'],
this.patch.bind(this, operationClassName),
this.unpatch.bind(this)
)
Expand Down
15 changes: 8 additions & 7 deletions packages/instrumentation-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"test": "mocha --require @opentelemetry/contrib-test-utils",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha --require @opentelemetry/contrib-test-utils",
"watch": "tsc -w",
Expand All @@ -32,20 +32,20 @@
"access": "public"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/core": "^1.0.0",
"@opentelemetry/instrumentation": "^0.27.0",
"@opentelemetry/instrumentation": "^0.28.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7"
},
"devDependencies": {
"@opentelemetry/api": "1.0.2",
"@opentelemetry/contrib-test-utils": "^0.28.0",
"@opentelemetry/instrumentation-http": "^0.27.0",
"@opentelemetry/sdk-trace-base": "1.0.1",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.30.0",
"@opentelemetry/instrumentation-http": "^0.28.0",
"@opentelemetry/sdk-trace-base": "1.2.0",
"@types/express": "4.17.8",
"@types/mocha": "^8.2.2",
"axios": "0.21.1",
Expand All @@ -54,6 +54,7 @@
"express": "4.17.1",
"mocha": "^8.4.0",
"opentelemetry-instrumentation-mocha": "0.0.1-rc.7",
"ts-node": "^9.1.1",
"test-all-versions": "^5.0.1",
"typescript": "4.3.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/instrumentation-express/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ export const errorMiddleware = (_req: express.Request, res: express.Response, ne
};

export const getExpressSpans = (): ReadableSpan[] => {
return getTestSpans().filter((s) => s.instrumentationLibrary.name?.endsWith('express'));
return getTestSpans().filter((s) => s.instrumentationLibrary.name?.endsWith('express')) as ReadableSpan[];
};
12 changes: 6 additions & 6 deletions packages/instrumentation-kafkajs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"scripts": {
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"test": "mocha --require @opentelemetry/contrib-test-utils",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha --require @opentelemetry/contrib-test-utils",
"test:ci": "yarn test",
Expand All @@ -35,16 +35,16 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.27.0",
"@opentelemetry/instrumentation": "^0.28.0",
"@opentelemetry/semantic-conventions": "^1.0.0"
},
"devDependencies": {
"@opentelemetry/api": "1.0.2",
"@opentelemetry/contrib-test-utils": "^0.28.0",
"@opentelemetry/sdk-trace-base": "1.0.1",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.30.0",
"@opentelemetry/sdk-trace-base": "1.2.0",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"kafkajs": "^1.12.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/instrumentation-kafkajs/test/kafkajs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('instrumentation-kafkajs', () => {
expect(span.attributes[SemanticAttributes.MESSAGING_DESTINATION]).toStrictEqual('topic-name-1');

expect(messagesSent.length).toBe(1);
expectKafkaHeadersToMatchSpanContext(messagesSent[0], span);
expectKafkaHeadersToMatchSpanContext(messagesSent[0], span as ReadableSpan);
});

it('send two messages', async () => {
Expand All @@ -148,8 +148,8 @@ describe('instrumentation-kafkajs', () => {
expect(spans[1].name).toStrictEqual('topic-name-1');

expect(messagesSent.length).toBe(2);
expectKafkaHeadersToMatchSpanContext(messagesSent[0], spans[0]);
expectKafkaHeadersToMatchSpanContext(messagesSent[1], spans[1]);
expectKafkaHeadersToMatchSpanContext(messagesSent[0], spans[0] as ReadableSpan);
expectKafkaHeadersToMatchSpanContext(messagesSent[1], spans[1] as ReadableSpan);
});

it('send batch', async () => {
Expand Down Expand Up @@ -185,7 +185,7 @@ describe('instrumentation-kafkajs', () => {

expect(messagesSent.length).toBe(3);
for (let i = 0; i < 3; i++) {
expectKafkaHeadersToMatchSpanContext(messagesSent[i], spans[i]);
expectKafkaHeadersToMatchSpanContext(messagesSent[i], spans[i] as ReadableSpan);
}
});
});
Expand Down
12 changes: 6 additions & 6 deletions packages/instrumentation-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"scripts": {
"build": "tsc",
"prepare": "yarn run build",
"prepare": "yarn build",
"test": "mocha --require @opentelemetry/contrib-test-utils",
"test:jaeger": "OTEL_EXPORTER_JAEGER_AGENT_HOST=localhost mocha --require @opentelemetry/contrib-test-utils",
"test:ci": "yarn test",
Expand All @@ -41,17 +41,17 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.0"
},
"dependencies": {
"@opentelemetry/core": "^1.0.0",
"@opentelemetry/instrumentation": "^0.27.0",
"@opentelemetry/instrumentation": "^0.28.0",
"@opentelemetry/semantic-conventions": "^1.0.0"
},
"devDependencies": {
"@opentelemetry/api": "1.0.2",
"@opentelemetry/contrib-test-utils": "^0.28.0",
"@opentelemetry/sdk-trace-base": "1.0.1",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.30.0",
"@opentelemetry/sdk-trace-base": "1.2.0",
"@types/mocha": "^8.2.2",
"@types/node": "^14.0.0",
"expect": "^26.6.2",
Expand Down
Loading