|
2 | 2 | // SPDX-License-Identifier: Apache-2.0
|
3 | 3 |
|
4 | 4 | import { SpanKind, trace } from '@opentelemetry/api';
|
5 |
| -import { getNodeAutoInstrumentations, getResourceDetectors } from '@opentelemetry/auto-instrumentations-node'; |
6 |
| -import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-proto'; |
7 |
| -import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-proto'; |
8 |
| -import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto'; |
9 |
| -import { containerDetector } from '@opentelemetry/resource-detector-container'; |
10 |
| -import { Detector, DetectorSync, envDetector, hostDetector, processDetector, Resource } from '@opentelemetry/resources'; |
11 |
| -import { BatchLogRecordProcessor } from '@opentelemetry/sdk-logs'; |
12 |
| -import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics'; |
13 |
| -import { NodeSDK, NodeSDKConfiguration } from '@opentelemetry/sdk-node'; |
14 |
| -import { BatchSpanProcessor, SpanProcessor } from '@opentelemetry/sdk-trace-base'; |
15 |
| -import { ConsoleSpanExporter } from '@opentelemetry/sdk-trace-node'; |
| 5 | +import { getNodeAutoInstrumentations, getResourceDetectors } from '@opentelemetry/auto-instrumentations-node-1.x'; |
| 6 | +import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-proto-1.x'; |
| 7 | +import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-proto-1.x'; |
| 8 | +import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto-1.x'; |
| 9 | +import { containerDetector } from '@opentelemetry/resource-detector-container-1.x'; |
| 10 | +import { |
| 11 | + Detector, |
| 12 | + DetectorSync, |
| 13 | + envDetector, |
| 14 | + hostDetector, |
| 15 | + processDetector, |
| 16 | + Resource, |
| 17 | +} from '@opentelemetry/resources-1.x'; |
| 18 | +import { BatchLogRecordProcessor } from '@opentelemetry/sdk-logs-1.x'; |
| 19 | +import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics-1.x'; |
| 20 | +import { NodeSDK, NodeSDKConfiguration } from '@opentelemetry/sdk-node-1.x'; |
| 21 | +import { BatchSpanProcessor, SpanProcessor } from '@opentelemetry/sdk-trace-base-1.x'; |
| 22 | +import { ConsoleSpanExporter } from '@opentelemetry/sdk-trace-node-1.x'; |
16 | 23 |
|
17 | 24 | import PodUidDetector from './detectors/node/opentelemetry-resource-detector-kubernetes-pod';
|
18 | 25 | import ServiceNameFallbackDetector from './detectors/node/opentelemetry-resource-detector-service-name-fallback';
|
19 | 26 | import { FileSpanExporter } from './util/FileSpanExporter';
|
20 |
| -import { hasOptedIn, hasOptedOut, parseNumericEnvironmentVariableWithDefault } from './util/environment'; |
21 |
| -import { kafkaJsInstrumentation } from './util/kafkajs'; |
| 27 | +import { hasOptedIn, hasOptedOut, parseNumericEnvironmentVariableWithDefault } from '../util/environment'; |
| 28 | +import { kafkaJsInstrumentation } from '../util/kafkajs'; |
22 | 29 |
|
23 | 30 | const logPrefix = 'Dash0 OpenTelemetry distribution for Node.js:';
|
24 | 31 | const debugOutput = hasOptedIn('DASH0_DEBUG');
|
@@ -61,8 +68,16 @@ let sdkShutdownHasBeenCalled = false;
|
61 | 68 | const baseUrl = process.env.DASH0_OTEL_COLLECTOR_BASE_URL;
|
62 | 69 |
|
63 | 70 | const configuration: Partial<NodeSDKConfiguration> = {
|
| 71 | + // Ignore TS2322 triggered by different import paths due to custom package aliases being used in package.json |
| 72 | + // ("@opentelemetry/sdk-trace-base-1.x": "npm:@opentelemetry/[email protected]" etc.) |
| 73 | + // eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 74 | + // @ts-ignore |
64 | 75 | spanProcessors: spanProcessors(),
|
| 76 | + // eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 77 | + // @ts-ignore |
65 | 78 | metricReader: metricsReader(),
|
| 79 | + // eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 80 | + // @ts-ignore |
66 | 81 | logRecordProcessor: logRecordProcessor(),
|
67 | 82 | instrumentations: [
|
68 | 83 | //
|
|
0 commit comments