View Source OpentelemetryProcessPropagator.Task.Supervisor (Opentelemetry Process Propagator v0.2.0)

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 the Task 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 a new linked 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 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

Link to this function

async(supervisor, fun, options \\ [])

View Source

Starts a task with the current OpenTelemetry.Ctx.t/0 that can be awaited on.

See Task.Supervisor.async/3 for more information.

Link to this function

async(supervisor, module, function_name, args, options \\ [])

View Source

Starts a task with the current OpenTelemetry.Ctx.t/0 that can be awaited on.

See Task.Supervisor.async/5 for more information.

Link to this function

async_nolink(supervisor, fun, options \\ [])

View Source

Starts a task with the current OpenTelemetry.Ctx.t/0 that can be awaited on.

See Task.Supervisor.async_nolink/3 for more information.

Link to this function

async_nolink(supervisor, module, function_name, args, options \\ [])

View Source

Starts a task with the current OpenTelemetry.Ctx.t/0 that can be awaited on.

See Task.Supervisor.async_nolink/5 for more information.

Link to this function

async_stream(supervisor, enumerable, fun, options \\ [])

View Source
@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.

Link to this function

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.

Link to this function

async_stream_nolink(supervisor, enumerable, fun, options \\ [])

View Source
@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.

Link to this function

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.

Link to this function

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.

Link to this function

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.

Link to this function

async_stream_with_span(supervisor, enumerable, name, start_opts, fun, options \\ [])

View Source

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.

Link to this function

async_stream_with_span(supervisor, enumerable, name, start_opts, module, function_name, args, options \\ [])

View Source

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.

Link to this function

async_with_linked_span(name, start_opts, supervisor, fun, options \\ [])

View Source

Starts a task with a new linked span that can be awaited on.

See Task.Supervisor.async/3 for more information.

Link to this function

async_with_linked_span(name, start_opts, supervisor, module, function_name, args, options \\ [])

View Source

Starts a task with a new linked span that can be awaited on.

See Task.Supervisor.async/5 for more information.

Link to this function

async_with_span(name, start_opts, supervisor, fun, options \\ [])

View Source

Starts a task with a new child span that can be awaited on.

See Task.Supervisor.async/3 for more information.

Link to this function

async_with_span(name, start_opts, supervisor, module, function_name, args, options \\ [])

View Source

Starts a task with a new child span that can be awaited on.

See Task.Supervisor.async/5 for more information.

See Task.Supervisor.children/1.

Link to this function

start_child(supervisor, fun, options \\ [])

View Source
@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.

Link to this function

start_child(supervisor, module, function_name, args, options \\ [])

View Source

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.

Link to this function

start_child_with_linked_span(name, start_opts, supervisor, fun, options \\ [])

View Source

Starts a task as a child of the given supervisor in a new linked span.

See Task.Supervisor.start_child/3 for more information.

Link to this function

start_child_with_linked_span(name, start_opts, supervisor, module, function_name, args, options \\ [])

View Source

Starts a task as a child of the given supervisor in a new linked span.

See Task.Supervisor.start_child/5 for more information.

Link to this function

start_child_with_span(name, start_opts, supervisor, fun, options \\ [])

View Source

Starts a task as a child of the given supervisor in a new child span.

See Task.Supervisor.start_child/3 for more information.

Link to this function

start_child_with_span(name, start_opts, supervisor, module, function_name, args, options \\ [])

View Source

Starts a task as a child of the given supervisor in a new child span.

See Task.Supervisor.start_child/5 for more information.

See Task.Supervisor.start_link/0.

Link to this function

terminate_child(supervisor, pid)

View Source

See Task.Supervisor.terminate_child/2.