-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rjawesome-otel' into otel
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,4 +122,8 @@ module.exports = class Config { | |
debug(error); | ||
} | ||
} | ||
|
||
setOpenTel() { | ||
|
||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*instrumentation.js*/ | ||
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 sdk = new opentelemetry.NodeSDK({ | ||
traceExporter: new OTLPTraceExporter({ | ||
url: process.env.JAEGER_URL ?? 'http://localhost:4318/v1/traces', | ||
// optional - collection of custom headers to be sent with each request, empty by default | ||
headers: {}, | ||
}), | ||
metricReader: new PeriodicExportingMetricReader({ | ||
exporter: new OTLPMetricExporter({ | ||
url: process.env.JAEGER_URL ?? 'http://localhost:4318/v1/traces', | ||
headers: {}, // an optional object containing custom headers to be sent with each request | ||
concurrencyLimit: 1, // an optional limit on pending requests | ||
}), | ||
}), | ||
instrumentations: [getNodeAutoInstrumentations()], | ||
resource: new Resource({ | ||
"service.name": "biothings-explorer" | ||
}) | ||
}); | ||
sdk.start(); |