Skip to content

Commit

Permalink
feat: update openetelemetry sdk version to support trace.getActiveSpan()
Browse files Browse the repository at this point in the history
feat: update openetelemetry sdk version to support trace.getActiveSpan()
  • Loading branch information
shanishiri authored Nov 3, 2022
1 parent c4bf40f commit 16aa3c5
Show file tree
Hide file tree
Showing 10 changed files with 20,760 additions and 12,353 deletions.
33,039 changes: 20,719 additions & 12,320 deletions package-lock.json

Large diffs are not rendered by default.

49 changes: 25 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
"author": "Orr Levinger",
"dependencies": {
"@lumigo/node-core": "^1.12.0",
"@opentelemetry/api": "1.1.0",
"@opentelemetry/core": "1.1.1",
"@opentelemetry/exporter-trace-otlp-http": "0.28.0",
"@opentelemetry/instrumentation": "0.28.0",
"@opentelemetry/instrumentation-express": "0.28.0",
"@opentelemetry/instrumentation-http": "0.28.0",
"@opentelemetry/api": "1.2.0",
"@opentelemetry/core": "1.7.0",
"@opentelemetry/exporter-trace-otlp-http": "0.33.0",
"@opentelemetry/instrumentation": "0.29.0",
"@opentelemetry/instrumentation-express": "0.29.0",
"@opentelemetry/instrumentation-http": "0.33.0",
"@opentelemetry/instrumentation-mongodb": "0.29.0",
"@opentelemetry/resource-detector-aws": "^1.1.1",
"@opentelemetry/resources": "1.1.1",
"@opentelemetry/sdk-trace-base": "1.1.1",
"@opentelemetry/sdk-trace-node": "1.1.1",
"@opentelemetry/semantic-conventions": "1.1.1",
"opentelemetry-instrumentation-express": "0.28.0",
"@opentelemetry/resource-detector-aws": "1.1.2",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/sdk-trace-base": "1.7.0",
"@opentelemetry/sdk-trace-node": "1.7.0",
"@opentelemetry/semantic-conventions": "1.2.0",
"opentelemetry-instrumentation-express": "0.29.0",
"shimmer": "^1.2.1"
},
"homepage": "https://github.com/lumigo-io/opentelemetry-js-distro.git",
Expand All @@ -47,6 +47,7 @@
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/preset-env": "^7.4.4",
"@babel/preset-typescript": "^7.16.7",
"@jest/globals": "^29.0.3",
"@opentelemetry/exporter-zipkin": "^1.0.1",
"@opentelemetry/plugin-express": "^0.15.0",
"@opentelemetry/plugin-http": "^0.18.2",
Expand All @@ -62,20 +63,21 @@
"aws-sdk": "^2.1066.0",
"axios": "^0.21.1",
"body-parser": "^1.19.1",
"bufferutil": "^4.0.1",
"canvas": "^2.5.0",
"chai": "^4.3.6",
"console-stamp": "^3.0.6",
"cross-env": "^6.0.0",
"encoding": "^0.1.0",
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"jest": "27.2.5",
"node-notifier": "^10.0.0",
"canvas": "^2.5.0",
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2",
"encoding": "^0.1.0",
"jest-chain": "^1.1.5",
"jest-chain": "^1.1.6",
"jest-json": "^2.0.0",
"console-stamp": "^3.0.6",
"@jest/globals": "^29.0.3",
"log-timestamp": "^0.3.0",
"node-notifier": "^10.0.0",
"npm-install-peers": "^1.2.2",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"semantic-release": "^19.0.2",
Expand All @@ -84,11 +86,10 @@
"tree-kill": "^1.2.2",
"ts-node": "^9.1.1",
"typescript": "^4.3.4",
"webpack": "^5.72.1",
"webpack-cli": "^4.10.0",
"chai": "^4.3.6",
"utf-8-validate": "^5.0.2",
"wait-on": "^6.0.1",
"log-timestamp": "^0.3.0"
"webpack": "^5.72.1",
"webpack-cli": "^4.10.0"
},
"release": {
"branches": [
Expand Down
4 changes: 2 additions & 2 deletions src/instrumentations/express/expressInstrumentation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('LumigoExpressInstrumentation', () => {
test('getInstrumentation should return ExpressInstrumentation object', () => {
expect(lumigoExpressInstrumentation.getInstrumentation()).toMatchObject({
instrumentationName: 'opentelemetry-instrumentation-express',
instrumentationVersion: '0.28.0',
instrumentationVersion: expect.any(String),
_config: {
enabled: true,
includeHttpAttributes: true,
Expand All @@ -21,7 +21,7 @@ describe('LumigoExpressInstrumentation', () => {
_tracer: {
_provider: {},
name: 'opentelemetry-instrumentation-express',
version: '0.28.0',
version: expect.any(String),
},
_meter: {},
_hooks: [
Expand Down
4 changes: 2 additions & 2 deletions src/instrumentations/https/httpInstrumentation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('LumigoHttpInstrumentation', () => {

expect(lumigoHttpInstrumentation.getInstrumentation()).toMatchObject({
instrumentationName: '@opentelemetry/instrumentation-http',
instrumentationVersion: '0.28.0',
instrumentationVersion: expect.any(String),
_config: {
enabled: true,
ignoreOutgoingUrls: expect.arrayContaining(ignoreConfig),
Expand All @@ -25,7 +25,7 @@ describe('LumigoHttpInstrumentation', () => {
_tracer: {
_provider: {},
name: '@opentelemetry/instrumentation-http',
version: '0.28.0',
version: expect.any(String),
},
_meter: {},
_hooks: [
Expand Down
5 changes: 5 additions & 0 deletions test/component/http/app/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const axios = require('axios');
const http = require("http");
const {trace} =require('@opentelemetry/api');
require('log-timestamp');

const host = 'localhost';
Expand All @@ -22,6 +23,7 @@ const requestListener = async function (req, res) {
});
res.setHeader("Content-Type", "application/json");
res.writeHead(200);
trace.getActiveSpan().setAttribute("lumigo.execution_tags.foo",["bar","baz"]);
res.end(JSON.stringify(result.data));
break
case "/large-response":
Expand All @@ -32,6 +34,7 @@ const requestListener = async function (req, res) {
});
res.setHeader("Content-Type", "application/json");
res.writeHead(200);
trace.getActiveSpan().setAttribute("lumigo.execution_tags.foo", "bar");
res.end(JSON.stringify(big_result.data));
break
case "/test2":
Expand All @@ -42,6 +45,8 @@ const requestListener = async function (req, res) {
});
res.setHeader("Content-Type", "application/json");
res.writeHead(200);
trace.getActiveSpan().setAttribute("lumigo.execution_tags.foo", "bar");
trace.getActiveSpan().setAttribute("lumigo.execution_tags.foo", "foo");
res.end(JSON.stringify(dog_res.data));
break
default:
Expand Down
4 changes: 3 additions & 1 deletion test/component/http/http.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe(`Component compatibility tests for ${COMPONENT_NAME}`, function () {
name: 'HTTP GET',
kind: 1,
resource: expectedResourceAttributes,
attributes: internalSpanAttributes,
attributes: {...internalSpanAttributes, "lumigo.execution_tags.foo": ["bar", "baz"]},
status: {
code: 0,
},
Expand Down Expand Up @@ -183,6 +183,7 @@ describe(`Component compatibility tests for ${COMPONENT_NAME}`, function () {
'http.status_code': 200,
'http.status_text': 'O',
"http.url": "h",
"lumigo.execution_tags.foo": "f"
}
)
expect(clientSpan.attributes).toMatchObject(
Expand Down Expand Up @@ -266,6 +267,7 @@ describe(`Component compatibility tests for ${COMPONENT_NAME}`, function () {
'http.status_code': 200,
'http.status_text': 'OK',
"http.url": "htt",
"lumigo.execution_tags.foo": "bar"
}
)
expect(clientSpan.attributes).toMatchObject(
Expand Down
2 changes: 1 addition & 1 deletion test/component/http/httpTestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const expectedResourceAttributes = {
"service.name": "http",
"telemetry.sdk.language": "nodejs",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.1.1",
"telemetry.sdk.version":expect.any(String),
"framework": "node",
'process.environ': expect.jsonMatching(
expect.objectContaining({
Expand Down
2 changes: 1 addition & 1 deletion test/integration/commonInstallDependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const installDependencyInTempLocation = (supportedDependencies, dependency) => {
fs.accessSync(holdingPath, fs.constants.F_OK);
console.info(`${fullName} installed`);
} catch (err) {
console.error(`Installing ${fullName}`);
console.error(`Installing ${fullName} error: ${err}`);
spawnSync('npm', ['install', fullName, '--no-save']);
spawnSync('mv', [`${__dirname}/${dependency}/app/node_modules/${dependency}`, holdingPath]);
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/express/expressTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const expectedResourceAttributes = {
'service.name': 'express',
'telemetry.sdk.language': 'nodejs',
'telemetry.sdk.name': 'opentelemetry',
'telemetry.sdk.version': '1.1.1',
'telemetry.sdk.version': expect.any(String),
framework: 'express',
'process.environ': expect.jsonMatching(
expect.objectContaining({
Expand Down
2 changes: 1 addition & 1 deletion test/integration/mongodb/mongodbTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function getExpectedResourceAttributes() {
"service.name": "mongodb",
"telemetry.sdk.language": "nodejs",
"telemetry.sdk.name": "opentelemetry",
"telemetry.sdk.version": "1.1.1",
"telemetry.sdk.version": expect.any(String),
"framework": "node",
'process.environ': expect.jsonMatching(
expect.objectContaining({
Expand Down

0 comments on commit 16aa3c5

Please sign in to comment.