OtelBridge.Bridge (otel_bridge v0.2.0)

Copy Markdown View Source

Runtime process that records telemetry events as OpenTelemetry metrics.

Most applications should use OtelBridge instead of starting this module directly.

This module:

  1. receives prepared Telemetry.Metrics definitions
  2. creates matching OpenTelemetry instruments
  3. attaches telemetry handlers for each event name
  4. records incoming measurements into those instruments

Telemetry.Metrics.LastValue is mapped to an observable gauge. Telemetry events update an internal ETS-backed latest-value store, and the OpenTelemetry reader observes the current values during collection.

Last-value storage can be bounded with reporter_options[:otel][:last_value]:

  • :ttl_ms - stale series age in milliseconds, or :infinity
  • :max_series - maximum retained tag combinations per metric, or :infinity
  • :on_overflow - :drop_new or :drop_oldest

Summary

Functions

Returns a specification to start this module under a supervisor.

Telemetry event handler that records measurements into OpenTelemetry instruments.

Starts the bridge process for a set of metric definitions.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

handle_event(event_name, measurements, metadata, map)

Telemetry event handler that records measurements into OpenTelemetry instruments.

For each configured metric, the handler:

  • checks whether the metric should be kept for the current metadata
  • extracts the measurement value
  • derives the exported tags
  • records the value into the created instrument

observe_last_value(arg)

observe_last_value(table, name)

start_link(opts)

Starts the bridge process for a set of metric definitions.