with_span
since the tracer isn't needed in many calls anymore) remain the same
otel_exporter_stdout
)span_with_sleep_ms(Delay) ->
Sampler = otel_sampler:setup(always_on, #{}),
Tracer = opentelemetry:get_tracer(otel_example),
otel_tracer:with_span(Tracer, <<"span_with_sleep_ms/1">>, #{sampler => Sampler},
fun(SpanCtx) ->
otel_span:set_attribute(SpanCtx, <<"Delay">>, Delay),
timer:sleep(Delay)
end).