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

Commit

Permalink
chore: Update otel version (#31)
Browse files Browse the repository at this point in the history
* updates

* fix build

* remove amqplib

* remove opentelemetry-instrumentation-mongoose

* fix build

* update node versrion

* udpate ts-node

---------

Co-authored-by: Motti Bechhofer <motti.bechhofer@smartbear.com>
  • Loading branch information
mottibec and Motti Bechhofer authored May 16, 2024
1 parent 132b9aa commit fdcff31
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/setup-node@v1
with:
node-version: '14'
node-version: '16'

- uses: actions/checkout@v2

Expand Down
4 changes: 2 additions & 2 deletions examples/service-under-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"body-parser": "^1.19.0",
"express": "^4.17.1",
"ioredis": "^4.27.8",
"redis-memory-server": "^0.3.1",
"redis-memory-server": "^0.10.0",
"sequelize": "^6.6.5",
"sqlite3": "^5.0.2",
"ts-node": "^9.1.1",
"ts-node": "^10.9.2",
"typescript": "^4.2.4"
},
"devDependencies": {
Expand Down
33 changes: 16 additions & 17 deletions packages/instrumentation-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,28 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"dependencies": {
"@aspecto/opentelemetry-instrumentation-mongodb": "0.0.130",
"@opentelemetry/api": "^1.0.1",
"@opentelemetry/instrumentation-aws-sdk": "0.4.0",
"@opentelemetry/instrumentation-http": "0.27.0",
"@opentelemetry/instrumentation-ioredis": "0.27.0",
"opentelemetry-instrumentation-amqplib": "0.27.0",
"opentelemetry-instrumentation-elasticsearch": "0.27.0",
"opentelemetry-instrumentation-express": "0.27.0",
"opentelemetry-instrumentation-kafkajs": "0.27.0",
"opentelemetry-instrumentation-mongoose": "0.27.0",
"opentelemetry-instrumentation-neo4j": "0.27.0",
"opentelemetry-instrumentation-sequelize": "0.27.0",
"opentelemetry-instrumentation-typeorm": "0.27.0"
"@opentelemetry/instrumentation-mongodb": "0.43.0",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/instrumentation-aws-sdk": "0.41.0",
"@opentelemetry/instrumentation-http": "0.51.1",
"@opentelemetry/instrumentation-ioredis": "0.40.0",
"@opentelemetry/instrumentation-mongoose": "0.38.1",
"opentelemetry-instrumentation-elasticsearch": "0.40.0",
"opentelemetry-instrumentation-express": "0.40.0",
"opentelemetry-instrumentation-kafkajs": "0.40.0",
"opentelemetry-instrumentation-neo4j": "0.40.0",
"opentelemetry-instrumentation-sequelize": "0.40.0",
"opentelemetry-instrumentation-typeorm": "0.40.0"
},
"devDependencies": {
"@opentelemetry/instrumentation": "0.27.0",
"@opentelemetry/sdk-trace-base": "^1.0.1",
"@opentelemetry/sdk-trace-node": "^1.0.1",
"@opentelemetry/instrumentation": "0.51.1",
"@opentelemetry/sdk-trace-base": "^1.24.1",
"@opentelemetry/sdk-trace-node": "^1.24.1",
"@types/amqplib": "^0.8.1",
"axios": "^0.21.1",
"expect": "^26.6.2",
"mocha": "^8.3.2",
"ts-node": "^9.1.1",
"ts-node": "^10.9.2",
"typescript": "^4.0.5"
},
"mocha": {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { mongooseInstrumentationConfig } from './mongoose';
import { elasticsearchInstrumentationConfig } from './elasticsearch';
import { expressInstrumentationConfig } from './express';
import { neo4jInstrumentationConfig } from './neo4j';
import { amqplibInstrumentationConfig } from './amqplib';

// Instrumentations
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
Expand All @@ -18,10 +17,9 @@ import { SequelizeInstrumentation } from 'opentelemetry-instrumentation-sequeliz
import { AwsInstrumentation } from '@opentelemetry/instrumentation-aws-sdk';
import { TypeormInstrumentation } from 'opentelemetry-instrumentation-typeorm';
import { KafkaJsInstrumentation } from 'opentelemetry-instrumentation-kafkajs';
import { MongooseInstrumentation } from 'opentelemetry-instrumentation-mongoose';
import { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';
import { ElasticsearchInstrumentation } from 'opentelemetry-instrumentation-elasticsearch';
import { Neo4jInstrumentation } from 'opentelemetry-instrumentation-neo4j';
import { AmqplibInstrumentation } from 'opentelemetry-instrumentation-amqplib';
import { AutoInstrumentationOptions } from '../types';
import { InstrumentationOption } from '@opentelemetry/instrumentation';

Expand All @@ -42,7 +40,6 @@ export const getNodeAutoInstrumentations = (options?: AutoInstrumentationOptions
new ElasticsearchInstrumentation(elasticsearchInstrumentationConfig(optionsWithDefaults)),
new HttpInstrumentation(httpInstrumentationConfig(optionsWithDefaults)),
new Neo4jInstrumentation(neo4jInstrumentationConfig(optionsWithDefaults)),
new AmqplibInstrumentation(amqplibInstrumentationConfig(optionsWithDefaults)),
new IORedisInstrumentation(ioredisInstrumentationConfig(optionsWithDefaults)),
];
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
SerializerPayload,
MongooseResponseCustomAttributesFunction,
DbStatementSerializer,
} from 'opentelemetry-instrumentation-mongoose';
} from '@opentelemetry/instrumentation-mongoose';
import { callHookOnlyOnRecordingSpan } from '../payload-collection/recording-span';
import { DbExtendedAttribute, GeneralExtendedAttribute } from '../enums';
import { AutoInstrumentationOptions } from '../types';
Expand All @@ -27,6 +27,5 @@ const responseHook: MongooseResponseCustomAttributesFunction = (span: Span, resp
export const mongooseInstrumentationConfig = (options: AutoInstrumentationOptions): MongooseInstrumentationConfig => ({
suppressInternalInstrumentation: options.suppressInternalInstrumentation,
responseHook: options.collectPayloads && callHookOnlyOnRecordingSpan(responseHook),
dbStatementSerializer,
moduleVersionAttributeName: GeneralExtendedAttribute.INSTRUMENTED_LIBRARY_VERSION,
dbStatementSerializer
});
12 changes: 6 additions & 6 deletions packages/malabi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"url": "https://github.com/aspecto-io/malabi/issues"
},
"dependencies": {
"@opentelemetry/api": "^1.0.3",
"@opentelemetry/core": "^1.0.1",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/exporter-jaeger": "^1.0.1",
"@opentelemetry/instrumentation": "^0.27.0",
"@opentelemetry/sdk-trace-base": "^1.0.1",
"@opentelemetry/sdk-trace-node": "^1.0.1",
"@opentelemetry/semantic-conventions": "^1.0.1",
"@opentelemetry/instrumentation": "^0.51.1",
"@opentelemetry/sdk-trace-base": "^1.24.1",
"@opentelemetry/sdk-trace-node": "^1.24.1",
"@opentelemetry/semantic-conventions": "^1.24.1",
"axios": "^0.21.1",
"malabi-instrumentation-node": "^0.0.7-alpha.1",
"malabi-telemetry-repository": "^0.0.7-alpha.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/malabi/src/exporter/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { InMemorySpanExporter } from '@opentelemetry/tracing';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { ReadableSpan, InMemorySpanExporter } from '@opentelemetry/sdk-trace-base';

export const inMemoryExporter = new InMemorySpanExporter();

Expand Down
10 changes: 5 additions & 5 deletions packages/opentelemetry-instrumentation-mocha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"url": "https://github.com/aspecto-io/opentelemetry-ext-js/issues"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.24.1"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.27.0"
"@opentelemetry/instrumentation": "^0.51.1"
},
"devDependencies": {
"@opentelemetry/api": "^1.0.1",
"@opentelemetry/sdk-trace-base": "^1.0.1",
"@opentelemetry/sdk-trace-node": "^1.0.1",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/sdk-trace-base": "^1.24.1",
"@opentelemetry/sdk-trace-node": "^1.24.1",
"@types/mocha": "^8.2.2",
"expect": "^26.6.2",
"mocha-multi-reporters": "^1.5.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'mocha';
import expect from 'expect';
import type { InMemorySpanExporter } from '@opentelemetry/tracing';
import type { InMemorySpanExporter } from '@opentelemetry/sdk-trace-base';
const memoryExporter: InMemorySpanExporter = require('./instrument');
import { TestAttributes } from '../src/types';
import { SpanKind, SpanStatusCode, trace } from '@opentelemetry/api';
Expand Down
8 changes: 4 additions & 4 deletions packages/opentelemetry-proto-transformations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"README.md"
],
"dependencies": {
"@opentelemetry/api": "^1.0.1",
"@opentelemetry/core": "^0.23.0",
"@opentelemetry/resources": "^0.23.0",
"@opentelemetry/tracing": "^0.23.0",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/resources": "^1.24.1",
"@opentelemetry/sdk-trace-base": "^1.24.1",
"ts-proto": "^1.79.7"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fromProtoResourceSpansArray, toProtoResourceSpansArray } from '../../../trace/v1/transform';
import * as tracing from '@opentelemetry/tracing';
import * as tracing from '@opentelemetry/sdk-trace-base';
import * as resources from '@opentelemetry/resources';
import * as proto from './trace_service';
import { bytesArrayToHex, hexToBytesArray } from '../../../../../utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tracing from '@opentelemetry/tracing';
import * as tracing from '@opentelemetry/sdk-trace-base';
import * as resources from '@opentelemetry/resources';
import * as core from '@opentelemetry/core';
import * as api from '@opentelemetry/api';
Expand Down Expand Up @@ -175,6 +175,9 @@ export function fromProtoSpan(
ended: true,
resource: sdkResource,
instrumentationLibrary: sdkInstrumentationLibrary,
droppedAttributesCount: 0,
droppedEventsCount:0,
droppedLinksCount: 0,
};
}

