View Source Membrane.OpenTelemetry (Membrane OpenTelemetry v0.1.0)
Defines macros for operations on (OpenTelemetry)[https://hexdocs.pm/opentelemetry_api] traces, spans and events. Provided macros expand to appropriate calls to (OpenTelemetry)[https://hexdocs.pm/opentelemetry_api] functions or to nothing, depending on config values. Purpose of this module, is to provide simple way of introducing OpenTelemetry into Membrane Elements, Bins and Piplines.
Link to this section Summary
Functions
Adds an event to a span with a specific id.
Adds events to a span with a specific id.
Attaches otel_ctx
. See docs for OpenTelemetry.Ctx.attach/1
.
Ends a span.
See Membrane.OpenTelemetry.ETSUtils.get_span/1
.
Creates new otel_ctx
. See docs for OpenTelemetry.Ctx.new/1
.
Sets an attribute value in a span with a specific id.
Sets attributes in a span with specific id.
Starts a new span. Returns context of newly created span. First argument is span id. Span id is used to identify span and must be unique within one process.
Link to this section Types
Specs
span_id() :: String.t()
Link to this section Functions
Adds an event to a span with a specific id.
Adds events to a span with a specific id.
Attaches otel_ctx
. See docs for OpenTelemetry.Ctx.attach/1
.
Ends a span.
Specs
get_span(span_id()) :: :opentelemetry.span_ctx() | nil
See Membrane.OpenTelemetry.ETSUtils.get_span/1
.
Creates new otel_ctx
. See docs for OpenTelemetry.Ctx.new/1
.
Sets an attribute value in a span with a specific id.
Sets attributes in a span with specific id.
Starts a new span. Returns context of newly created span. First argument is span id. Span id is used to identify span and must be unique within one process.
Options:
parent_span
- a span_ctx of a span, that will be the parent of the created spanparent_id
- an id of a span, that will be the parent of the created span. Shouldn't be used withparent_span
option. Available only for spans, that were created or stored in the same process in which we call this macro.name
- name of a span. If not provided, by default span name will be span id