Documentation ¶
Index ¶
- Constants
- type Aligner
- type FilterOption
- type Option
- func Aggregation(reducer Reducer) Option
- func Alignment(aligner Aligner, alignmentPeriod string) Option
- func Filter(filters ...FilterOption) Option
- func GroupBys(groupBys ...string) Option
- func Hide() Option
- func Legend(legend string) Option
- func Preprocessor(preprocessor PreprocessorMethod) Option
- func Project(project string) Option
- func Ref(ref string) Option
- type PreprocessorMethod
- type Reducer
- type Stackdriver
Constants ¶
const AlignmentGrafanaAuto = "grafana-auto"
const AlignmentStackdriverAuto = "stackdriver-auto"
const PreprocessDelta = "delta"
const PreprocessRate = "rate"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aligner ¶
type Aligner string
Aligner specifies the operation that will be applied to the data points in each alignment period in a time series. See https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies#Aligner
const AlignCount Aligner = "ALIGN_COUNT"
const AlignCountFalse Aligner = "ALIGN_COUNT_FALSE"
const AlignCountTrue Aligner = "ALIGN_COUNT_TRUE"
const AlignDelta Aligner = "ALIGN_DELTA"
const AlignFractionTrue Aligner = "ALIGN_FRACTION_TRUE"
const AlignInterpolate Aligner = "ALIGN_INTERPOLATE"
const AlignMax Aligner = "ALIGN_MAX"
const AlignMean Aligner = "ALIGN_MEAN"
const AlignMin Aligner = "ALIGN_MIN"
const AlignNextOlder Aligner = "ALIGN_NEXT_OLDER"
const AlignNone Aligner = "ALIGN_NONE"
const AlignPercentChange Aligner = "ALIGN_PERCENT_CHANGE"
const AlignPercentile05 Aligner = "ALIGN_PERCENTILE_05"
const AlignPercentile50 Aligner = "ALIGN_PERCENTILE_50"
const AlignPercentile95 Aligner = "ALIGN_PERCENTILE_95"
const AlignPercentile99 Aligner = "ALIGN_PERCENTILE_99"
const AlignRate Aligner = "ALIGN_RATE"
const AlignStdDev Aligner = "ALIGN_STDDEV"
const AlignSum Aligner = "ALIGN_SUM"
type FilterOption ¶
type FilterOption func(filter *filter)
func Eq ¶
func Eq(leftOperand string, rightOperand string) FilterOption
func Matches ¶
func Matches(leftOperand string, rightOperand string) FilterOption
func Neq ¶
func Neq(leftOperand string, rightOperand string) FilterOption
func NotMatches ¶
func NotMatches(leftOperand string, rightOperand string) FilterOption
type Option ¶
type Option func(target *Stackdriver)
Option represents an option that can be used to configure a stackdriver query.
func Aggregation ¶
Aggregation defines how the time series will be aggregated.
func Filter ¶
func Filter(filters ...FilterOption) Option
Filter allows to specify which time series will be in the results.
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 Legend ¶
Legend sets the legend format. See https://grafana.com/docs/grafana/latest/features/datasources/stackdriver/#alias-patterns for more information on allowed patterns.
func Preprocessor ¶ added in v0.20.9
func Preprocessor(preprocessor PreprocessorMethod) Option
Preprocessor defines how the time series should be pre-processed.
type PreprocessorMethod ¶ added in v0.20.9
type PreprocessorMethod string
PreprocessorMethod defines the available pre-processing options.
type Reducer ¶
type Reducer string
Reducer operation describes how to aggregate data points from multiple time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series. See https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies#reducer
const ReduceCount Reducer = "REDUCE_COUNT"
const ReduceCountFalse Reducer = "REDUCE_COUNT_FALSE"
const ReduceCountFractionTrue Reducer = "REDUCE_FRACTION_TRUE"
const ReduceCountTrue Reducer = "REDUCE_COUNT_TRUE"
const ReduceMax Reducer = "REDUCE_MAX"
const ReduceMean Reducer = "REDUCE_MEAN"
const ReduceMin Reducer = "REDUCE_MIN"
const ReduceNone Reducer = "REDUCE_NONE"
const ReducePercentile05 Reducer = "REDUCE_PERCENTILE_05"
const ReducePercentile50 Reducer = "REDUCE_PERCENTILE_50"
const ReducePercentile95 Reducer = "REDUCE_PERCENTILE_95"
const ReducePercentile99 Reducer = "REDUCE_PERCENTILE_99"
const ReduceStdDev Reducer = "REDUCE_STDDEV"
const ReduceSum Reducer = "REDUCE_SUM"
type Stackdriver ¶
Stackdriver represents a stackdriver query.
func Cumulative ¶
func Cumulative(metricType string, options ...Option) *Stackdriver
Cumulative represents a value accumulated over a time interval. Cumulative measurements in a time series should have the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points.
func Delta ¶
func Delta(metricType string, options ...Option) *Stackdriver
Delta represents the change in a value during a time interval.
func Gauge ¶
func Gauge(metricType string, options ...Option) *Stackdriver
Gauge represents an instantaneous measurement of a value.