Arcadic.Telemetry (Arcadic v0.1.0)

Copy Markdown View Source

Value-free :telemetry.span/3 wrapper. Owns the metadata allowlist — the single enforcement point for "no statement text, no params, no values, and NO database name" (the DB name is the tenant/mode selector upstream; tenant-blind includes telemetry). An off-allowlist key raises rather than shipping identity downstream. Mirrors ash_age's R7 allowlist pattern.

Summary

Functions

The permitted span metadata keys.

Emit a manual :telemetry.execute/3 event with allowlist-validated metadata, for lazy operations (streaming) whose lifetime does not fit span/3's synchronous callback. Off-allowlist metadata keys raise (no statement/params/values/db name).

Runs fun inside :telemetry.span([:arcadic, op], …). fun returns {result, stop_meta}; every start/stop metadata key MUST be in the allowlist or an ArgumentError is raised.

Functions

allowed_meta_keys()

@spec allowed_meta_keys() :: [atom()]

The permitted span metadata keys.

event(name, measurements, meta)

@spec event([atom(), ...], map(), map()) :: :ok

Emit a manual :telemetry.execute/3 event with allowlist-validated metadata, for lazy operations (streaming) whose lifetime does not fit span/3's synchronous callback. Off-allowlist metadata keys raise (no statement/params/values/db name).

span(op, start_meta, fun)

@spec span(atom(), map(), (-> {term(), map()})) :: term()

Runs fun inside :telemetry.span([:arcadic, op], …). fun returns {result, stop_meta}; every start/stop metadata key MUST be in the allowlist or an ArgumentError is raised.