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] - Add Metrics For Jobs #317

Closed
vaxilicaihouxian opened this issue Mar 24, 2022 · 7 comments · Fixed by #659
Closed

[FEATURE] - Add Metrics For Jobs #317

vaxilicaihouxian opened this issue Mar 24, 2022 · 7 comments · Fixed by #659
Labels
enhancement New feature or request

Comments

@vaxilicaihouxian
Copy link

We can add prometheus metrics for job execution.Then outside monitor system can use these metrics to track jobs.
Maybe I can send a pr.

@vaxilicaihouxian vaxilicaihouxian added the enhancement New feature or request label Mar 24, 2022
@JohnRoesler
Copy link
Contributor

I think having optionally enabled prometheus metrics could be a nice a feature to add.

@vaxilicaihouxian
Copy link
Author

metrics collector (counter,summary...)should always track job's state.
metrics exporter could be a function like gocron.MetricsServe(ListenPort,Path)

@JohnRoesler
Copy link
Contributor

Yeah. It'd be nice to make the metrics an interface so we can implement with prometheus now and then later it could be implemented with influx and others.

@JohnRoesler JohnRoesler mentioned this issue Apr 21, 2023
2 tasks
@JohnRoesler
Copy link
Contributor

Please weigh in if you have input on what sort of metrics you'd like to see from gocron -> #417 (comment)

@JohnRoesler
Copy link
Contributor

@git-hulk
Copy link

Agreed that we may use OTEL to export the inner tracing data since gocron is a library instead of a service. For the metrics like the Prometheus, should be exported by the user service itself, and you can request gocron to export the way to get the metric's value you want, like the number of scheduling jobs, and so on.

@JohnRoesler
Copy link
Contributor

If anyone is looking to work on implementing this, what I'd like to see is:

  • An interface for the metrics provider defined in gocron
    • This keeps the dependency for metrics out of gocron and only add the dependency if the user imports the specific metrics implementation gocron repo (same pattern that is used for the distributed locker)
    • This should have some reasonable methods for incrementing metrics like counters with labels
  • A separate repository for each provider implementation
    • I would think either OTEL or Prometheus directly first
    • OTEL enables a broad scope of metrics providers and so it may be enough to implement only OTEL

@JohnRoesler JohnRoesler changed the title [FEATURE] - Add Prometheus Metrics For Job [FEATURE] - Add Metrics For Jobs Jul 13, 2023
@JohnRoesler JohnRoesler added the v1 label Oct 28, 2023
@JohnRoesler JohnRoesler added v2 and removed v1 labels Dec 21, 2023
This was referenced Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants