Metrics: use broker to collect metrics and expose failed status#161
Metrics: use broker to collect metrics and expose failed status#161elisaado wants to merge 13 commits into
Conversation
nlewo
left a comment
There was a problem hiding this comment.
It looks like deploymentInfo and buildInfo metrics are no longer updated. Could you ensure there is no breaking changes regarding existing metrics?
I'm wondering why do you find this ugly? |
… status of stages
|
(rebased main) |
Oops. Will fix.
I like defining separate functions for the goroutine and then |
|
Regarding the When comin is updated & restarts it will get set from cmd.go again. We could centralize everything related to metrics in the prometheus broker event handler, but then an event for "comin started" would need to be added (or does it already exist?) |
That's a fair point and I would have preferred to do it like this ;) I will keep this in mind for the future.
Thank you for the remark. Could be addressed in a followup PR (now tracked by #165).
In the context of the current PR, this is good enough. But I agree it would be nice to publish on event once comin is initialized. Currently, for the watch command, i send a |
|
Actually, the buildInfo metric doesn't need to be updated since it describes the version of comin ;) |
|
re: the failing pipeline: the function boolToString was already there, it's now unused but may be nice to have in the future, should I remove it for now? |
This PR removes metrics from the manager and creates a broker subscriber that listens to incoming messages on the channel and exposes metrics from them. Furthermore, it exposes 4 new metrics:
last_fetch_failed,last_eval_failed,last_build_failed, andlast_deployment_failedwhich allows for alerting when any of those stages fail.This was coded late at night so it may contain some dumb mistakes
Design decisions:
go (func())()which I find kinda ugly but is used across the codebase (e.g. in server/server.go)