Add rule information to query paramters sent to the QFE
When the -ruler.frontend-address is configured, the Ruler evaluates rules via QFE. But, all of the values of the query stats logs and metrics in the Ruler are 0 because the QFE doesn't send query stat.
In Ruler, for example: the query stats logs are:
cortex_ruler_query_seconds_total=0.003627083 query_wall_time_seconds=0s query_storage_wall_time_seconds=0s fetched_series_count=0 fetched_chunks_count=0 fetched_samples_count=0 fetched_chunks_bytes=0 fetched_data_bytes=0
Also, the values of these metrics are all 0
cortex_ruler_fetched_series_total, cortex_ruler_samples_total, cortex_ruler_fetched_chunks_bytes_total ...
To address it, this PR adds rule information to query parameters sent to the QFE to leave rule information logs on query stats.
For the metric, #6470 add the source label to categorize query stat metric.
Which issue(s) this PR fixes:
Fixes #
Checklist
- [ ] Tests updated
- [ ] Documentation added
- [x]
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]
Maybe we can return the stats at least on the proto response?
@alanprot Yeah, we could return query stats in the protobuf from QFE to Ruler. But Idk if it is worth it more. We can leave query stats logs by adding query parameters at the Ruler. (https://github.com/cortexproject/cortex/blob/master/pkg/frontend/transport/handler.go#L514)
But the rulers logs would still be "empty" right? so should we at least stop logging it?
But the rulers logs would still be "empty" right? so should we at least stop logging it?
Yeah, the evaluation logs are still empty. Stopping the logging at the Ruler is fine for me. @yeya24 WDYT?
@yeya24
I changed the behavior, the Ruler tracks metrics and logs only if -ruler.frontend-address is not configured. When -ruler.frontend-address flag is set, the QFE tracks logs and metrics.
This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.