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 contextual information and query statistics to log #5604

Merged
merged 1 commit into from Oct 18, 2023

Conversation

rajagopalanand
Copy link
Contributor

@rajagopalanand rajagopalanand commented Oct 17, 2023

What this PR does:

This PR adds some additional contextual information and query statistics to Ruler logs. This will be in effect only when query statistics is enabled

Checklist

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

pkg/ruler/compat.go Show resolved Hide resolved
}
ruleDetail := rules.FromOriginContext(ctx)
logMessage = append(logMessage,
"rule", ruleDetail.Name,
"query", qs,
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be huge sometimes, and it will repetitive. We can add it for now. But later if we have log problems, we can remove it.

pkg/ruler/compat.go Outdated Show resolved Hide resolved
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.

Overall this looks good. Just some small nits.

pkg/ruler/compat.go Outdated Show resolved Hide resolved
pkg/ruler/compat.go Outdated Show resolved Hide resolved
pkg/ruler/compat.go Outdated Show resolved Hide resolved
@rajagopalanand rajagopalanand force-pushed the log-ruler-query-stats branch 3 times, most recently from 72da911 to 1d370f0 Compare October 18, 2023 15:22
@yeya24 yeya24 enabled auto-merge (squash) October 18, 2023 17:27
@yeya24
Copy link
Collaborator

yeya24 commented Oct 18, 2023

Merge on green

Signed-off-by: Anand Rajagopal <anrajag@amazon.com>
auto-merge was automatically disabled October 18, 2023 18:46

Head branch was pushed to by a user without write access

@yeya24 yeya24 merged commit 8787996 into cortexproject:master Oct 18, 2023
14 checks passed
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

4 participants