Expand Down
8 changes: 4 additions & 4 deletions packages/telemetry-repository/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"url": "https://github.com/aspecto-io/malabi/issues"
},
"dependencies": {
"@opentelemetry/api": "^1.0.1",
"@opentelemetry/semantic-conventions": "^0.23.0",
"@opentelemetry/tracing": "^0.23.0"
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/semantic-conventions": "^1.24.1",
"@opentelemetry/sdk-trace-base": "^1.24.1"
},
"devDependencies": {
"@types/mocha": "^8.2.2",
"@types/node": "^15.6.0",
"expect": "^26.6.2",
"mocha": "^8.3.2",
"ts-node": "^9.1.1",
"ts-node": "^10.9.2",
"typescript": "^4.2.4"
},
"mocha": {
Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry-repository/src/MalabiSpan.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadableSpan } from '@opentelemetry/tracing';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { SpanStatusCode } from '@opentelemetry/api';
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';

Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry-repository/src/SpansRepository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadableSpan } from '@opentelemetry/tracing';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { MalabiSpan } from './MalabiSpan';
import { MessagingOperationValues, SemanticAttributes } from '@opentelemetry/semantic-conventions';
import { SpanKind } from '@opentelemetry/api';
Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry-repository/src/TelemetryRepository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReadableSpan } from '@opentelemetry/tracing';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import SpansRepository from './SpansRepository';

