-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: update default alert ch queries for traces and logs #6552
base: develop
Are you sure you want to change the base?
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
1 similar comment
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Reviewed everything up to 7291250 in 20 seconds
More details
- Looked at
22
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. frontend/src/container/CreateAlertRule/defaults.ts:120
- Draft comment:
Ensure that the subtraction of 1800 from{{.start_timestamp}}
is intentional and correct. Consider adding a comment to explain its purpose. - Reason this comment was not posted:
Confidence changes required:50%
The PR updates the query to include a filter onts_bucket_start
, which is a good addition for performance. However, the subtraction of 1800 from{{.start_timestamp}}
should be clarified or documented to ensure it's intentional and correct.
2. frontend/src/container/CreateAlertRule/defaults.ts:152
- Draft comment:
Ensure that the subtraction of 1800 from{{.start_timestamp}}
is intentional and correct. Consider adding a comment to explain its purpose. - Reason this comment was not posted:
Confidence changes required:50%
The PR updates the query to include a filter onts_bucket_start
, which is a good addition for performance. However, the subtraction of 1800 from{{.start_timestamp}}
should be clarified or documented to ensure it's intentional and correct.
3. frontend/src/container/CreateAlertRule/defaults.ts:120
- Draft comment:
Avoid hardcoding color values in SQL queries. Use design tokens or predefined color constants for consistency. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_u9LIOh5hAhEPxCHF
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
let's change it to use service.name |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Incremental review on 645a660 in 25 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. frontend/src/container/CreateAlertRule/defaults.ts:152
- Draft comment:
Ensure that replacingattributes_string['peer.service']
withresource_string_service$$name
is intentional and aligns with the intended logic. The PR description questions the necessity ofpeer.service
, so double-check if this change is correct. - Reason this comment was not posted:
Confidence changes required:50%
The query in thetraceAlertDefaults
object has been updated to useresource_string_service$$name
instead ofattributes_string['peer.service']
. This change aligns with the PR description, which mentions updating the table name and attributes key. However, the PR description also questions whetherpeer.service
should be retained. This suggests a potential oversight or misunderstanding about the necessity ofpeer.service
. Since the PR author has not removed it, it might be intentional, but it's worth confirming if this change aligns with the intended logic.
2. frontend/src/container/CreateAlertRule/defaults.ts:152
- Draft comment:
Avoid hardcoding color values in SQL queries. Use design tokens or predefined color constants for consistency. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_nUU95OsH1X11MgAZ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
Do we have docs somewhere explaining the bucket timestamp? If not, please create them and link the docs in the query comments
@@ -149,7 +149,7 @@ export const traceAlertDefaults: AlertDef = { | |||
chQueries: { | |||
A: { | |||
name: 'A', | |||
query: `SELECT \n\ttoStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, \n\tstringTagMap['peer.service'] AS op_name, \n\ttoFloat64(avg(durationNano)) AS value \nFROM signoz_traces.distributed_signoz_index_v2 \nWHERE stringTagMap['peer.service']!='' \nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}} \nGROUP BY (op_name, interval);\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`, | |||
query: `SELECT \n\ttoStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, \n\tresource_string_service$$name AS op_name, \n\ttoFloat64(avg(duration_nano)) AS value \nFROM signoz_traces.distributed_signoz_index_v3 \nWHERE resource_string_service$$name !='' \nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}} \nAND ts_bucket_start BETWEEN {{.start_timestamp}} - 1800 AND {{.end_timestamp}} \nGROUP BY (op_name, interval);\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n-- \t{{.start_timestamp}}\n-- \t{{.end_timestamp}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`, |
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.
query: `SELECT \n\ttoStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, \n\tresource_string_service$$name AS op_name, \n\ttoFloat64(avg(duration_nano)) AS value \nFROM signoz_traces.distributed_signoz_index_v3 \nWHERE resource_string_service$$name !='' \nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}} \nAND ts_bucket_start BETWEEN {{.start_timestamp}} - 1800 AND {{.end_timestamp}} \nGROUP BY (op_name, interval);\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n-- \t{{.start_timestamp}}\n-- \t{{.end_timestamp}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`, | |
query: `SELECT \n\ttoStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, \n\tresource_string_service$$name AS `service.name`, \n\ttoFloat64(avg(duration_nano)) AS value \nFROM signoz_traces.distributed_signoz_index_v3 \nWHERE resource_string_service$$name !='' \nAND timestamp BETWEEN {{.start_datetime}} AND {{.end_datetime}} \nAND ts_bucket_start BETWEEN {{.start_timestamp}} - 1800 AND {{.end_timestamp}} \nGROUP BY (`service.name`, interval);\n\n-- available variables:\n-- \t{{.start_datetime}}\n-- \t{{.end_datetime}}\n-- \t{{.start_timestamp}}\n-- \t{{.end_timestamp}}\n\n-- required column alias:\n-- \tvalue\n-- \tinterval`, |
Will have to update the docs for clickhouse queries all together which is a sepearete task, will do that and get back to this. Will hold this pr till then. |
Part of https://github.com/SigNoz/engineering-pod/issues/2036
Also @srikanthccv is peer.service is something we want to keep in this query ?
Important
Update default alert queries in
defaults.ts
by addingts_bucket_start
filter and modifying trace query table name and attribute key.ts_bucket_start
filter to log and trace queries indefaults.ts
.signoz_traces.distributed_signoz_index_v3
and attribute key toresource_string_service$$name
for trace queries.logAlertDefaults
to includets_bucket_start
filter.traceAlertDefaults
to includets_bucket_start
filter and change table name and attribute key.This description was created by for 645a660. It will automatically update as commits are pushed.