Barograph.Ingest.Supervisor (barograph v0.2.1)

Copy Markdown View Source

Supervises configured ingest listeners for one open database (spec §10).

Started as an opt-in child of Barograph.Database via the :ingest option to Barograph.open/2 — a documented deviation from spec §4.1's top-level diagram (see the v0.2 progress report): every other option in this library flows through open/2, and tying a listener's lifecycle to one already-open database means Barograph.close/1 tears it down along with everything else.

:graphite options

ingest: [graphite: [...]]:

  • :port - TCP port to listen on. Defaults to 2003 (carbon's conventional plaintext port).
  • :template - dotted template string for splitting a path into metric + labels; nil (default) uses the whole path as the metric with no labels. See Barograph.Ingest.Graphite.Parser.compile_template/1.
  • :max_line_length - bytes; connections sending a longer line are closed. Defaults to 8192.
  • :transport_options - passed through to ThousandIsland's TCP transport, e.g. ip: :loopback to bind only the loopback interface instead of the default 0.0.0.0. Defaults to [] (all interfaces).

The Graphite plaintext protocol has no authentication and no transport security — anyone who can reach the port can write arbitrary samples, and each previously-unseen {metric, labels} pair creates a new series with no cardinality limit (same as the native write/4,5 API, just reachable over the network without going through application code). For anything beyond local development, bind transport_options: [ip: :loopback] and put a real interface behind a firewall or private network, or front it with a proxy that adds authentication.

Summary

Functions

Returns a specification to start this module under a supervisor.

Registry name for a protocol's listener under a database, for ThousandIsland.listener_info/1.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

listener_name(protocol, arg)

@spec listener_name(atom(), Barograph.db()) :: GenServer.name()

Registry name for a protocol's listener under a database, for ThousandIsland.listener_info/1.

start_link(opts)

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