Skip to content

Commit

Permalink
trying...
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Aug 25, 2024
1 parent 6d0335c commit d9823a6
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 199 deletions.
5 changes: 5 additions & 0 deletions backend/agents/otel-tracing.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const opentelemetry = require('@opentelemetry/sdk-node');
const { MongoDBInstrumentation } = require('@opentelemetry/instrumentation-mongodb');

const { TraceIdRatioBasedSampler } = require('@opentelemetry/sdk-trace-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
Expand All @@ -24,6 +26,9 @@ const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter(),
sampler: new TraceIdRatioBasedSampler(samplePercentage),
instrumentations: [
new MongoDBInstrumentation({
// see under for available configuration
}),
getNodeAutoInstrumentations({
// we recommend disabling fs autoinstrumentation since it can be noisy
// and expensive during startup
Expand Down
Loading

0 comments on commit d9823a6

Please sign in to comment.