Add OpenTelemetry HTTP and Express instrumentations

This commit is contained in:
Simon Larsen
2024-02-20 13:14:27 +00:00
parent 30d9cbe9a3
commit aeaf9f55e4
2 changed files with 6 additions and 4 deletions

View File

@@ -3,6 +3,8 @@ import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentation
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-proto';
import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
import logger from './Logger';
import Dictionary from 'Common/Types/Dictionary';
@@ -39,7 +41,7 @@ if (
headers: headers,
}),
}) as any,
instrumentations: [getNodeAutoInstrumentations()],
instrumentations: [getNodeAutoInstrumentations(), new HttpInstrumentation(), new ExpressInstrumentation()],
});
sdk.start();

View File

@@ -25,9 +25,9 @@ exporters:
authenticator: headers_setter
service:
telemetry:
logs:
level: "debug"
# telemetry:
# logs:
# level: "debug"
extensions: [ headers_setter ]
pipelines:
traces: