Skip to content

Commit

Permalink
Merge pull request #2192 from justinsb/blankview
Browse files Browse the repository at this point in the history
monitoring: add blankView
  • Loading branch information
google-oss-prow[bot] authored Jul 2, 2024
2 parents eb03df2 + a3f7f62 commit 520f8c3
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 7 deletions.
7 changes: 4 additions & 3 deletions apis/monitoring/v1beta1/monitoringdashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,9 @@ type Scorecard struct {
// Will cause the scorecard to show a spark chart.
SparkChartView *Scorecard_SparkChartView `json:"sparkChartView,omitempty"`

/*NOTYET
// Will cause the `Scorecard` to show only the value, with no indicator to
// its value relative to its thresholds.
BlankView *Empty `json:"blankView,omitempty"`
*/
BlankView *BlankView `json:"blankView,omitempty"`

// The thresholds used to determine the state of the scorecard given the
// time series' current value. For an actual value x, the scorecard is in a
Expand Down Expand Up @@ -748,6 +746,9 @@ type Scorecard struct {
Thresholds []Threshold `json:"thresholds,omitempty"`
}

type BlankView struct {
}

// +kcc:proto=google.monitoring.dashboard.v1.Scorecard.GaugeView
type Scorecard_GaugeView struct {
// The lower bound for this gauge chart. The value of the chart should
Expand Down
21 changes: 21 additions & 0 deletions apis/monitoring/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,11 @@ spec:
scorecard:
description: A scorecard summarizing time series data.
properties:
blankView:
description: Will cause the `Scorecard` to show
only the value, with no indicator to its value
relative to its thresholds.
type: object
gaugeView:
description: Will cause the scorecard to show
a gauge chart.
Expand Down Expand Up @@ -3896,6 +3901,11 @@ spec:
scorecard:
description: A scorecard summarizing time series data.
properties:
blankView:
description: Will cause the `Scorecard` to show only
the value, with no indicator to its value relative
to its thresholds.
type: object
gaugeView:
description: Will cause the scorecard to show a gauge
chart.
Expand Down Expand Up @@ -6732,6 +6742,11 @@ spec:
scorecard:
description: A scorecard summarizing time series data.
properties:
blankView:
description: Will cause the `Scorecard` to show
only the value, with no indicator to its value
relative to its thresholds.
type: object
gaugeView:
description: Will cause the scorecard to show a
gauge chart.
Expand Down Expand Up @@ -9709,6 +9724,11 @@ spec:
scorecard:
description: A scorecard summarizing time series data.
properties:
blankView:
description: Will cause the `Scorecard` to show
only the value, with no indicator to its value
relative to its thresholds.
type: object
gaugeView:
description: Will cause the scorecard to show
a gauge chart.
Expand Down
1 change: 1 addition & 0 deletions docs/releasenotes/release-1.120.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ output fields from GCP APIs are in `status.observedState.*`
* Added `singleViewGroup` widgets.
* Added `timeSeriesTable` widgets.

* Added `blankView` to `scorecard` widgets.
* Added `dataSets.targetAxis` and `y2Axis` fields to `xyChart` widgets.
* Added `id` field to all widgets.
* Added `prometheusQuery` and `outputFullDuration` to timeSeriesQuery.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func Scorecard_FromProto(mapCtx *MapContext, in *pb.Scorecard) *krm.Scorecard {
out.TimeSeriesQuery = TimeSeriesQuery_FromProto(mapCtx, in.GetTimeSeriesQuery())
out.GaugeView = Scorecard_GaugeView_FromProto(mapCtx, in.GetGaugeView())
out.SparkChartView = Scorecard_SparkChartView_FromProto(mapCtx, in.GetSparkChartView())
// MISSING: BlankView
out.BlankView = BlankView_FromProto(mapCtx, in.GetBlankView())
out.Thresholds = Slice_FromProto(mapCtx, in.Thresholds, Threshold_FromProto)
return out
}
Expand All @@ -408,7 +408,9 @@ func Scorecard_ToProto(mapCtx *MapContext, in *krm.Scorecard) *pb.Scorecard {
if oneof := Scorecard_SparkChartView_ToProto(mapCtx, in.SparkChartView); oneof != nil {
out.DataView = &pb.Scorecard_SparkChartView_{SparkChartView: oneof}
}
// MISSING: BlankView
if oneof := BlankView_ToProto(mapCtx, in.BlankView); oneof != nil {
out.DataView = &pb.Scorecard_BlankView{BlankView: oneof}
}
out.Thresholds = Slice_ToProto(mapCtx, in.Thresholds, Threshold_ToProto)
return out
}
Expand Down
15 changes: 15 additions & 0 deletions pkg/controller/direct/monitoring/dashboard_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,18 @@ func IncidentList_ToProto(mapCtx *MapContext, in *krm.IncidentList) *pb.Incident
}
return out
}

