stackdriver

package
v0.11.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const AlignmentGrafanaAuto = "grafana-auto"
View Source
const AlignmentStackdriverAuto = "stackdriver-auto"

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

func Aggregation(reducer Reducer) Option

Aggregation defines how the time series will be aggregated.

func Alignment

func Alignment(aligner Aligner, alignmentPeriod string) Option

Alignment defines how the time series will be aligned.

func Filter

func Filter(filters ...FilterOption) Option

Filter allows to specify which time series will be in the results.

func Hide

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

func Legend(legend string) Option

Legend sets the legend format. See https://grafana.com/docs/grafana/latest/features/datasources/stackdriver/#alias-patterns for more information on allowed patterns.

func Ref

func Ref(ref string) Option

Ref sets the reference ID for this query.

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

type Stackdriver struct {
	Builder *sdk.Target
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL