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

Fix a bug with metric queries and label_format. #3263

Merged
merged 2 commits into from
Feb 1, 2021

Conversation

cyriltovena
Copy link
Contributor

In my previous PR where I introduced hints, I forgot to implement label format label required.
This would cause label format label to be skipped during parsing.

I've also took the opportunity to improve the code.

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

In my previous PR where I introduced hints, I forgot to implement label format label required.
This would cause label format label to be skipped during parsing.

I've also took the opportunity to improve the code.

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

Codecov Report

Merging #3263 (2afddae) into master (51952da) will increase coverage by 0.08%.
The diff coverage is 67.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3263      +/-   ##
==========================================
+ Coverage   63.20%   63.28%   +0.08%     
==========================================
  Files         199      199              
  Lines       16875    16893      +18     
==========================================
+ Hits        10665    10691      +26     
+ Misses       5245     5233      -12     
- Partials      965      969       +4     
Impacted Files Coverage Δ
pkg/logql/log/parser.go 75.00% <22.22%> (-1.20%) ⬇️
pkg/logql/log/metrics_extraction.go 82.60% <77.27%> (-1.61%) ⬇️
pkg/logql/log/fmt.go 91.85% <100.00%> (+1.77%) ⬆️
pkg/logql/log/labels.go 91.17% <100.00%> (ø)
pkg/promtail/positions/positions.go 58.51% <0.00%> (+11.70%) ⬆️

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.

LGTM

@cyriltovena
Copy link
Contributor Author

LGTM

Made some mistake will add more tests in the logql package to ensure this optimization is not breaking anything it's the second time and I think it's because I don't have a good test story.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@cyriltovena cyriltovena merged commit e8cce09 into grafana:master Feb 1, 2021
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Jun 11, 2021
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
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.

4 participants