aeat.core.telemetry._producers module¶
Non-sensitive operational telemetry producers.
Each function here projects an already-non-sensitive local signal into an
allowlisted TelemetryEventPayload (via
build_telemetry_payload()) and hands it to
emit_telemetry_event(). Every producer is a pure
projection: it reads fields that are already accounting/timing metadata (a
command name, a duration, a success flag, a closed error-kind label) and never
reads transaction content, profile identity, or file contents.
No producer here performs a network call. When the consent gate refuses (the
default posture), emit_telemetry_event() is a pure
no-op and none of these functions have any observable side effect beyond that
no-op return value.
See also
build_telemetry_payload()Closed-schema builder each producer uses before emission.
emit_telemetry_event()Consent-gated dispatcher shared by all producers.
workspace_hash()Stable pseudonymous deployment identifier carried by producer payloads.
TELEMETRY_METRIC_REGISTRYMetric allowlist that declares which counters and timings may be remote.
- emit_command_invocation_telemetry(*, workspace_hash, succeeded, duration_ms, captured_at, settings, acknowledged, sink=None)[source]¶
Emit a non-sensitive CLI command-completion event.
Carries only an invocation count, a succeeded/failed split, and a wall-clock duration – never the command’s arguments, output, or any operator-supplied content. Registered under the closed
"diagnostics.command_invocation"MetricSchema.- Parameters:
workspace_hash (
str) – Stable pseudonymous local-deployment identifier (seeworkspace_hash()).succeeded (
bool) – Whether the CLI invocation completed without raising.duration_ms (
int) – Wall-clock invocation duration in milliseconds.captured_at (
str) – ISO-8601 UTC capture timestamp.settings (
Settings) – Resolved deployment settings carrying the telemetry consent posture.acknowledged (
bool) – Whether the operator acknowledged remote telemetry for this specific invocation. Never sticky.sink (
TelemetrySink|None) – Destination sink; defaults toLocalNoopTelemetrySink.
- Return type:
- Returns:
Truewhen the event was handed to the sink;Falsewhen the consent gate refused and emission was a no-op.
- emit_llm_run_telemetry(*, workspace_hash, succeeded, duration_ms, captured_at, settings, acknowledged, sink=None)[source]¶
Emit a non-sensitive local-LLM-run-completion event.
Projects the same accounting fields
LLMRunRecordalready carries locally (run count, succeeded/failed split, duration) into the remote-eligible allowlist – never the run’s prompt text, response text, or provider payload. Registered under the closed"diagnostics.llm_run"MetricSchema.- Parameters:
workspace_hash (
str) – Stable pseudonymous local-deployment identifier.succeeded (
bool) – Whether the LLM run completed without raising.duration_ms (
int) – Wall-clock run duration in milliseconds.captured_at (
str) – ISO-8601 UTC capture timestamp.settings (
Settings) – Resolved deployment settings carrying the telemetry consent posture.acknowledged (
bool) – Whether the operator acknowledged remote telemetry for this specific invocation. Never sticky.sink (
TelemetrySink|None) – Destination sink; defaults toLocalNoopTelemetrySink.
- Return type:
- Returns:
Truewhen the event was handed to the sink;Falsewhen the consent gate refused and emission was a no-op.
- emit_error_frequency_telemetry(*, workspace_hash, error_kind, captured_at, settings, acknowledged, sink=None)[source]¶
Emit a single non-sensitive error-kind occurrence.
error_kindMUST be a short closed label (an exception class name such as"LLMClassifierError", mirroringerror_kind) – never raw exception text, a stack trace, or any operator-controlled string. Registered under the closed"diagnostics.error_frequency"MetricSchema.- Parameters:
workspace_hash (
str) – Stable pseudonymous local-deployment identifier.error_kind (
str) – Closed short error-kind label for this occurrence.captured_at (
str) – ISO-8601 UTC capture timestamp.settings (
Settings) – Resolved deployment settings carrying the telemetry consent posture.acknowledged (
bool) – Whether the operator acknowledged remote telemetry for this specific invocation. Never sticky.sink (
TelemetrySink|None) – Destination sink; defaults toLocalNoopTelemetrySink.
- Return type:
- Returns:
Truewhen the event was handed to the sink;Falsewhen the consent gate refused and emission was a no-op.