Insider.Collector.Telemetry.Policy (Insider v0.1.0)

Copy Markdown View Source

Validated pure-data allowlist for Telemetry collection.

Source keys are existing atoms supplied by application configuration. Output names are bounded strings, so handling an event never creates atoms.

Summary

Types

event_rule()

@type event_rule() :: %{
  name: [atom()],
  kind: String.t(),
  phase: atom(),
  lifecycle: String.t(),
  failure_event: boolean()
}

t()

@type t() :: %Insider.Collector.Telemetry.Policy{
  correlation: %{optional(atom()) => atom()},
  event_names: [[atom()]],
  events: %{required(tuple()) => event_rule()},
  fingerprint: String.t(),
  id: String.t(),
  max_lifecycle_age_events: pos_integer(),
  max_open_lifecycles: pos_integer(),
  measurements: %{optional(atom()) => String.t()},
  metadata: %{optional(atom()) => String.t()}
}

Functions

new(options)

@spec new(keyword()) :: {:ok, t()} | {:error, :invalid_policy}

valid?(policy)

@spec valid?(term()) :: boolean()