Agent configuration.
Library-specific settings are nested under config :mirego_elixir_otel_agent, ....
The official :opentelemetry and :opentelemetry_exporter applications are
configured directly by the host app, just as if this library were not present.
The metric exporter reads OTLP settings from the official
:opentelemetry_exporter application env (or from standard env vars) and
passes them directly to this library's internal metric exporter at startup.
Example
# Official OTEL configuration — lives in the official OTP apps
config :opentelemetry,
resource: [
{"service.name", "my-app"},
{"service.version", "1.0.0"}
],
traces_exporter: :otlp,
span_processor: :batch
config :opentelemetry_exporter,
otlp_protocol: :http_protobuf,
otlp_endpoint: System.fetch_env!("OTEL_EXPORTER_OTLP_ENDPOINT")
# This library's configuration
config :mirego_elixir_otel_agent,
enabled: true,
metric_export_period: 30_000,
phoenix_adapter: :banditOptions
:enabled(boolean) — when nottrue,start_link/1returns:ignore. Default:false.:metric_export_period(pos_integer) — metrics export interval in ms. Default:30_000.:phoenix_adapter(:bandit|:cowboy2) — adapter passed toOpentelemetryPhoenix.setup/1when auto-instrumenting Phoenix. Default::bandit.:metric_exporter(keyword) — optional internal metric-exporter settings, such as:resource,:otlp_headers, and:otlp_timeout.
Summary
Functions
Whether the agent should run.
Metrics export interval in ms (default 30000).
Phoenix adapter used for auto-instrumentation (default bandit).
Resolve agent config from application env.
Types
@type t() :: %{ enabled: boolean(), metric_export_period: pos_integer(), phoenix_adapter: :bandit | :cowboy2 }
Functions
@spec enabled?() :: boolean()
Whether the agent should run.
@spec metric_export_period() :: pos_integer()
Metrics export interval in ms (default 30000).
@spec phoenix_adapter() :: :bandit | :cowboy2
Phoenix adapter used for auto-instrumentation (default bandit).
@spec resolve() :: t()
Resolve agent config from application env.