Bases: BaseNatsMetricsSettingsProvider[list['Msg']]
Source code in faststream/nats/prometheus/provider.py
| def __init__(self) -> None:
self.messaging_system = "nats"
|
messaging_system instance-attribute
messaging_system = 'nats'
get_consume_attrs_from_message
Source code in faststream/nats/prometheus/provider.py
49
50
51
52
53
54
55
56
57
58
59 | @override
def get_consume_attrs_from_message(
self,
msg: "StreamMessage[list[Msg]]",
) -> ConsumeAttrs:
raw_message = msg.raw_message[0]
return {
"destination_name": raw_message.subject,
"message_size": len(msg.body),
"messages_count": len(msg.raw_message),
}
|
get_publish_destination_name_from_cmd
Source code in faststream/nats/prometheus/provider.py
| @override
def get_publish_destination_name_from_cmd(
self,
cmd: "PublishCommand",
) -> str:
return cmd.destination
|