Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormatMode ¶ added in v0.13.0
type FormatMode string
FormatMode switches between Table, Time series, or Heatmap. Table will only work in the Table panel. Heatmap is suitable for displaying metrics of the Histogram type on a Heatmap panel. Under the hood, it converts cumulative histograms to regular ones and sorts series by the bucket bound.
const ( FormatTable FormatMode = "table" FormatHeatmap FormatMode = "heatmap" FormatTimeSeries FormatMode = "time_series" )
type Option ¶
type Option func(target *Prometheus)
Option represents an option that can be used to configure a prometheus query.
func Format ¶ added in v0.13.0
func Format(format FormatMode) Option
Format indicates how the data should be returned.
func Hide ¶ added in v0.11.3
func Hide() Option
Hide the query. Grafana does not send hidden queries to the data source, but they can still be referenced in alerts.
func Instant ¶ added in v0.13.0
func Instant() Option
Instant marks the query as "instant, which means Prometheus will only return the latest scrapped value.
func IntervalFactor ¶ added in v0.13.0
IntervalFactor sets the resolution factor.
type Prometheus ¶
type Prometheus struct { Ref string Hidden bool Expr string IntervalFactor int Interval string Step int LegendFormat string Instant bool Format string }
Prometheus represents a prometheus query.
func New ¶
func New(query string, options ...Option) *Prometheus
New creates a new prometheus query.