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

Create a Prometheus metric that captures time when a service crashed #1862

Closed
CannonLock opened this issue Jan 3, 2025 · 1 comment · Fixed by #2015
Closed

Create a Prometheus metric that captures time when a service crashed #1862

CannonLock opened this issue Jan 3, 2025 · 1 comment · Fixed by #2015
Assignees
Labels
enhancement New feature or request monitoring
Milestone

Comments

@CannonLock
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Over the break there was a issue where Pelican services were crashing and restarting themselves causing resulting in issues that did not leave a trace.

Describe the solution you'd like
A clear and concise description of what you want to happen.

In the sql lite db include a internal counter. Every time that pelican crashes increment this counter and publish this metric on prometheus.

@CannonLock CannonLock added the enhancement New feature or request label Jan 3, 2025
@jhiemstrawisc jhiemstrawisc added this to the v7.14 milestone Jan 9, 2025
@bbockelm
Copy link
Collaborator

Off-ticket, @patrickbrophy asked:

Should this be for each service or just the director?

Here, we're looking specifically for XRootD crashes -- so we'll be recording the information whenever the cache or origin component is enabled.

[Are we] tracking if XRootD crashes or the entire pelican process?

Just XRootD. Specifically, we probably want to record this information here, when pelican handles the death of an XRootD process by signal.

Additional thoughts:

  • This should be in a generic "counters" table (feel free to tinker with the name, that one is a bit blah) that is string key / double value. (I think you need to have the value be in the billions before floating point precision loss means x + 1 == x). The key should be primary, unique, and indexed.
  • Since this is for caches and origins -- and a single service could be both -- we're probably talking two keys.
  • We don't need to blindly auto-publish all rows in the table to prometheus; rather, we can assume only known keys are published (so we can iterate through a list of keys set at compile time -- for this PR, there will be a single one).
  • It may make sense to record "time of last crash" (unix timestamp) than a counter. Looking at the Prometheus documentation, the changes() function will allow prometheus to determine the number of crashes within a certain time period. Recording "time of last crash" avoids floating point precision issues to boot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request monitoring
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants