Conversation
frontend/src/container/LogDetailedView/InfraMetrics/constants.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Free Tier Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Inconsistent indentation breaks map literal structure readability
- Corrected indentation of map entries G, H, I, and F4 from 2 tabs to 3 tabs to match the consistent pattern used by other entries in the BuilderQueries map.
Or push these changes by commenting:
@cursor push 01bb4a9afe
Preview (01bb4a9afe)
diff --git a/pkg/query-service/app/inframetrics/hosts_query.go b/pkg/query-service/app/inframetrics/hosts_query.go
--- a/pkg/query-service/app/inframetrics/hosts_query.go
+++ b/pkg/query-service/app/inframetrics/hosts_query.go
@@ -269,131 +269,131 @@
Items: []v3.FilterItem{},
},
},
- "G": {
- QueryName: "G",
- DataSource: v3.DataSourceMetrics,
- AggregateAttribute: v3.AttributeKey{
- Key: metricNamesForHosts["load15"],
- DataType: v3.AttributeKeyDataTypeFloat64,
- },
- Temporality: v3.Unspecified,
- Filters: &v3.FilterSet{
- Operator: "AND",
- Items: []v3.FilterItem{
- {
- Key: v3.AttributeKey{
- Key: hostNameAttrKey,
- DataType: v3.AttributeKeyDataTypeString,
- Type: v3.AttributeKeyTypeResource,
+ "G": {
+ QueryName: "G",
+ DataSource: v3.DataSourceMetrics,
+ AggregateAttribute: v3.AttributeKey{
+ Key: metricNamesForHosts["load15"],
+ DataType: v3.AttributeKeyDataTypeFloat64,
+ },
+ Temporality: v3.Unspecified,
+ Filters: &v3.FilterSet{
+ Operator: "AND",
+ Items: []v3.FilterItem{
+ {
+ Key: v3.AttributeKey{
+ Key: hostNameAttrKey,
+ DataType: v3.AttributeKeyDataTypeString,
+ Type: v3.AttributeKeyTypeResource,
+ },
+ Operator: v3.FilterOperatorNotContains,
+ Value: agentNameToIgnore,
},
- Operator: v3.FilterOperatorNotContains,
- Value: agentNameToIgnore,
},
},
+ GroupBy: []v3.AttributeKey{
+ {
+ Key: hostNameAttrKey,
+ DataType: v3.AttributeKeyDataTypeString,
+ Type: v3.AttributeKeyTypeResource,
+ },
+ },
+ Expression: "G",
+ ReduceTo: v3.ReduceToOperatorAvg,
+ TimeAggregation: v3.TimeAggregationAvg,
+ SpaceAggregation: v3.SpaceAggregationSum,
+ Disabled: false,
+ Legend: "CPU Load Average (15m)",
},
- GroupBy: []v3.AttributeKey{
- {
- Key: hostNameAttrKey,
- DataType: v3.AttributeKeyDataTypeString,
- Type: v3.AttributeKeyTypeResource,
+ "H": {
+ QueryName: "H",
+ DataSource: v3.DataSourceMetrics,
+ AggregateAttribute: v3.AttributeKey{
+ Key: metricNamesForHosts["filesystem"],
+ DataType: v3.AttributeKeyDataTypeFloat64,
},
- },
- Expression: "G",
- ReduceTo: v3.ReduceToOperatorAvg,
- TimeAggregation: v3.TimeAggregationAvg,
- SpaceAggregation: v3.SpaceAggregationSum,
- Disabled: false,
- Legend: "CPU Load Average (15m)",
- },
- "H": {
- QueryName: "H",
- DataSource: v3.DataSourceMetrics,
- AggregateAttribute: v3.AttributeKey{
- Key: metricNamesForHosts["filesystem"],
- DataType: v3.AttributeKeyDataTypeFloat64,
- },
- Temporality: v3.Cumulative,
- Filters: &v3.FilterSet{
- Operator: "AND",
- Items: []v3.FilterItem{
- {
- Key: v3.AttributeKey{
- Key: "state",
- DataType: v3.AttributeKeyDataTypeString,
- Type: v3.AttributeKeyTypeTag,
+ Temporality: v3.Cumulative,
+ Filters: &v3.FilterSet{
+ Operator: "AND",
+ Items: []v3.FilterItem{
+ {
+ Key: v3.AttributeKey{
+ Key: "state",
+ DataType: v3.AttributeKeyDataTypeString,
+ Type: v3.AttributeKeyTypeTag,
+ },
+ Operator: v3.FilterOperatorEqual,
+ Value: "used",
},
- Operator: v3.FilterOperatorEqual,
- Value: "used",
+ {
+ Key: v3.AttributeKey{
+ Key: hostNameAttrKey,
+ DataType: v3.AttributeKeyDataTypeString,
+ Type: v3.AttributeKeyTypeResource,
+ },
+ Operator: v3.FilterOperatorNotContains,
+ Value: agentNameToIgnore,
+ },
},
+ },
+ GroupBy: []v3.AttributeKey{
{
- Key: v3.AttributeKey{
- Key: hostNameAttrKey,
- DataType: v3.AttributeKeyDataTypeString,
- Type: v3.AttributeKeyTypeResource,
- },
- Operator: v3.FilterOperatorNotContains,
- Value: agentNameToIgnore,
+ Key: hostNameAttrKey,
+ DataType: v3.AttributeKeyDataTypeString,
+ Type: v3.AttributeKeyTypeResource,
},
},
+ Expression: "H",
+ ReduceTo: v3.ReduceToOperatorAvg,
+ TimeAggregation: v3.TimeAggregationAvg,
+ SpaceAggregation: v3.SpaceAggregationSum,
+ Disabled: true,
},
- GroupBy: []v3.AttributeKey{
- {
- Key: hostNameAttrKey,
- DataType: v3.AttributeKeyDataTypeString,
- Type: v3.AttributeKeyTypeResource,
+ "I": {
+ QueryName: "I",
+ DataSource: v3.DataSourceMetrics,
+ AggregateAttribute: v3.AttributeKey{
+ Key: metricNamesForHosts["filesystem"],
+ DataType: v3.AttributeKeyDataTypeFloat64,
},
- },
- Expression: "H",
- ReduceTo: v3.ReduceToOperatorAvg,
- TimeAggregation: v3.TimeAggregationAvg,
- SpaceAggregation: v3.SpaceAggregationSum,
- Disabled: true,
- },
- "I": {
- QueryName: "I",
- DataSource: v3.DataSourceMetrics,
- AggregateAttribute: v3.AttributeKey{
- Key: metricNamesForHosts["filesystem"],
- DataType: v3.AttributeKeyDataTypeFloat64,
- },
- Temporality: v3.Cumulative,
- Filters: &v3.FilterSet{
- Operator: "AND",
- Items: []v3.FilterItem{
- {
- Key: v3.AttributeKey{
- Key: hostNameAttrKey,
- DataType: v3.AttributeKeyDataTypeString,
- Type: v3.AttributeKeyTypeResource,
+ Temporality: v3.Cumulative,
+ Filters: &v3.FilterSet{
+ Operator: "AND",
+ Items: []v3.FilterItem{
+ {
+ Key: v3.AttributeKey{
+ Key: hostNameAttrKey,
+ DataType: v3.AttributeKeyDataTypeString,
+ Type: v3.AttributeKeyTypeResource,
+ },
+ Operator: v3.FilterOperatorNotContains,
+ Value: agentNameToIgnore,
},
- Operator: v3.FilterOperatorNotContains,
- Value: agentNameToIgnore,
},
},
+ GroupBy: []v3.AttributeKey{
+ {
+ Key: hostNameAttrKey,
+ DataType: v3.AttributeKeyDataTypeString,
+ Type: v3.AttributeKeyTypeResource,
+ },
+ },
+ Expression: "I",
+ ReduceTo: v3.ReduceToOperatorAvg,
+ TimeAggregation: v3.TimeAggregationAvg,
+ SpaceAggregation: v3.SpaceAggregationSum,
+ Disabled: true,
},
- GroupBy: []v3.AttributeKey{
- {
- Key: hostNameAttrKey,
- DataType: v3.AttributeKeyDataTypeString,
- Type: v3.AttributeKeyTypeResource,
+ "F4": {
+ QueryName: "F4",
+ Expression: "H/I",
+ Legend: "Disk Usage (%)",
+ Filters: &v3.FilterSet{
+ Operator: "AND",
+ Items: []v3.FilterItem{},
},
},
- Expression: "I",
- ReduceTo: v3.ReduceToOperatorAvg,
- TimeAggregation: v3.TimeAggregationAvg,
- SpaceAggregation: v3.SpaceAggregationSum,
- Disabled: true,
},
- "F4": {
- QueryName: "F4",
- Expression: "H/I",
- Legend: "Disk Usage (%)",
- Filters: &v3.FilterSet{
- Operator: "AND",
- Items: []v3.FilterItem{},
- },
- },
- },
PanelType: v3.PanelTypeTable,
QueryType: v3.QueryTypeBuilder,
},| Operator: "AND", | ||
| Items: []v3.FilterItem{}, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Inconsistent indentation breaks map literal structure readability
Low Severity
Entries "G" through "F4" in the BuilderQueries map are at 2-tab indentation while entries "A" through "F3" remain at 3-tab indentation. This makes the map literal visually confusing — the new entries appear to be at the same level as BuilderQueries itself rather than nested inside it. The consecutive }, on lines 395 and 396 (closing F4 and the map respectively, both at 2 tabs) further obscure the structure. While Go compiles this fine, the inconsistency makes the code harder to read and maintain.



Pull Request
📄 Summary
Today the infrastructure tab, doesnt show out of the box information on disk/filesystem usage
Screenshots / Screen Recordings (if applicable)
Issues closed by this PR
✅ Change Type
Select all that apply
🧪 Testing Strategy
📝 Changelog
📋 Checklist
👀 Notes for Reviewers
Note
Medium Risk
Adds a new
filesystemfield to the host list API and extends query-building logic (new formula/queries and step handling), which could affect sorting/results and query load for infra monitoring screens.Overview
Adds host disk usage support end-to-end: the hosts list API/model now includes a
filesystemutilization value and supports sorting by it, and the Infra Monitoring UI surfaces it as a new “Disk Usage” column plus a progress bar in the host side drawer.Extends host metrics queries to include a disk-usage time series split by
mountpoint(viasystem.filesystem.usage) and updates host metric query payloads to usestepInterval: 0so the backend derives the effective step from the selected time range. Related frontend types/styles and tests are updated accordingly.Written by Cursor Bugbot for commit 28e38ba. This will update automatically on new commits. Configure here.