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

Logging Vertical Sharding info on query stats #5037

Merged
merged 4 commits into from
Dec 13, 2022

Conversation

alanprot
Copy link
Member

@alanprot alanprot commented Dec 13, 2022

Signed-off-by: Alan Protasio approtas@amazon.com

What this PR does:
Adding the sharding info in the query stats log as following:

level=info ts=2022-12-13T02:14:56.071310895Z caller=handler.go:234 org_id=fake msg="query stats" component=query-frontend method=GET path=/prometheus/api/v1/query_range response_time=9.725277ms query_wall_time_seconds=0.035449633 fetched_series_count=6 fetched_chunks_bytes=1013 fetched_data_bytes=1436 shard_by.num_shards=10 shard_by.sharding_labels="[label quantile]" param_end=2022-12-11T02:14:54.042Z param_query="count by (label, quantile) (label_join(test_summary_seconds, \"dst_label\", \",\", \"label\", \"quantile\"))" param_start=2022-12-11T02:09:54.042Z param_stats=all param_step=30

This PR will also allow other middlewares to add info if needed like how the query was split by day or cache hit informations.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • [NA] Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@alanprot alanprot changed the title logging sharding stats Logging Vertical Sharding info on query stats Dec 13, 2022
Signed-off-by: Alan Protasio <approtas@amazon.com>
Signed-off-by: Alan Protasio <approtas@amazon.com>
pkg/querier/tripperware/shard_by.go Show resolved Hide resolved
pkg/querier/stats/stats_test.go Outdated Show resolved Hide resolved
Signed-off-by: Alan Protasio <approtas@amazon.com>
Signed-off-by: Alan Protasio <approtas@amazon.com>
@alanprot alanprot marked this pull request as ready for review December 13, 2022 18:46
Copy link
Collaborator

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

LGTM

@alanprot alanprot merged commit 78e6da8 into cortexproject:master Dec 13, 2022
alexqyle pushed a commit to alexqyle/cortex that referenced this pull request May 2, 2023
* logging sharding stats

Signed-off-by: Alan Protasio <approtas@amazon.com>

* test

Signed-off-by: Alan Protasio <approtas@amazon.com>

* improving tests

Signed-off-by: Alan Protasio <approtas@amazon.com>

* changelog

Signed-off-by: Alan Protasio <approtas@amazon.com>

Signed-off-by: Alan Protasio <approtas@amazon.com>
Signed-off-by: Alex Le <leqiyue@amazon.com>
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.

None yet

2 participants