Skip to content

Feature: Any way to increment/decrement with a delay (after syntax) #884

Answered by jaqx0r
narcoticfresh asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the kind words!

There's no way to add a delay. mtail is designed to give immediate feedback to the monitoring system that collects its metrics.

I would think about trying to do this with the monitoring collector. You can export the last seen time for each user in a histogram type:

histogram user_last_seen by user

/User is\: (?P<user>\w*),/ {
  user_last_seen[$user] = timestamp()
}

and then with your monitoring system count users who have been seen in the last hour, maybe something like:

count(user_last_seen[1h]) by user

(some sort of pseudo-Prometheus expression here)

I think the changes() function in Prometheus would do what you want: https://prometheus.io/docs/prometheus/l…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jaqx0r
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #762 on June 24, 2024 12:05.