Skip to content

Commit

Permalink
chore: Ignore heath and metrics paths
Browse files Browse the repository at this point in the history
  • Loading branch information
stevoland committed Feb 15, 2024
1 parent b672ebc commit 9f39063
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tracing.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Configuring manually due to https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1773
const process = require('process')
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node')
const instrumentations = getNodeAutoInstrumentations()
const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http')
const opentelemetry = require('@opentelemetry/sdk-node')
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc')
const { Resource } = require('@opentelemetry/resources')
Expand All @@ -16,7 +15,11 @@ if (OTEL_EXPORTER_OTLP_ENDPOINT) {

const sdk = new opentelemetry.NodeSDK({
traceExporter,
instrumentations: [instrumentations],
instrumentations: [
new HttpInstrumentation({
ignoreIncomingPaths: ['/health', '/metrics']
})
],
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'safe-settings'
})
Expand Down

0 comments on commit 9f39063

Please sign in to comment.