New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): job metrics #8255
Conversation
Deploying immich with Cloudflare Pages
|
addToCounter(name: string, value: number, options?: CustomMetricOptions): void; | ||
updateGauge(name: string, value: number, options?: CustomMetricOptions): void; | ||
updateHistogram(name: string, value: number, options?: CustomMetricOptions): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requiring passing in whether metrics is enabled or not send like an odd choice. Also making it optional send really weird because it doesn't do anything otherwise. Can you just move that logic globally to the repo instead? If anything add a method to enable or disable metrics, instead of requiring it in every call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is because there are different kinds of metrics and it can be that only some are enabled. The enabled
flag is just for ergonomics to avoid repeating if (jobMetrics)
, etc.
I could change it to accept the metric group and have the repo own the decision to track the metric based on the group that's passed. How does that sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it being enabled a static property set once via an environment variable? Why would you need to pass it into the repo over and over? Id be fine with using it directly in the repository instead of requiring it to be passed in every method.
Description
This PR adds observability for jobs and queues. Specifically, it tracks job successes, skips and failures as well as the current number of active jobs in each queue. This is implemented in the job service through a new metric repository.
How Has This Been Tested?
Tested that the active jobs in the queue show up in Prometheus and respond to changes in concurrency.