Enrich with OpenTelemetry APIs
JavaScript
Required dependencies
Add the following NPM packages to your project by running:
Creating Spans
To create a span, you need to use the tracer
object.
The tracer
object is the entry point for the OpenTelemetry API.
You can create a tracer
object using the getTracer
method from the @opentelemetry/api
package.
Make sure to replace instrumentation-scope-name
and instrumentation-scope-version
with the name and version of your instrumented file.
Additional information
For more use cases, see the OpenTelemetry JavaScript API documentation.