stormlog.telemetry_model
Backend-neutral projection over the persisted telemetry event schema.
Functions
|
Project a normalized telemetry mapping into the projected envelope. |
|
Serialize a projected telemetry record to a deterministic dictionary. |
|
Return stable unique correlation dictionaries for projected telemetry records. |
|
Return stable unique resource dictionaries for projected telemetry records. |
Classes
|
Small immutable event envelope shared by live and loaded telemetry. |
- class stormlog.telemetry_model.ProjectedTelemetryRecord(schema_version, record_id, timestamp_ns, observed_timestamp_ns, session_id, source_kind, event_type, stage, severity, severity_text, body, resource=<factory>, attributes=<factory>, correlation=<factory>)[source]
Bases:
objectSmall immutable event envelope shared by live and loaded telemetry.
- Parameters:
schema_version (Literal[1])
record_id (str)
timestamp_ns (int)
observed_timestamp_ns (int)
session_id (str)
source_kind (str)
event_type (str)
stage (str | None)
severity (str | None)
severity_text (str | None)
body (str | None)
resource (Mapping[str, Any])
attributes (Mapping[str, Any])
correlation (Mapping[str, Any])
- schema_version: Literal[1]
- record_id: str
- timestamp_ns: int
- observed_timestamp_ns: int
- session_id: str
- source_kind: str
- event_type: str
- stage: str | None
- severity: str | None
- severity_text: str | None
- body: str | None
- resource: Mapping[str, Any]
- attributes: Mapping[str, Any]
- correlation: Mapping[str, Any]
- stormlog.telemetry_model.project_telemetry_mapping(record, *, observed_timestamp_ns=None)[source]
Project a normalized telemetry mapping into the projected envelope.
- Parameters:
record (Mapping[str, Any]) – Existing normalized telemetry record, normally a TelemetryEvent v3 dictionary.
observed_timestamp_ns (int | None) – Optional observation timestamp. Defaults to the source timestamp when no separate observation time is available.
- Returns:
Backend-neutral projected telemetry record.
- Raises:
ValueError – If required identity or timestamp fields are missing.
- Return type:
- stormlog.telemetry_model.projected_record_to_dict(record)[source]
Serialize a projected telemetry record to a deterministic dictionary.
- Parameters:
record (ProjectedTelemetryRecord)
- Return type:
dict[str, Any]
- stormlog.telemetry_model.unique_projected_correlations(records)[source]
Return stable unique correlation dictionaries for projected telemetry records.
- Parameters:
records (Iterable[ProjectedTelemetryRecord])
- Return type:
list[dict[str, Any]]
- stormlog.telemetry_model.unique_projected_resources(records)[source]
Return stable unique resource dictionaries for projected telemetry records.
- Parameters:
records (Iterable[ProjectedTelemetryRecord])
- Return type:
list[dict[str, Any]]