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 absent_over_time #3053

Merged
merged 3 commits into from
Dec 8, 2020
Merged

Add absent_over_time #3053

merged 3 commits into from
Dec 8, 2020

Conversation

cyriltovena
Copy link
Contributor

This adds absent_over_time which is super useful when alerting, it can be combine with any logql selector including parsers and filter to returns a timeseries with 1 when logs go missing.

I did not add the absent function because I don't think it make sense for Loki, since it's only useful when you only have vector, we always have a range vector expressions at the root of the expr.

Fixes #2893

This adds absent_over_time which is super useful when alerting, it can be combine with any logql selector including parsers and filter to returns a timeseries with 1  when logs go missing.

Fixes grafana#2893

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nits but LGTM

pkg/logql/evaluator.go Show resolved Hide resolved
pkg/logql/evaluator.go Show resolved Hide resolved
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #3053 (8770fb0) into master (3f0800d) will increase coverage by 0.06%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3053      +/-   ##
==========================================
+ Coverage   62.82%   62.88%   +0.06%     
==========================================
  Files         186      186              
  Lines       15906    15949      +43     
==========================================
+ Hits         9993    10030      +37     
+ Misses       4991     4987       -4     
- Partials      922      932      +10     
Impacted Files Coverage Δ
pkg/logql/lex.go 90.90% <ø> (ø)
pkg/logql/evaluator.go 89.87% <74.46%> (-1.91%) ⬇️
pkg/logql/ast.go 86.48% <100.00%> (ø)
pkg/logql/functions.go 29.68% <100.00%> (+1.68%) ⬆️
pkg/querier/queryrange/limits.go 91.66% <0.00%> (-4.17%) ⬇️
pkg/promtail/targets/file/filetarget.go 64.33% <0.00%> (-2.10%) ⬇️
pkg/querier/queryrange/downstreamer.go 97.64% <0.00%> (+2.35%) ⬆️
pkg/promtail/positions/positions.go 58.51% <0.00%> (+11.70%) ⬆️

@cyriltovena cyriltovena merged commit 6d85c7c into grafana:master Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

absent_over_time and absent
3 participants