Skip to content

Threshold🔗

User-defined value for a metric that triggers visual changes in a panel when this value is met or exceeded

They are used to conditionally style and color visualizations based on query results , and can be applied to most visualizations.

Definition🔗

type Threshold struct {
    // Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded.
    // Nulls currently appear here when serializing -Infinity to JSON.
    Value *float64 `json:"value"`
    // Color represents the color of the visual change that will occur in the dashboard when the threshold value is met or exceeded.
    Color string `json:"color"`
}

Methods🔗

UnmarshalJSONStrict🔗

UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode Threshold from JSON.

Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …

func (threshold *Threshold) UnmarshalJSONStrict(raw []byte) error

Equals🔗

Equals tests the equality of two Threshold objects.

func (threshold *Threshold) Equals(other Threshold) bool

Validate🔗

Validate checks all the validation constraints that may be defined on Threshold fields for violations and returns them.

func (threshold *Threshold) Validate() error