EventMetadata#
- pydantic model safir.metrics.EventMetadata#
Common fields for all metrics events.
Contains the minimum required fields. This gets mixed in to a class also containing event payload fields, and then gets shipped to Kafka, by the
EventManager
- Parameters:
data (
Any
)- Fields:
-
field id:
Annotated
[UUID
] [Required]# A globally unique value that identifies this event
- Constraints:
uuid_version = 4
-
field timestamp:
AwareDatetime
[Required]# The time at which this event occurred, or the time at which this event completed if it is a duration event.
-
field timestamp_ns:
int
[Required]# The number of nanoseconds since the unix epoch. This is used as the InfluxDB timestamp.
- asdict()#
Returns this model in dictionary form. This method differs from pydantic’s dict by converting all values to their Avro representation. It also doesn’t provide the exclude, include, by_alias, etc. parameters that dict provides.
- classmethod fake(**data)#
Creates a fake instance of the model.
- Attributes:
data: Dict[str, Any] represent the user values to use in the instance
- Parameters:
data (
Any
)- Return type:
AvroBaseModel
- serialize(serialization_type='avro')#
Overrides the base AvroModel’s serialize method to inject this class’s standardization factory method