A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://hexdocs.pm/opentelemetry_process_propagator/0.3.0/OpentelemetryProcessPropagator.Task.html below:

OpentelemetryProcessPropagator.Task — Opentelemetry Process Propagator v0.3.0

View Source OpentelemetryProcessPropagator.Task (Opentelemetry Process Propagator v0.3.0)

OpentelemetryProcessPropagator.Task provides a set of extensions to the Task 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 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.

Module Redefinement

This module does not redefine the Task module, instead providing a wrapper of the module, so this functionality will not globally modify the default behavior of the Task module.

Usage
defmodule MyApp do
  require OpenTelemetry.Tracer
  alias OpentelemetryProcessPropagator.Task

  def traced_task_with_existing_span do
    Task.async(fn ->
      :ok
    end)
    |> Task.await()
  end

  def traced_task_with_new_span do
    Task.async_with_span(:span_name, %{attributes: %{a: "b"}}, fn ->
      Tracer.set_attribute(:c, "d")
      :ok
    end)
    |> Task.await()
  end

  def traced_task_with_new_linked_span do
    Task.async_with_linked_span(:span_name, %{attributes: %{a: "b"}}, fn ->
      Tracer.set_attribute(:c, "d")
      :ok
    end)
    |> Task.await()
  end
end
Summary Functions

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.

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 part of a supervision tree with the given fun with the current OpenTelemetry.Ctx.t/0 attached.

Starts a task as part of a supervision tree with the given module, function, and args with the current OpenTelemetry.Ctx.t/0 attached.

Starts a task as part of a supervision tree with the given fun in a new linked span.

Starts a task as part of a supervision tree with the given module, function, and args in a new linked span.

Starts a task as part of a supervision tree with the given fun in a new child span.

Starts a task as part of a supervision tree with the given module, function, and args in a new child span.

Starts a task with a new linked span.

Starts a task with a new linked span.

Starts a task with a new child span.

Starts a task with a new child span.

Functions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4