refactor: rename remoteQuery to query and db instrumentation flag (#9159)
This commit is contained in:
1 parent
987d007ba8
commit
a872c76b85
1 file changed
+17
-14
@@ -262,34 +262,37 @@ export function registerOtel(options: {
|
|||||||
exporter: SpanExporter
|
exporter: SpanExporter
|
||||||
instrument?: Partial<{
|
instrument?: Partial<{
|
||||||
http: boolean
|
http: boolean
|
||||||
remoteQuery: boolean
|
query: boolean
|
||||||
workflows: boolean
|
workflows: boolean
|
||||||
|
db: boolean
|
||||||
}>
|
}>
|
||||||
instrumentations?: Instrumentation[]
|
instrumentations?: Instrumentation[]
|
||||||
}) {
|
}) {
|
||||||
const sdk = new NodeSDK({
|
|
||||||
serviceName: options.serviceName,
|
|
||||||
resource: new Resource({
|
|
||||||
"service.name": options.serviceName,
|
|
||||||
}),
|
|
||||||
spanProcessor: new SimpleSpanProcessor(options.exporter),
|
|
||||||
instrumentations: [
|
|
||||||
new PgInstrumentation(),
|
|
||||||
...(options.instrumentations || []),
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
const instrument = options.instrument || {}
|
const instrument = options.instrument || {}
|
||||||
|
const instrumentations = options.instrumentations || []
|
||||||
|
|
||||||
|
if (instrument.db) {
|
||||||
|
instrumentations.push(new PgInstrumentation())
|
||||||
|
}
|
||||||
if (instrument.http) {
|
if (instrument.http) {
|
||||||
instrumentHttpLayer()
|
instrumentHttpLayer()
|
||||||
}
|
}
|
||||||
if (instrument.remoteQuery) {
|
if (instrument.query) {
|
||||||
instrumentRemoteQuery()
|
instrumentRemoteQuery()
|
||||||
}
|
}
|
||||||
if (instrument.workflows) {
|
if (instrument.workflows) {
|
||||||
instrumentWorkflows()
|
instrumentWorkflows()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sdk = new NodeSDK({
|
||||||
|
serviceName: options.serviceName,
|
||||||
|
resource: new Resource({
|
||||||
|
"service.name": options.serviceName,
|
||||||
|
}),
|
||||||
|
spanProcessor: new SimpleSpanProcessor(options.exporter),
|
||||||
|
instrumentations: instrumentations,
|
||||||
|
})
|
||||||
|
|
||||||
sdk.start()
|
sdk.start()
|
||||||
return sdk
|
return sdk
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user