OtelBridge.Profile behaviour (otel_bridge v0.1.1)

Copy Markdown View Source

Behaviour and helpers for backend-specific metric export profiles.

A profile turns high-level backend intent into a metric reader configuration suitable for :opentelemetry_experimental.

Example

config :opentelemetry_experimental,
  readers: [
    OtelBridge.metric_reader!(:victoria_metrics,
      export_interval_ms: 5_000,
      endpoint: "http://localhost:4318"
    )
  ]

Summary

Callbacks

Builds a metric reader configuration for a backend profile.

Functions

Resolves a profile name or module and returns its metric reader config.

Resolves a profile alias to its implementing module.

Types

profile_name()

@type profile_name() :: :victoria_metrics

profile_ref()

@type profile_ref() :: profile_name() | module()

Callbacks

metric_reader(keyword)

@callback metric_reader(keyword()) :: map()

Builds a metric reader configuration for a backend profile.

Functions

metric_reader!(profile, opts)

@spec metric_reader!(
  profile_ref(),
  keyword()
) :: map()

Resolves a profile name or module and returns its metric reader config.

resolve!(module)

@spec resolve!(profile_ref()) :: module()

Resolves a profile alias to its implementing module.