Bridges Telemetry.Metrics definitions into OpenTelemetry metrics.
The public API stays intentionally small:
- callers define metric spec modules implementing
OtelBridge.Spec - callers optionally attach observer children for gauge-like metrics
- backend policy is selected via
OtelBridge.Profilemodules
Typical usage
children = [
{OtelBridge,
specs: [MyApp.Metrics],
measurements: [{MyApp.Measurements, :dispatch, []}],
meta: [service: "my_app"]}
]
Summary
Functions
Returns a standard supervisor child spec for OtelBridge.
Builds a metric reader config from a named or module-based backend profile.
Filters a list of Telemetry.Metrics definitions down to the metric shapes
handled by the bridge runtime.
Starts the OtelBridge supervision tree.
Types
@type option() :: {:metrics, [Telemetry.Metrics.t()]} | {:specs, [module()]} | {:optional_specs, [module()]} | {:measurements, [module() | {module(), atom(), [term()]}]} | {:meta, keyword()} | {:poller, keyword()} | {:observer_children, [Supervisor.child_spec()]}
Functions
@spec child_spec([option()]) :: Supervisor.child_spec()
Returns a standard supervisor child spec for OtelBridge.
@spec metric_reader!( OtelBridge.Profile.profile_ref(), keyword() ) :: map()
Builds a metric reader config from a named or module-based backend profile.
@spec prepare_metrics([Telemetry.Metrics.t()]) :: [Telemetry.Metrics.t()]
Filters a list of Telemetry.Metrics definitions down to the metric shapes
handled by the bridge runtime.
@spec start_link([option()]) :: Supervisor.on_start()
Starts the OtelBridge supervision tree.
This is the main entrypoint most applications should use.