Bellwether.Supervisor (bellwether v0.1.0)

Copy Markdown

Everything the Adapter needs, as one child.

Three processes and a :logger handler have to agree about a socket path and a server name. Wiring them by hand means four places to get it right and one troubleshooting entry that begins "check that the paths match", which is a design apologising for itself.

children = [
  {Bellwether.Supervisor, socket: "/tmp/bellwether.sock", own_apps: [:my_app]}
]

Options may equally live in application config, where a release can override them without a code change:

config :bellwether,
  socket: "/tmp/bellwether.sock",
  own_apps: [:my_app],
  backtrace_depth: 32

Anything passed to start_link/1 wins over config, which wins over the defaults.

Summary

Functions

Returns a specification to start this module under a supervisor.

Options, all optional

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

Options, all optional:

  • :socket - the Agent's Unix socket. Must match socket.path in the Agent's TOML, which is why mix bellwether.agent writes both.
  • :own_apps - your applications, so a Fingerprint groups on your frames rather than on whichever OTP function happened to be above them.
  • :backtrace_depth - raises the VM's eight-frame limit. See Bellwether.Crash.
  • :keep_messages_for - exceptions whose messages may travel.
  • :capture_level - the level at which a log becomes an Issue.
  • :block - Fingerprint patterns never to report.
  • :name - for running more than one, which is unusual.