-
Notifications
You must be signed in to change notification settings - Fork 8.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
[RAC] [Metrics UI] Include group name in the reason message #115171
Changes from 3 commits
b91716d
2d3c2c9
8cd19ce
88fc6ee
065de0a
36f599b
3556efe
aaee1c3
6949af2
ee85ac3
8989f6b
7f002c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13383,15 +13383,15 @@ | |
"xpack.infra.metrics.alerting.threshold.errorAlertReason": "Elasticsearch 尝试查询 {metric} 的数据时出现故障", | ||
"xpack.infra.metrics.alerting.threshold.errorState": "错误", | ||
"xpack.infra.metrics.alerting.threshold.fired": "告警", | ||
"xpack.infra.metrics.alerting.threshold.firedAlertReason": "{metric} {comparator}阈值 {threshold}(当前值为 {currentValue})", | ||
"xpack.infra.metrics.alerting.threshold.firedAlertReason": "{groupName}: {metric} {comparator}阈值 {threshold}(当前值为 {currentValue})", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should also change the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @claudiopro Yep indeed these tests were failing. Ideally I should first fix these and then open my PR for review. Thanks for the review. |
||
"xpack.infra.metrics.alerting.threshold.gtComparator": "大于", | ||
"xpack.infra.metrics.alerting.threshold.ltComparator": "小于", | ||
"xpack.infra.metrics.alerting.threshold.noDataAlertReason": "{metric} 在过去 {interval}中未报告数据", | ||
"xpack.infra.metrics.alerting.threshold.noDataAlertReason": "{groupName}: {metric} 在过去 {interval}中未报告数据", | ||
"xpack.infra.metrics.alerting.threshold.noDataFormattedValue": "[无数据]", | ||
"xpack.infra.metrics.alerting.threshold.noDataState": "无数据", | ||
"xpack.infra.metrics.alerting.threshold.okState": "正常 [已恢复]", | ||
"xpack.infra.metrics.alerting.threshold.outsideRangeComparator": "不介于", | ||
"xpack.infra.metrics.alerting.threshold.recoveredAlertReason": "{metric} 现在{comparator}阈值 {threshold}(当前值为 {currentValue})", | ||
"xpack.infra.metrics.alerting.threshold.recoveredAlertReason": "{groupName}: {metric} 现在{comparator}阈值 {threshold}(当前值为 {currentValue})", | ||
"xpack.infra.metrics.alerting.threshold.thresholdRange": "{a} 和 {b}", | ||
"xpack.infra.metrics.alerting.threshold.warning": "警告", | ||
"xpack.infra.metrics.alerting.threshold.warningState": "警告", | ||
|
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.
What's the reasoning to use
groupName
instead ofitem
here?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 guess I was influenced by log threshold where is called groupName. But you might be right. Since here in metrics we call it item, I could rename
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.
But item sounds very generic. Do you have a suggestion of how we could describe it better?
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 don't know to be honest (naming is hard :D). I'm not sure either what
item
orresultItem
refers to. My comment came more from the disparity between the variable used when calling the function (item
) versus the argument name.Regarding how to name it, I see two approaches:
buildReasonViewVerboseMetricName
function.For the first one, is this related to the
kibana.alert.instance.id
field used to indentify the alert? If that's the case we can call itinstance
orinstanceId
.For the second one, I would do something on the line of
reasonPrefix
,reasonHeader
or similar.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.
@afgomez Yep I got you. Well naming, it's tough.
Regarding your question, no it is not related to
kibana.alert.instance.id
. I would say it is the node name judging from this screenshot. In this case item is the host name which isPanagiotas-MBP
In the code https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts#L114 item is basically
inventoryItem
.I see 2 options:
nodeName
orinventoryItem
(I would say nodeName)const reasonPrefix = item;
and pass it to the buildReasonViewVerboseMetricName function. But others would still wonder what is item in other places.I think I'd better go with option 1. Does it sound good?
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 looks like metric_threshold_executor shares same code and they use
group
there https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts#L120, so I will use group for both files.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.
Perfect!