Search code examples
javaopen-telemetryopen-telemetry-java

Create new Opentelemetry Trace in java


We have traces that have hundreds/thousands of spans because of loops and that seems pretty blooded.

Is there a way to create custom Opentelemetry traces in java ? Let's say in a loop, I want to create traces on my own.


Solution

  • tracer.spanBuilder("abc").setNoParent().startSpan()

    As @gaurang said, setNoParent is the one can create a trace.