fraudtwin.observability#
Optional run metrics and observability sessions.
Status: Optional
Classes#
|
Expose the stable M27 metric surface for one CLI invocation. |
Exceptions#
|
Raised when metrics are requested without the optional dependency. |
Detailed API#
Optional Prometheus metrics for short-lived FraudTwin CLI jobs.
Metrics are deliberately kept outside generated manifests and configuration hashes. The CLI starts an isolated registry only when explicitly requested, publishes run-level values, and holds the endpoint briefly so a local Prometheus instance can scrape the completed batch job.
- class fraudtwin.observability.MetricsSession(host, port, hold_seconds=15.0)[source][source]
Bases:
objectExpose the stable M27 metric surface for one CLI invocation.
- Parameters:
host (str)
port (int)
hold_seconds (float)
- observe_manifest(manifest, elapsed_seconds)[source][source]
Publish final generation metrics from the immutable run manifest.
- Return type:
None- Parameters:
manifest (RunManifest)
elapsed_seconds (float)
- record_generator_error()[source][source]
Count a failed generation invocation without hiding its exception.
- Return type:
None