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

Add minute() function #1983

Closed
mattbostock opened this Issue Sep 12, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@mattbostock
Copy link
Contributor

mattbostock commented Sep 12, 2016

What did you do?

Tried to add an alert that triggers at a specified time, e.g.:

hour() % 8 == 0 and minute() > 30 and minute() < 40

The idea is to trigger an alert at the start of each on-call shift to test the escalation path, i.e. are the on-call people's phones working, do we have the correct phone numbers, is the rota configured correctly.

What did you expect to see?

The current UTC minutes returned.

What did you see instead? Under which circumstances?

Error executing query: parse error at char 8: unknown function with name "minutes"

Environment

  • Prometheus version:

    matt➜github.com/prometheus/prometheus(master✗)» ./prometheus -version
    prometheus, version 1.1.2 (branch: master, revision: 3fd992d)
    build user: matt@matt
    build date: 20160912-17:09:55
    go version: go1.7
    matt➜github.com/prometheus/prometheus(master✗)»

@grobie

This comment has been minimized.

Copy link
Member

grobie commented Sep 12, 2016

@mattbostock Makes sense. Do you want to give this a try? It should be pretty straightforward. Here is the commit which introduced hour()/month()/etc. 4680daf

@grobie grobie changed the title Add minutes() function Add minute() function Sep 12, 2016

@mattbostock

This comment has been minimized.

Copy link
Contributor Author

mattbostock commented Sep 12, 2016

Sure, will do.

mattbostock added a commit to mattbostock/prometheus that referenced this issue Sep 12, 2016

PromQL: Add minute() function
Returns the minutes from the current time in UTC. Related to the
`hour()` function.

Fixes prometheus#1983.

@grobie grobie closed this in #1984 Sep 12, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.