perl-opentelemetry icon indicating copy to clipboard operation
perl-opentelemetry copied to clipboard

Automatically scoped span

Open abh opened this issue 1 year ago • 3 comments

This might just be another documentation request.

In my (still very limited) tests this seems like a commonly useful construct:

    my $span = $tracer->create_span(name => "foo");
    dynamically OpenTelemetry::Context->current = OpenTelemetry::Trace->context_with_span($span);

I don't know if it's possible, but something like

my $span = $tracer->create_scoped_span(name => "foo");

that'd do both in one would be a very useful (and Perl-ish?) feature.

abh avatar Nov 27 '23 22:11 abh