cognos-io / chat.cognos.io

0 stars 0 forks source link

Expose business metrics to prometheus #98

Closed kisamoto closed 3 weeks ago

kisamoto commented 3 weeks ago

This PR exposes some prometheus metrics on the /metrics endpoint. The metrics endpoint is only available to localhost so Grafana Alloy can scrape it and push to the cloud.

It also enables the Go prometheus client so we can monitor the Go app metrics.

Additional things that needed doing:

# HELP cognos_chat_agents Number of agents in the system
# TYPE cognos_chat_agents gauge
cognos_chat_agents 0
# HELP cognos_chat_conversations Number of conversations in the system
# TYPE cognos_chat_conversations gauge
cognos_chat_conversations 1
# HELP cognos_chat_messages Number of messages in the system
# TYPE cognos_chat_messages gauge
cognos_chat_messages 2
# HELP cognos_chat_users Number of users in the system
# TYPE cognos_chat_users gauge
cognos_chat_users 1