/**
Expand Down
8 changes: 5 additions & 3 deletions packages/telemetry-repository/test/MalabiSpan.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'mocha';
import { MalabiSpan } from '../src/MalabiSpan';
import { ReadableSpan } from '@opentelemetry/tracing';
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { SpanKind, SpanStatusCode } from '@opentelemetry/api';
import expect from 'expect';

Expand All @@ -23,8 +23,7 @@ describe('MalabiSpan', () => {
'http.request.headers': '{"Host":"localhost:8000","coNNecTion":"Keep-Alive"}',
'http.request.body': 'hello',
'http.response.headers': '{"x-powered-by":"Express","Access-Control-Allow-Origin":"*"}',
'http.response.body':
'{"_id":"60643994b0e6810024914e60","username":"homer","firstName":"Homer","lastName":"Simpson","email":"doh@gmail.com"}',
'http.response.body': '{"_id":"60643994b0e6810024914e60","username":"homer","firstName":"Homer","lastName":"Simpson","email":"doh@gmail.com"}',
'db.name': 'my-db',
'db.user': 'shlomo',
'db.system': 'mongodb',
Expand Down Expand Up @@ -55,6 +54,9 @@ describe('MalabiSpan', () => {
message: 'Some Error Message!',
},
spanContext: null,
droppedAttributesCount: 0,
droppedEventsCount: 0,
droppedLinksCount: 0
};

const malabiSpan = new MalabiSpan(span);
Expand Down

0 comments on commit fdcff31

Please sign in to comment.