View Source OpentelemetryProcessPropagator.Task.Supervisor (Opentelemetry Process Propagator v0.2.1)
OpentelemetryProcessPropagator.Task.Supervisor
provides a set of extensions
to the Task.Supervisor
module to reduce some boilerplate in propagating OpenTelemetry
contexts across process boundaries. Since these are extensions rather
than a replacement of Elixir's module, this library can be aliased
into a file without concern for creating spans where you do not want them.
Each Task.Supervisor
function is replicated with two variants: *_with_span
and *_with_linked_span
. Each of these variations has a specific use case.
The original implementation for each function automatically propagates the
current context.
*
- propagates the current context*_with_span
- propagates the current context and starts a new child span.*_with_linked_span
- propagates the current context and starts a new linked span.
Module Redefinement
This module does not redefine the
Task.Supervisor
module, instead providing a wrapper of the module, so this functionality will not globally modify the default behavior of theTask
module.
Link to this section Summary
Functions
Starts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
Starts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
Starts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
Starts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
Starts a task with a new linked span that can be awaited on.
Starts a task with a new linked span that can be awaited on.
Starts a task with a new child span that can be awaited on.
Starts a task with a new child span that can be awaited on.
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with the current OpenTelemetry.Ctx.t/0
attached.
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with the
current OpenTelemetry.Ctx.t/0
attached.
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with the current OpenTelemetry.Ctx.t/0
attached.
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with the
current OpenTelemetry.Ctx.t/0
attached.
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new linked span.
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new linked span.
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new child span.
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new child span.
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new linked span.
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new linked span.
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new child span.
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new child span.
Starts a task with a new linked span that can be awaited on.
Starts a task with a new linked span that can be awaited on.
Starts a task with a new child span that can be awaited on.
Starts a task with a new child span that can be awaited on.
Starts a task as a child of the given supervisor
with the
current OpenTelemetry.Ctx.t/0
.
Starts a task as a child of the given supervisor
with the
current OpenTelemetry.Ctx.t/0
.
Starts a task as a child of the given supervisor
in a new linked span.
Starts a task as a child of the given supervisor
in a new linked span.
Starts a task as a child of the given supervisor
in a new child span.
Starts a task as a child of the given supervisor
in a new child span.
Link to this section Functions
Starts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
See Task.Supervisor.async/3
for more information.
Starts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
See Task.Supervisor.async/5
for more information.
Starts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
See Task.Supervisor.async_nolink/3
for more information.
async_nolink(supervisor, module, function_name, args, options \\ [])
View SourceStarts a task with the current OpenTelemetry.Ctx.t/0
that can be awaited on.
See Task.Supervisor.async_nolink/5
for more information.
async_nolink_with_linked_span(name, start_opts, supervisor, fun, options \\ [])
View SourceStarts a task with a new linked span that can be awaited on.
See Task.Supervisor.async_nolink/3
for more information.
async_nolink_with_linked_span(name, start_opts, supervisor, module, function_name, args, options \\ [])
View SourceStarts a task with a new linked span that can be awaited on.
See Task.Supervisor.async_nolink/5
for more information.
async_nolink_with_span(name, start_opts, supervisor, fun, options \\ [])
View SourceStarts a task with a new child span that can be awaited on.
See Task.Supervisor.async_nolink/3
for more information.
async_nolink_with_span(name, start_opts, supervisor, module, function_name, args, options \\ [])
View SourceStarts a task with a new child span that can be awaited on.
See Task.Supervisor.async_nolink/5
for more information.
@spec async_stream( Supervisor.supervisor(), Enumerable.t(), (term() -> term()), keyword() ) :: Enumerable.t()
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with the current OpenTelemetry.Ctx.t/0
attached.
See Task.Supervisor.async_stream/4
for more information.
async_stream(supervisor, enumerable, module, function_name, args, options \\ [])
View Source@spec async_stream( Supervisor.supervisor(), Enumerable.t(), module(), atom(), [term()], keyword() ) :: Enumerable.t()
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with the
current OpenTelemetry.Ctx.t/0
attached.
See Task.Supervisor.async_stream/6
for more information.
@spec async_stream_nolink( Supervisor.supervisor(), Enumerable.t(), (term() -> term()), keyword() ) :: Enumerable.t()
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with the current OpenTelemetry.Ctx.t/0
attached.
See Task.Supervisor.async_stream_nolink/4
for more information.
async_stream_nolink(supervisor, enumerable, module, function_name, args, options \\ [])
View Source@spec async_stream_nolink( Supervisor.supervisor(), Enumerable.t(), module(), atom(), [term()], keyword() ) :: Enumerable.t()
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with the
current OpenTelemetry.Ctx.t/0
attached.
See Task.Supervisor.async_stream_nolink/6
for more information.
async_stream_nolink_with_linked_span(supervisor, enumerable, name, start_opts, fun, options \\ [])
View Source@spec async_stream_nolink_with_linked_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), (term() -> term()), keyword() ) :: Enumerable.t()
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new linked span.
See Task.Supervisor.async_stream_nolink/4
for more information.
async_stream_nolink_with_linked_span(supervisor, enumerable, name, start_opts, module, function_name, args, options \\ [])
View Source@spec async_stream_nolink_with_linked_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), module(), atom(), [term()], keyword() ) :: Enumerable.t()
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new linked span.
See Task.Supervisor.async_stream_nolink/6
for more information.
async_stream_nolink_with_span(supervisor, enumerable, name, start_opts, fun, options \\ [])
View Source@spec async_stream_nolink_with_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), (term() -> term()), keyword() ) :: Enumerable.t()
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new child span.
See Task.Supervisor.async_stream_nolink/4
for more information.
async_stream_nolink_with_span(supervisor, enumerable, name, start_opts, module, function_name, args, options \\ [])
View Source@spec async_stream_nolink_with_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), module(), atom(), [term()], keyword() ) :: Enumerable.t()
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new child span.
See Task.Supervisor.async_stream_nolink/6
for more information.
async_stream_with_linked_span(supervisor, enumerable, name, start_opts, fun, options \\ [])
View Source@spec async_stream_with_linked_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), (term() -> term()), keyword() ) :: Enumerable.t()
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new linked span.
See Task.Supervisor.async_stream/4
for more information.
async_stream_with_linked_span(supervisor, enumerable, name, start_opts, module, function_name, args, options \\ [])
View Source@spec async_stream_with_linked_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), module(), atom(), [term()], keyword() ) :: Enumerable.t()
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new linked span.
See Task.Supervisor.async_stream/6
for more information.
async_stream_with_span(supervisor, enumerable, name, start_opts, fun, options \\ [])
View Source@spec async_stream_with_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), (term() -> term()), keyword() ) :: Enumerable.t()
Returns a stream that runs the given function fun
concurrently
on each element in enumerable
with a new child span.
See Task.Supervisor.async_stream/4
for more information.
async_stream_with_span(supervisor, enumerable, name, start_opts, module, function_name, args, options \\ [])
View Source@spec async_stream_with_span( Supervisor.supervisor(), Enumerable.t(), OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), module(), atom(), [term()], keyword() ) :: Enumerable.t()
Returns a stream where the given function (module
and function
)
is mapped concurrently on each element in enumerable
with a new child span.
See Task.Supervisor.async_stream/6
for more information.
async_with_linked_span(name, start_opts, supervisor, fun, options \\ [])
View SourceStarts a task with a new linked span that can be awaited on.
See Task.Supervisor.async/3
for more information.
async_with_linked_span(name, start_opts, supervisor, module, function_name, args, options \\ [])
View SourceStarts a task with a new linked span that can be awaited on.
See Task.Supervisor.async/5
for more information.
Starts a task with a new child span that can be awaited on.
See Task.Supervisor.async/3
for more information.
async_with_span(name, start_opts, supervisor, module, function_name, args, options \\ [])
View SourceStarts a task with a new child span that can be awaited on.
See Task.Supervisor.async/5
for more information.
@spec start_child( Supervisor.supervisor(), (() -> any()), keyword() ) :: DynamicSupervisor.on_start_child()
Starts a task as a child of the given supervisor
with the
current OpenTelemetry.Ctx.t/0
.
See Task.Supervisor.start_child/3
for more information.
start_child(supervisor, module, function_name, args, options \\ [])
View Source@spec start_child( Supervisor.supervisor(), module(), atom(), [term()], keyword() ) :: DynamicSupervisor.on_start_child()
Starts a task as a child of the given supervisor
with the
current OpenTelemetry.Ctx.t/0
.
See Task.Supervisor.start_child/5
for more information.
start_child_with_linked_span(name, start_opts, supervisor, fun, options \\ [])
View Source@spec start_child_with_linked_span( OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), Supervisor.supervisor(), (() -> any()), keyword() ) :: DynamicSupervisor.on_start_child()
Starts a task as a child of the given supervisor
in a new linked span.
See Task.Supervisor.start_child/3
for more information.
start_child_with_linked_span(name, start_opts, supervisor, module, function_name, args, options \\ [])
View Source@spec start_child_with_linked_span( OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), Supervisor.supervisor(), module(), atom(), [term()], keyword() ) :: DynamicSupervisor.on_start_child()
Starts a task as a child of the given supervisor
in a new linked span.
See Task.Supervisor.start_child/5
for more information.
start_child_with_span(name, start_opts, supervisor, fun, options \\ [])
View Source@spec start_child_with_span( OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), Supervisor.supervisor(), (() -> any()), keyword() ) :: DynamicSupervisor.on_start_child()
Starts a task as a child of the given supervisor
in a new child span.
See Task.Supervisor.start_child/3
for more information.
start_child_with_span(name, start_opts, supervisor, module, function_name, args, options \\ [])
View Source@spec start_child_with_span( OpenTelemetry.span_name(), OpenTelemetry.Span.start_opts(), Supervisor.supervisor(), module(), atom(), [term()], keyword() ) :: DynamicSupervisor.on_start_child()
Starts a task as a child of the given supervisor
in a new child span.
See Task.Supervisor.start_child/5
for more information.