func BlankView_FromProto(mapCtx *MapContext, in *emptypb.Empty) *krm.BlankView {
if in == nil {
return nil
}
out := &krm.BlankView{}
return out
}
func BlankView_ToProto(mapCtx *MapContext, in *krm.BlankView) *emptypb.Empty {
if in == nil {
return nil
}
out := &emptypb.Empty{}
return out
}
2 changes: 0 additions & 2 deletions pkg/controller/direct/monitoring/roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ func FuzzMonitoringDashboardSpec(f *testing.F) {
".row_layout.rows[].widgets[]",
}
for _, widgetPath := range widgetPaths {
unimplementedFields.Insert(widgetPath + ".scorecard.blank_view")

unimplementedFields.Insert(widgetPath + ".pie_chart.data_sets[].time_series_query.time_series_filter.statistical_time_series_filter")
unimplementedFields.Insert(widgetPath + ".pie_chart.data_sets[].time_series_query.time_series_filter.pick_time_series_filter.interval")
unimplementedFields.Insert(widgetPath + ".pie_chart.data_sets[].time_series_query.time_series_filter_ratio.statistical_time_series_filter")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ spec:
kind: Project
title: Widget 4
- scorecard:
blankView: {}
timeSeriesQuery:
outputFullDuration: true
prometheusQuery: sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ spec:
- external: projects/${projectId}
title: Widget 4
- scorecard:
blankView: {}
timeSeriesQuery:
outputFullDuration: true
prometheusQuery: sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ x-goog-request-params: parent=projects%2F${projectId}
},
{
"scorecard": {
"blankView": {},
"timeSeriesQuery": {
"outputFullDuration": true,
"prometheusQuery": "sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}} / 60)"
Expand Down Expand Up @@ -509,6 +510,7 @@ X-Xss-Protection: 0
},
{
"scorecard": {
"blankView": {},
"timeSeriesQuery": {
"outputFullDuration": true,
"prometheusQuery": "sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}} / 60)"
Expand Down Expand Up @@ -744,6 +746,7 @@ X-Xss-Protection: 0
},
{
"scorecard": {
"blankView": {},
"timeSeriesQuery": {
"outputFullDuration": true,
"prometheusQuery": "sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}} / 60)"
Expand Down Expand Up @@ -967,6 +970,7 @@ x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmon
},
{
"scorecard": {
"blankView": {},
"timeSeriesQuery": {
"outputFullDuration": true,
"prometheusQuery": "sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}} / 60)"
Expand Down Expand Up @@ -1194,6 +1198,7 @@ X-Xss-Protection: 0
},
{
"scorecard": {
"blankView": {},
"timeSeriesQuery": {
"outputFullDuration": true,
"prometheusQuery": "sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}} / 60)"
Expand Down Expand Up @@ -1429,6 +1434,7 @@ X-Xss-Protection: 0
},
{
"scorecard": {
"blankView": {},
"timeSeriesQuery": {
"outputFullDuration": true,
"prometheusQuery": "sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}} / 60)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
- external: "projects/${projectId}"
- title: "Scorecard Widget"
scorecard:
blankView: {}
timeSeriesQuery:
outputFullDuration: true
prometheusQuery: "sum(mysql_global_status_uptime{${Cluster},${Location},${Namespace}} / 60)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ columnLayout:
unitOverride: string
showLabels: boolean
scorecard:
blankView: {}
gaugeView:
lowerBound: float
upperBound: float
Expand Down Expand Up @@ -487,6 +488,7 @@ gridLayout:
unitOverride: string
showLabels: boolean
scorecard:
blankView: {}
gaugeView:
lowerBound: float
upperBound: float
Expand Down Expand Up @@ -797,6 +799,7 @@ mosaicLayout:
unitOverride: string
showLabels: boolean
scorecard:
blankView: {}
gaugeView:
lowerBound: float
upperBound: float
Expand Down Expand Up @@ -1115,6 +1118,7 @@ rowLayout:
unitOverride: string
showLabels: boolean
scorecard:
blankView: {}
gaugeView:
lowerBound: float
upperBound: float
Expand Down Expand Up @@ -2564,6 +2568,16 @@ rowLayout:
<p>{% verbatim %}A scorecard summarizing time series data.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>columnLayout.columns[].widgets[].scorecard.blankView</code></p>
<p><i>Optional</i></p>
</td>
<td>
<p><code class="apitype">object</code></p>
<p>{% verbatim %}Will cause the `Scorecard` to show only the value, with no indicator to its value relative to its thresholds.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>columnLayout.columns[].widgets[].scorecard.gaugeView</code></p>
Expand Down Expand Up @@ -6661,6 +6675,16 @@ rowLayout:
<p>{% verbatim %}A scorecard summarizing time series data.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>gridLayout.widgets[].scorecard.blankView</code></p>
<p><i>Optional</i></p>
</td>
<td>
<p><code class="apitype">object</code></p>
<p>{% verbatim %}Will cause the `Scorecard` to show only the value, with no indicator to its value relative to its thresholds.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>gridLayout.widgets[].scorecard.gaugeView</code></p>
Expand Down Expand Up @@ -10708,6 +10732,16 @@ rowLayout:
<p>{% verbatim %}A scorecard summarizing time series data.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>mosaicLayout.tiles[].widget.scorecard.blankView</code></p>
<p><i>Optional</i></p>
</td>
<td>
<p><code class="apitype">object</code></p>
<p>{% verbatim %}Will cause the `Scorecard` to show only the value, with no indicator to its value relative to its thresholds.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>mosaicLayout.tiles[].widget.scorecard.gaugeView</code></p>
Expand Down Expand Up @@ -14845,6 +14879,16 @@ rowLayout:
<p>{% verbatim %}A scorecard summarizing time series data.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>rowLayout.rows[].widgets[].scorecard.blankView</code></p>
<p><i>Optional</i></p>
</td>
<td>
<p><code class="apitype">object</code></p>
<p>{% verbatim %}Will cause the `Scorecard` to show only the value, with no indicator to its value relative to its thresholds.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>rowLayout.rows[].widgets[].scorecard.gaugeView</code></p>
Expand Down

0 comments on commit 520f8c3

Please sign in to comment.