Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.3 KB

plugins.md

File metadata and controls

31 lines (24 loc) · 1.3 KB

The official Splunk documentation for this page is Instrument a Node application automatically. For instructions on how to contribute to the docs, see CONTRIBUTING.md.

Using custom or third-party instrumentations

If you set up tracing manually by calling the startTracing() method, you can use custom or third-party instrumentations as long as they implement the OpenTelemetry JS Instrumentation interface. Custom instrumentations can be enabled by passing them to the startTracing() method as follows:

const { startTracing } = require('@splunk/otel');

startTracing({
  instrumentations: [
    new MyCustomInstrumentation(),
    new AnotherInstrumentation(),
  ]
});

You can also add the default set of instrumentation to the list as follows:

const { startTracing } = require('@splunk/otel');
const { getInstrumentations } = require('@splunk/otel/lib/instrumentations');

startTracing({
  instrumentations: [
    ...getInstrumentations(),
    new MyCustomInstrumentation(),
    new AnotherInstrumentation(),
  ]
});