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

recording rules not work #74

Closed
hashwing opened this issue Sep 14, 2018 · 7 comments
Closed

recording rules not work #74

hashwing opened this issue Sep 14, 2018 · 7 comments
Labels

Comments

@hashwing
Copy link

set a recording rule:

groups
- name: example
    rules:
      - record: query_qps
        expr: irate(http_requests_total{handler="query"}[5m])

query irate(http_requests_total{handler="query"}[5m]) , can find data.

query query_qps , result no data.

@mariobede
Copy link

mariobede commented Sep 14, 2018

My lack of knowledge might not be identifying this issue properly but.. are you following config example file?

https://github.com/jacksontj/promxy/blob/master/cmd/promxy/config.yaml#L11

@hashwing
Copy link
Author

@marioanton Yes, I add it. I can find rule details in web ui. but query 'query_qps', result no data

@mariobede
Copy link

mariobede commented Sep 14, 2018

isn't that looking for rule files created on prom?

Rule files specifies a list of globs. Rules and alerts are read from all matching files.

Sorry, might be confusing this a bit more.

@hashwing
Copy link
Author

hashwing commented Sep 14, 2018

I want to know , recording rules config on promxy or prometheus? When I config on promxy, look for rules on promxy web ui, but it can't query in promxy. However, When I config rule on prometheus, it can query in promxy.

@jacksontj
Copy link
Owner

Thanks for opening an issue! Promxy does load the config for recording rules, and it even actually executes them, but it has no place to store them. Promxy used to actually log the values with a warning saying they aren't stored, but it looks like in the prom 2.x upgrade that was lost. Basically for this to work promxy needs to implement the Appender interface here. Unfortunately prometheus doesn't expose a remote_write endpoint or other API for external services to append points into it.

So, in case you got lost in the wall of text (apologies if its too much detail)-- promxy executes the rules but has no place to put the metrics (prom doesn't have an API to append points into). If its helpful I can implement an option to push that to a remote_write endpoint, but prom doesn't have that-- so you'd need something else to store that. Alternatively, if thats not useful I'll just add back in the warning logs etc. about this behavior.

@jacksontj jacksontj added the bug label Sep 17, 2018
jacksontj added a commit that referenced this issue Sep 25, 2018
Promxy doesn't currently support storing recording rules, because
prometheus has no remote write API -- meaning promxy has no place to put
the metrics. This used to log (before the 2.x upgrade)-- but that was
dropped and this is confusing again.

This patch adds 2 layers of logging. (1) in main it checks for recording
rules on start (where it will fatal log) and on reload (error log) (2)
the ProxyStorage.Appender() now also logs a warning. This will remain in
place until #79 (the long term plan) is figured out and executed

Fixes #74
@jacksontj
Copy link
Owner

I've pushed in #80 which adds more explicit logging on start/reload about the recordingrule behavior (which should avoid confusion in the fugure). I have also opened up #79 for discussion in the future about what to do about recording rules-- if you have input please let me know :) .

jacksontj added a commit that referenced this issue Sep 25, 2018
Promxy doesn't currently support storing recording rules, because
prometheus has no remote write API -- meaning promxy has no place to put
the metrics. This used to log (before the 2.x upgrade)-- but that was
dropped and this is confusing again.

This patch adds 2 layers of logging. (1) in main it checks for recording
rules on start (where it will fatal log) and on reload (error log) (2)
the ProxyStorage.Appender() now also logs a warning. This will remain in
place until #79 (the long term plan) is figured out and executed

Fixes #74
@jacksontj
Copy link
Owner

As an update here, #90 was merged in which adds support for recording rules through the use of remote_write endpoints.

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

No branches or pull requests

3 participants