AgentObs.Supervisor (agent_obs v0.1.6)

View Source

Supervisor for AgentObs handler processes.

Starts and supervises configured handler GenServers based on application configuration. Uses a :one_for_one strategy to ensure that if a handler crashes, it is restarted without affecting other handlers.

Configuration

Handlers are configured in application config:

config :agent_obs,
  handlers: [AgentObs.Handlers.Phoenix, AgentObs.Handlers.Generic]

config :agent_obs, AgentObs.Handlers.Phoenix,
  endpoint: "http://localhost:6006/v1/traces"

Each handler module in the :handlers list will be started as a child process, with its configuration read from the application environment.

Summary

Functions

Returns a specification to start this module under a supervisor.

Retrieves configuration for a specific handler module.

Starts the AgentObs supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_handler_config(handler_module)

@spec get_handler_config(module()) :: map()

Retrieves configuration for a specific handler module.

Reads from application environment under the handler's module name, and adds common configuration like event_prefix.

start_link(opts)

@spec start_link(keyword()) :: Supervisor.on_start()

Starts the AgentObs supervisor.

Called by AgentObs.Application during startup.