Skip to content

Commit

Permalink
upgrade to opentelemetry 1.26.0 / 0.53.0 (#945)
Browse files Browse the repository at this point in the history
* upgrade to opentelemetry 1.26.0 / 0.53.0

* add express types for examples
  • Loading branch information
seemk authored Sep 2, 2024
1 parent 2310fa5 commit fe5adb1
Show file tree
Hide file tree
Showing 7 changed files with 875 additions and 1,540 deletions.
1 change: 1 addition & 0 deletions examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"express": "^4.18.2"
},
"devDependencies": {
"@types/express": "^4.17.21",
"typescript": "5.2.2"
}
}
2,267 changes: 809 additions & 1,458 deletions package-lock.json

Large diffs are not rendered by default.

112 changes: 56 additions & 56 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,68 +98,68 @@
"winston": "3.10.0"
},
"dependencies": {
"@grpc/grpc-js": "^1.10.10",
"@grpc/grpc-js": "^1.11.1",
"@grpc/proto-loader": "^0.7.13",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/api-logs": "^0.52.1",
"@opentelemetry/context-async-hooks": "1.25.1",
"@opentelemetry/core": "1.25.1",
"@opentelemetry/resource-detector-container": "0.4.0",
"@opentelemetry/exporter-logs-otlp-http": "0.52.1",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.52.1",
"@opentelemetry/exporter-metrics-otlp-proto": "0.52.1",
"@opentelemetry/exporter-trace-otlp-grpc": "0.52.1",
"@opentelemetry/exporter-trace-otlp-proto": "0.52.1",
"@opentelemetry/instrumentation": "0.52.1",
"@opentelemetry/instrumentation-amqplib": "0.38.0",
"@opentelemetry/instrumentation-aws-sdk": "0.42.0",
"@opentelemetry/instrumentation-bunyan": "0.39.0",
"@opentelemetry/instrumentation-cassandra-driver": "0.39.0",
"@opentelemetry/instrumentation-connect": "0.37.0",
"@opentelemetry/instrumentation-dataloader": "0.10.0",
"@opentelemetry/instrumentation-dns": "0.37.0",
"@opentelemetry/instrumentation-express": "0.40.1",
"@opentelemetry/instrumentation-fastify": "0.37.0",
"@opentelemetry/instrumentation-generic-pool": "0.37.0",
"@opentelemetry/instrumentation-graphql": "0.41.0",
"@opentelemetry/instrumentation-grpc": "0.52.1",
"@opentelemetry/instrumentation-hapi": "0.39.0",
"@opentelemetry/instrumentation-http": "0.52.1",
"@opentelemetry/instrumentation-ioredis": "0.41.0",
"@opentelemetry/instrumentation-kafkajs": "0.1.0",
"@opentelemetry/instrumentation-knex": "0.37.0",
"@opentelemetry/instrumentation-koa": "0.41.0",
"@opentelemetry/instrumentation-lru-memoizer": "0.39.0",
"@opentelemetry/instrumentation-memcached": "0.37.0",
"@opentelemetry/instrumentation-mongodb": "0.45.0",
"@opentelemetry/instrumentation-mongoose": "0.39.0",
"@opentelemetry/instrumentation-mysql": "0.39.0",
"@opentelemetry/instrumentation-mysql2": "0.39.0",
"@opentelemetry/instrumentation-nestjs-core": "0.38.0",
"@opentelemetry/instrumentation-net": "0.37.0",
"@opentelemetry/instrumentation-pg": "0.42.0",
"@opentelemetry/instrumentation-pino": "0.40.0",
"@opentelemetry/instrumentation-redis": "0.40.0",
"@opentelemetry/instrumentation-redis-4": "0.40.0",
"@opentelemetry/instrumentation-restify": "0.39.0",
"@opentelemetry/instrumentation-router": "0.38.0",
"@opentelemetry/instrumentation-socket.io": "0.41.0",
"@opentelemetry/instrumentation-tedious": "0.11.0",
"@opentelemetry/instrumentation-undici": "0.4.0",
"@opentelemetry/instrumentation-winston": "0.38.0",
"@opentelemetry/propagator-b3": "1.25.1",
"@opentelemetry/api-logs": "^0.53.0",
"@opentelemetry/context-async-hooks": "1.26.0",
"@opentelemetry/core": "1.26.0",
"@opentelemetry/resource-detector-container": "0.4.1",
"@opentelemetry/exporter-logs-otlp-http": "0.53.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.53.0",
"@opentelemetry/exporter-metrics-otlp-proto": "0.53.0",
"@opentelemetry/exporter-trace-otlp-grpc": "0.53.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.53.0",
"@opentelemetry/instrumentation": "0.53.0",
"@opentelemetry/instrumentation-amqplib": "0.42.0",
"@opentelemetry/instrumentation-aws-sdk": "0.44.0",
"@opentelemetry/instrumentation-bunyan": "0.41.0",
"@opentelemetry/instrumentation-cassandra-driver": "0.41.0",
"@opentelemetry/instrumentation-connect": "0.39.0",
"@opentelemetry/instrumentation-dataloader": "0.12.0",
"@opentelemetry/instrumentation-dns": "0.39.0",
"@opentelemetry/instrumentation-express": "0.42.0",
"@opentelemetry/instrumentation-fastify": "0.39.0",
"@opentelemetry/instrumentation-generic-pool": "0.39.0",
"@opentelemetry/instrumentation-graphql": "0.43.0",
"@opentelemetry/instrumentation-grpc": "0.53.0",
"@opentelemetry/instrumentation-hapi": "0.41.0",
"@opentelemetry/instrumentation-http": "0.53.0",
"@opentelemetry/instrumentation-ioredis": "0.43.0",
"@opentelemetry/instrumentation-kafkajs": "0.3.0",
"@opentelemetry/instrumentation-knex": "0.40.0",
"@opentelemetry/instrumentation-koa": "0.43.0",
"@opentelemetry/instrumentation-lru-memoizer": "0.40.0",
"@opentelemetry/instrumentation-memcached": "0.39.0",
"@opentelemetry/instrumentation-mongodb": "0.47.0",
"@opentelemetry/instrumentation-mongoose": "0.42.0",
"@opentelemetry/instrumentation-mysql": "0.41.0",
"@opentelemetry/instrumentation-mysql2": "0.41.0",
"@opentelemetry/instrumentation-nestjs-core": "0.40.0",
"@opentelemetry/instrumentation-net": "0.39.0",
"@opentelemetry/instrumentation-pg": "0.44.0",
"@opentelemetry/instrumentation-pino": "0.42.0",
"@opentelemetry/instrumentation-redis": "0.42.0",
"@opentelemetry/instrumentation-redis-4": "0.42.0",
"@opentelemetry/instrumentation-restify": "0.41.0",
"@opentelemetry/instrumentation-router": "0.40.0",
"@opentelemetry/instrumentation-socket.io": "0.42.0",
"@opentelemetry/instrumentation-tedious": "0.14.0",
"@opentelemetry/instrumentation-undici": "0.6.0",
"@opentelemetry/instrumentation-winston": "0.40.0",
"@opentelemetry/propagator-b3": "1.26.0",
"@opentelemetry/resources": "1.26.0",
"@opentelemetry/sdk-logs": "^0.52.1",
"@opentelemetry/sdk-metrics": "1.25.1",
"@opentelemetry/sdk-trace-base": "1.25.1",
"@opentelemetry/sdk-trace-node": "1.25.1",
"@opentelemetry/sdk-logs": "^0.53.0",
"@opentelemetry/sdk-metrics": "1.26.0",
"@opentelemetry/sdk-trace-base": "1.26.0",
"@opentelemetry/sdk-trace-node": "1.26.0",
"@opentelemetry/semantic-conventions": "1.27.0",
"@opentelemetry/winston-transport": "0.5.0",
"@opentelemetry/winston-transport": "0.6.0",
"is-promise": "^4.0.0",
"nan": "^2.20.0",
"node-gyp-build": "^4.8.1",
"protobufjs": "^7.3.2",
"semver": "^7.6.0"
"node-gyp-build": "^4.8.2",
"protobufjs": "^7.4.0",
"semver": "^7.6.3"
},
"peerDependencies": {
"@opentelemetry/api": "^1.3.0"
Expand Down
9 changes: 2 additions & 7 deletions src/instrumentations/external/elasticsearch/elasticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,20 @@ enum AttributeNames {
ELASTICSEARCH_INDICES = 'elasticsearch.request.indices',
}

export class ElasticsearchInstrumentation extends InstrumentationBase {
export class ElasticsearchInstrumentation extends InstrumentationBase<ElasticsearchInstrumentationConfig> {
static readonly component = '@elastic/elasticsearch';

protected override _config: ElasticsearchInstrumentationConfig = {};
private _isEnabled = false;
private moduleVersion?: string;

constructor(config: ElasticsearchInstrumentationConfig = {}) {
super(
'splunk-opentelemetry-instrumentation-elasticsearch',
VERSION,
Object.assign({}, config)
config
);
}

override setConfig(config: ElasticsearchInstrumentationConfig = {}) {
this._config = Object.assign({}, config);
}

protected init(): InstrumentationModuleDefinition {
const apiModuleFiles = ELASTICSEARCH_API_FILES.map(
({ path, operationClassName }) =>
Expand Down
13 changes: 2 additions & 11 deletions src/instrumentations/external/sequelize/sequelize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,12 @@ import {
safeExecuteInTheMiddle,
} from '@opentelemetry/instrumentation';

export class SequelizeInstrumentation extends InstrumentationBase {
export class SequelizeInstrumentation extends InstrumentationBase<SequelizeInstrumentationConfig> {
static readonly component = 'sequelize';
protected override _config!: SequelizeInstrumentationConfig;
private moduleVersion?: string;

constructor(config: SequelizeInstrumentationConfig = {}) {
super(
'splunk-opentelemetry-instrumentation-sequelize',
VERSION,
Object.assign({}, config)
);
}

override setConfig(config: SequelizeInstrumentationConfig = {}) {
this._config = Object.assign({}, config);
super('splunk-opentelemetry-instrumentation-sequelize', VERSION, config);
}

protected init() {
Expand Down
9 changes: 2 additions & 7 deletions src/instrumentations/external/typeorm/typeorm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,9 @@ const entityManagerMethods: EntityManagerMethods[] = [
...functionsUsingQueryBuilder,
];

export class TypeormInstrumentation extends InstrumentationBase {
protected override _config!: TypeormInstrumentationConfig;
export class TypeormInstrumentation extends InstrumentationBase<TypeormInstrumentationConfig> {
constructor(config: TypeormInstrumentationConfig = {}) {
super(
'splunk-opentelemetry-instrumentation-typeorm',
VERSION,
Object.assign({}, config)
);
super('splunk-opentelemetry-instrumentation-typeorm', VERSION, config);
}

protected init() {
Expand Down
4 changes: 3 additions & 1 deletion test/metrics.options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ describe('metrics options', () => {
assert(exporter instanceof OTLPHttpProtoMetricExporter);

assert.deepStrictEqual(
exporter['_otlpExporter'].headers['X-SF-TOKEN'],
exporter._otlpExporter['_transport']['_transport']['_parameters'][
'headers'
]['X-SF-TOKEN'],
'abc'
);

Expand Down

0 comments on commit fe5adb1

Please sign in to comment.