Skip to content

Commit d1577ba

Browse files
committed
Add ShowAllValues option to Gauge Panels
1 parent 65a9b73 commit d1577ba

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

observability-lib/grafana/panels.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ func NewTimeSeriesPanel(options *TimeSeriesPanelOptions) *Panel {
440440

441441
type BarGaugePanelOptions struct {
442442
*PanelOptions
443-
ShowUnfilled bool
444-
Orientation common.VizOrientation
443+
ShowUnfilled bool
444+
Orientation common.VizOrientation
445+
ShowAllValues bool
445446
}
446447

447448
func NewBarGaugePanel(options *BarGaugePanelOptions) *Panel {
@@ -457,7 +458,7 @@ func NewBarGaugePanel(options *BarGaugePanelOptions) *Panel {
457458
Unit(options.Unit).
458459
ReduceOptions(
459460
common.NewReduceDataOptionsBuilder().
460-
Calcs([]string{"lastNotNull"}).Values(false),
461+
Calcs([]string{"lastNotNull"}).Values(options.ShowAllValues),
461462
)
462463

463464
if options.Interval != "" {
@@ -515,6 +516,7 @@ func NewBarGaugePanel(options *BarGaugePanelOptions) *Panel {
515516

516517
type GaugePanelOptions struct {
517518
*PanelOptions
519+
ShowAllValues bool
518520
}
519521

520522
func NewGaugePanel(options *GaugePanelOptions) *Panel {
@@ -530,7 +532,7 @@ func NewGaugePanel(options *GaugePanelOptions) *Panel {
530532
Unit(options.Unit).
531533
ReduceOptions(
532534
common.NewReduceDataOptionsBuilder().
533-
Calcs([]string{"lastNotNull"}).Values(false),
535+
Calcs([]string{"lastNotNull"}).Values(options.ShowAllValues),
534536
)
535537

536538
if options.Interval != "" {

0 commit comments

Comments
 (0)