Skip to content

Commit

Permalink
Merge pull request #2167 from justinsb/monitoringdashboard_xychart
Browse files Browse the repository at this point in the history
monitoringdashboard: add support for xyChart dataSets.targetAxis and y2Axis
  • Loading branch information
google-oss-prow[bot] authored Jun 29, 2024
2 parents 14966c3 + 3bc6af8 commit f9b8ad7
Show file tree
Hide file tree
Showing 14 changed files with 353 additions and 13 deletions.
4 changes: 0 additions & 4 deletions apis/monitoring/v1beta1/monitoringdashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ type XyChart struct {
// The properties applied to the y-axis.
YAxis *XyChart_Axis `json:"yAxis,omitempty"`

/*NOTYET
// The properties applied to the y2-axis.
Y2Axis *XyChart_Axis `json:"y2Axis,omitempty"`
*/

// Display options for the chart.
ChartOptions *ChartOptions `json:"chartOptions,omitempty"`
Expand Down Expand Up @@ -105,10 +103,8 @@ type XyChart_DataSet struct {
// make sense to fetch and align data at one minute intervals.
MinAlignmentPeriod *string `json:"minAlignmentPeriod,omitempty"`

/*NOTYET
// Optional. The target axis to use for plotting the metric.
TargetAxis *string `json:"targetAxis,omitempty"`
*/
}

// +kcc:proto=google.monitoring.dashboard.v1.XyChart.Axis
Expand Down
10 changes: 10 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 @@ -2329,6 +2329,10 @@ spec:
description: How this data should be plotted
on the chart.
type: string
targetAxis:
description: Optional. The target axis to
use for plotting the metric.
type: string
timeSeriesQuery:
description: Required. Fields for querying
time series data from the Stackdriver
Expand Down Expand Up @@ -2965,6 +2969,17 @@ spec:
linear scale is used.
type: string
type: object
y2Axis:
description: The properties applied to the y2-axis.
properties:
label:
description: The label of the axis.
type: string
scale:
description: The axis scale. By default, a
linear scale is used.
type: string
type: object
yAxis:
description: The properties applied to the y-axis.
properties:
Expand Down Expand Up @@ -5155,6 +5170,10 @@ spec:
description: How this data should be plotted on
the chart.
type: string
targetAxis:
description: Optional. The target axis to use
for plotting the metric.
type: string
timeSeriesQuery:
description: Required. Fields for querying time
series data from the Stackdriver metrics API.
Expand Down Expand Up @@ -5754,6 +5773,17 @@ spec:
scale is used.
type: string
type: object
y2Axis:
description: The properties applied to the y2-axis.
properties:
label:
description: The label of the axis.
type: string
scale:
description: The axis scale. By default, a linear
scale is used.
type: string
type: object
yAxis:
description: The properties applied to the y-axis.
properties:
Expand Down Expand Up @@ -7998,6 +8028,10 @@ spec:
description: How this data should be plotted
on the chart.
type: string
targetAxis:
description: Optional. The target axis to
use for plotting the metric.
type: string
timeSeriesQuery:
description: Required. Fields for querying
time series data from the Stackdriver metrics
Expand Down Expand Up @@ -8619,6 +8653,17 @@ spec:
scale is used.
type: string
type: object
y2Axis:
description: The properties applied to the y2-axis.
properties:
label:
description: The label of the axis.
type: string
scale:
description: The axis scale. By default, a linear
scale is used.
type: string
type: object
yAxis:
description: The properties applied to the y-axis.
properties:
Expand Down Expand Up @@ -10962,6 +11007,10 @@ spec:
description: How this data should be plotted
on the chart.
type: string
targetAxis:
description: Optional. The target axis to
use for plotting the metric.
type: string
timeSeriesQuery:
description: Required. Fields for querying
time series data from the Stackdriver
Expand Down Expand Up @@ -11598,6 +11647,17 @@ spec:
linear scale is used.
type: string
type: object
y2Axis:
description: The properties applied to the y2-axis.
properties:
label:
description: The label of the axis.
type: string
scale:
description: The axis scale. By default, a
linear scale is used.
type: string
type: object
yAxis:
description: The properties applied to the y-axis.
properties:
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 @@ -36,6 +36,7 @@ output fields from GCP APIs are in `status.observedState.*`
* Added `sectionHeader` widgets.
* Added `singleViewGroup` widgets.

* Added `dataSets.targetAxis` and `y2Axis` fields to `xyChart` widgets.
* Added `id` field to all widgets.
* Added `prometheusQuery` and `outputFullDuration` to timeSeriesQuery.
* Added `style` fields to text widgets.
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 @@ -840,7 +840,7 @@ func XyChart_FromProto(mapCtx *MapContext, in *pb.XyChart) *krm.XyChart {
out.Thresholds = Slice_FromProto(mapCtx, in.Thresholds, Threshold_FromProto)
out.XAxis = XyChart_Axis_FromProto(mapCtx, in.GetXAxis())
out.YAxis = XyChart_Axis_FromProto(mapCtx, in.GetYAxis())
// MISSING: Y2Axis
out.Y2Axis = XyChart_Axis_FromProto(mapCtx, in.GetY2Axis())
out.ChartOptions = ChartOptions_FromProto(mapCtx, in.GetChartOptions())
return out
}
Expand All @@ -854,7 +854,7 @@ func XyChart_ToProto(mapCtx *MapContext, in *krm.XyChart) *pb.XyChart {
out.Thresholds = Slice_ToProto(mapCtx, in.Thresholds, Threshold_ToProto)
out.XAxis = XyChart_Axis_ToProto(mapCtx, in.XAxis)
out.YAxis = XyChart_Axis_ToProto(mapCtx, in.YAxis)
// MISSING: Y2Axis
out.Y2Axis = XyChart_Axis_ToProto(mapCtx, in.Y2Axis)
out.ChartOptions = ChartOptions_ToProto(mapCtx, in.ChartOptions)
return out
}
Expand Down Expand Up @@ -885,7 +885,7 @@ func XyChart_DataSet_FromProto(mapCtx *MapContext, in *pb.XyChart_DataSet) *krm.
out.PlotType = Enum_FromProto(mapCtx, in.PlotType)
out.LegendTemplate = LazyPtr(in.GetLegendTemplate())
out.MinAlignmentPeriod = DataSet_MinAlignmentPeriod_FromProto(mapCtx, in.GetMinAlignmentPeriod())
// MISSING: TargetAxis
out.TargetAxis = Enum_FromProto(mapCtx, in.TargetAxis)
return out
}
func XyChart_DataSet_ToProto(mapCtx *MapContext, in *krm.XyChart_DataSet) *pb.XyChart_DataSet {
Expand All @@ -897,6 +897,6 @@ func XyChart_DataSet_ToProto(mapCtx *MapContext, in *krm.XyChart_DataSet) *pb.Xy
out.PlotType = Enum_ToProto[pb.XyChart_DataSet_PlotType](mapCtx, in.PlotType)
out.LegendTemplate = ValueOf(in.LegendTemplate)
out.MinAlignmentPeriod = DataSet_MinAlignmentPeriod_ToProto(mapCtx, in.MinAlignmentPeriod)
// MISSING: TargetAxis
out.TargetAxis = Enum_ToProto[pb.XyChart_DataSet_TargetAxis](mapCtx, in.TargetAxis)
return out
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
xyChart:
dataSets:
- plotType: LINE
targetAxis: Y1
timeSeriesQuery:
timeSeriesFilter:
aggregation:
Expand All @@ -29,6 +30,7 @@ spec:
xyChart:
dataSets:
- plotType: LINE
targetAxis: Y1
timeSeriesQuery:
timeSeriesFilter:
aggregation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ spec:
xyChart:
dataSets:
- plotType: LINE
targetAxis: Y2
timeSeriesQuery:
timeSeriesFilter:
aggregation:
perSeriesAligner: ALIGN_RATE
filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count"
unitOverride: "1"
timeshiftDuration: 600.5s
y2Axis:
label: y2Axis
scale: LOG10
yAxis:
label: y1Axis
scale: LINEAR
Expand All @@ -40,6 +44,7 @@ spec:
xyChart:
dataSets:
- plotType: STACKED_BAR
targetAxis: Y1
timeSeriesQuery:
timeSeriesFilter:
aggregation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ spec:
xyChart:
dataSets:
- plotType: LINE
targetAxis: Y2
timeSeriesQuery:
timeSeriesFilter:
aggregation:
perSeriesAligner: ALIGN_RATE
filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count"
unitOverride: "1"
timeshiftDuration: 600.500s
y2Axis:
label: y2Axis
scale: LOG10
yAxis:
label: y1Axis
scale: LINEAR
Expand Down
Loading

0 comments on commit f9b8ad7

Please sign in to comment.