Skip to content
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

Feature Request: Expose Prometheus-Compatible Metrics Endpoint #3

Open
42m4n opened this issue Apr 19, 2024 · 1 comment
Open

Feature Request: Expose Prometheus-Compatible Metrics Endpoint #3

42m4n opened this issue Apr 19, 2024 · 1 comment

Comments

@42m4n
Copy link

42m4n commented Apr 19, 2024

Feature Request

Summary:
It would be highly beneficial for go-cron to include functionality to expose metrics in a format that Prometheus can scrape. This would allow users to monitor the performance and health of go-cron jobs within their Prometheus monitoring ecosystem.

Detail:
Currently, go-cron opens an HTTP port that can be used as a health check, as described in the README and implemented in gocron/httpserver.go. Building on this, I propose adding a new endpoint, /metrics, that serves metrics in a Prometheus-compatible format. This would involve metrics such as job execution times, success/failure counts, and other relevant runtime metrics.

Suggested Implementation:

  • Extend the HTTP server functionality in gocron/httpserver.go to include a /metrics endpoint.
  • Implement a metrics collection system within go-cron that tracks relevant metrics during job execution.
  • Format the collected metrics using Prometheus exposition formats, making them available via the /metrics endpoint.

Benefits:

  • This feature would enable users to integrate go-cron monitoring with their existing Prometheus setups, providing a unified view of system health and performance.
  • It would also allow for alerting on specific conditions related to go-cron jobs, enhancing the ability to respond to issues promptly.

Considerations:

  • Care should be taken to ensure that the metrics collection and exposition have minimal impact on the performance of go-cron.
  • It would be useful to make the metrics feature configurable, allowing users to enable or disable it as per their requirements.

Thank you for considering this feature request. I believe it would significantly enhance the utility and observability of go-cron in production environments.

@michaloo
Copy link
Owner

Thanks for the suggestion @42m4n! Happy to extend the project to include that feature. I will keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants