TracerProvider. Otherwise, it creates its own. Any spans created using the standard OpenTelemetry API or by instrumentation libraries will be captured.
Enable tracing
To enable tracing, setCaptureTraces to true in your middleware configuration:
Instrument libraries
To capture spans from HTTP clients, database drivers, and other libraries, use the corresponding OpenTelemetry instrumentation libraries. For example, to instrument outgoing HTTP requests usingotelhttp:
Create custom spans
For custom operations that aren’t covered by library instrumentation, you can create spans manually using the standard OpenTelemetry API:ctx returned by tracer.Start() to any child operations to maintain the span hierarchy.