d-Rickyy-b / certstream-server-go

This project aims to be a drop-in replacement for the certstream server by Calidog. This tool aggregates, parses, and streams certificate data from multiple certificate transparency logs via websocket connections to the clients.
MIT License
88 stars 8 forks source link

Add metric for skipped certs per client #34

Closed goliel closed 7 months ago

goliel commented 7 months ago

Hi, We have migrated our certstream server from calidog's to this one and have been enjoying the added logs and metrics. We had an issue with our consumer being too slow and certs being skipped, we have since fixed this issue but we would like to monitor it.

Right now we only monitor at the log level, Adding metric for the skipped amount would help us follow this issue better.

d-Rickyy-b commented 7 months ago

Since I totally missed commenting on that one: I really liked the idea so I implemented it yesterday and released v1.6.0. Thanks for your suggestion. Please tell me if the implementation works for you or if I missed something.

The name of the client is the IP:Port and it's used as a label for the certstreamservergo_skipped_certs metric. As soon as a client disconnects, the client's metric will be removed. Using the IP:Port as client also means that as soon as a client reconnects, it gets a different label.