Skip to content

Commit

Permalink
fix: use jaeger-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Dec 15, 2023
1 parent 7cd447a commit 3e83170
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@bull-board/express": "^5.9.1",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/auto-instrumentations-node": "^0.40.2",
"@opentelemetry/exporter-jaeger": "^1.19.0",
"@opentelemetry/exporter-metrics-otlp-proto": "^0.45.1",
"@opentelemetry/exporter-trace-otlp-proto": "^0.45.1",
"@opentelemetry/resources": "^1.18.1",
Expand Down
10 changes: 4 additions & 6 deletions src/controllers/opentelemetry.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
const opentelemetry = require("@opentelemetry/sdk-node");
const { getNodeAutoInstrumentations } = require("@opentelemetry/auto-instrumentations-node");
const { OTLPTraceExporter } = require("@opentelemetry/exporter-trace-otlp-proto");
const { OTLPMetricExporter } = require("@opentelemetry/exporter-metrics-otlp-proto");
const { PeriodicExportingMetricReader, ConsoleMetricExporter } = require("@opentelemetry/sdk-metrics");
const { Resource } = require("@opentelemetry/resources");
const { ConsoleSpanExporter } = require("@opentelemetry/sdk-trace-node");
const Debug = require("debug");
const debug = Debug("bte:biothings-explorer:otel-init");
const { JaegerExporter } = require("@opentelemetry/exporter-jaeger");

debug("Initializing Opentelemetry instrumentation...");
const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter({
url: (process.env.JAEGER_URL ?? "http://localhost:4318") + "/v1/traces",
traceExporter: new JaegerExporter({
host: process.env.JAEGER_HOST ?? "jaeger-otel-agent.sri",
port: parseInt(process.env.JAEGER_PORT ?? "6381"),
}),
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
Expand Down

0 comments on commit 3e83170

Please sign in to comment.