-
Notifications
You must be signed in to change notification settings - Fork 11
add support for configuring log level using custom rules #301
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Loori-R , could you please fix backend part, because of linter
0cc4dfe
to
d28a5bf
Compare
d28a5bf
to
8f11151
Compare
Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comments
return { | ||
...query, | ||
step: `${step}s`, | ||
field: HITS_BY_FIELD, | ||
field: uniqFields, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rename JSON param to fields because it is an array now
@@ -53,7 +53,7 @@ type Query struct { | |||
IntervalMs int64 `json:"intervalMs"` | |||
MaxLines int `json:"maxLines"` | |||
Step string `json:"step"` | |||
Field string `json:"field"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to name the JSON field as fields
because it is a slice
Summary
This pull request adds a "Log level rules" section to the datasource configuration screen. It allows users to define custom rules for dynamically assigning log levels based on field values.
Related issue: #294, #209, #201
How it works
Click "Add rule" to create a new rule. Each rule consists of the following elements:
Equals
,Not equal
,Matches regex
,Less than
,Greater than
.critical
,warning
,error
,info
,debug
,trace
,unknown
.After adding or editing rules, make sure to click "Save & test" to apply the updated configuration.
Rule priority
If multiple rules match, the first one in the list takes precedence.