Skip to content

Commit

Permalink
Generate configs
Browse files Browse the repository at this point in the history
  • Loading branch information
drewcorlin1 committed Jan 16, 2024
1 parent f509331 commit ad4e249
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 307 deletions.
42 changes: 21 additions & 21 deletions metapackages/auto-instrumentations-node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,25 @@
* limitations under the License.
*/

import { diag } from '@opentelemetry/api';
import { Instrumentation } from '@opentelemetry/instrumentation';
import {
Detector,
DetectorSync,
envDetectorSync,
hostDetectorSync,
osDetectorSync,
processDetectorSync,
} from '@opentelemetry/resources';
import {
awsBeanstalkDetector,
awsEc2Detector,
awsEcsDetector,
awsEksDetector,
awsLambdaDetector,
} from '@opentelemetry/resource-detector-aws';

import { AmqplibInstrumentation } from '@opentelemetry/instrumentation-amqplib';
import { AwsLambdaInstrumentation } from '@opentelemetry/instrumentation-aws-lambda';
import { AwsInstrumentation } from '@opentelemetry/instrumentation-aws-sdk';
import { AwsLambdaInstrumentation } from '@opentelemetry/instrumentation-aws-lambda';
import { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';
import { CassandraDriverInstrumentation } from '@opentelemetry/instrumentation-cassandra-driver';
import { ConnectInstrumentation } from '@opentelemetry/instrumentation-connect';
Expand All @@ -35,6 +48,8 @@ import { GrpcInstrumentation } from '@opentelemetry/instrumentation-grpc';
import { HapiInstrumentation } from '@opentelemetry/instrumentation-hapi';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';
import { Instrumentation } from '@opentelemetry/instrumentation';
import { InstrumentationAbstract } from '@opentelemetry/instrumentation/build/src/instrumentation';
import { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';
import { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';
import { LruMemoizerInstrumentation } from '@opentelemetry/instrumentation-lru-memoizer';
Expand All @@ -54,25 +69,10 @@ import { RouterInstrumentation } from '@opentelemetry/instrumentation-router';
import { SocketIoInstrumentation } from '@opentelemetry/instrumentation-socket.io';
import { TediousInstrumentation } from '@opentelemetry/instrumentation-tedious';
import { WinstonInstrumentation } from '@opentelemetry/instrumentation-winston';

import { alibabaCloudEcsDetector } from '@opentelemetry/resource-detector-alibaba-cloud';
import {
awsBeanstalkDetector,
awsEc2Detector,
awsEcsDetector,
awsEksDetector,
awsLambdaDetector,
} from '@opentelemetry/resource-detector-aws';
import { containerDetector } from '@opentelemetry/resource-detector-container';
import { diag } from '@opentelemetry/api';
import { gcpDetector } from '@opentelemetry/resource-detector-gcp';
import {
Detector,
DetectorSync,
envDetectorSync,
hostDetectorSync,
osDetectorSync,
processDetectorSync,
} from '@opentelemetry/resources';

const RESOURCE_DETECTOR_CONTAINER = 'container';
const RESOURCE_DETECTOR_ENVIRONMENT = 'env';
Expand Down Expand Up @@ -134,15 +134,15 @@ export type InstrumentationConfigMap = {

export function getNodeAutoInstrumentations(
inputConfigs: InstrumentationConfigMap = {}
): Instrumentation[] {
): InstrumentationAbstract[] {
for (const name of Object.keys(inputConfigs)) {
if (!Object.prototype.hasOwnProperty.call(InstrumentationMap, name)) {
diag.error(`Provided instrumentation name "${name}" not found`);
continue;
}
}

const instrumentations: Instrumentation[] = [];
const instrumentations: InstrumentationAbstract[] = [];

for (const name of Object.keys(InstrumentationMap) as Array<
keyof typeof InstrumentationMap
Expand Down
118 changes: 6 additions & 112 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/esbuild-plugin-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/auto-instrumentations-node": "^0.40.1",
"@opentelemetry/auto-instrumentations-node": "^0.40.3",
"@opentelemetry/instrumentation": "^0.45.1",
"@opentelemetry/instrumentation-amqplib": "^0.33.4",
"@opentelemetry/instrumentation-aws-lambda": "^0.37.2",
Expand Down
57 changes: 0 additions & 57 deletions packages/esbuild-plugin-node/src/config/aws-sdk.ts

This file was deleted.

Loading

0 comments on commit ad4e249

Please sign in to comment.