func Project(project string) Option {
	return func(stackdriver *Stackdriver) {
		stackdriver.Builder.ProjectName = project
	}
}
Project defines the GCP project to use for this target.
package stackdriver
import "github.com/grafana-tools/sdk"
type Option func(target *Stackdriver)
const AlignmentStackdriverAuto = "stackdriver-auto"
const AlignmentGrafanaAuto = "grafana-auto"
type Aligner string
const AlignNone Aligner = "ALIGN_NONE"
const AlignDelta Aligner = "ALIGN_DELTA"
const AlignRate Aligner = "ALIGN_RATE"
const AlignInterpolate Aligner = "ALIGN_INTERPOLATE"
const AlignNextOlder Aligner = "ALIGN_NEXT_OLDER"
const AlignMin Aligner = "ALIGN_MIN"
const AlignMax Aligner = "ALIGN_MAX"
const AlignMean Aligner = "ALIGN_MEAN"
const AlignCount Aligner = "ALIGN_COUNT"
const AlignSum Aligner = "ALIGN_SUM"
const AlignStdDev Aligner = "ALIGN_STDDEV"
const AlignCountTrue Aligner = "ALIGN_COUNT_TRUE"
const AlignCountFalse Aligner = "ALIGN_COUNT_FALSE"
const AlignFractionTrue Aligner = "ALIGN_FRACTION_TRUE"
const AlignPercentile99 Aligner = "ALIGN_PERCENTILE_99"
const AlignPercentile95 Aligner = "ALIGN_PERCENTILE_95"
const AlignPercentile50 Aligner = "ALIGN_PERCENTILE_50"
const AlignPercentile05 Aligner = "ALIGN_PERCENTILE_05"
const AlignPercentChange Aligner = "ALIGN_PERCENT_CHANGE"
type Reducer string
const ReduceNone Reducer = "REDUCE_NONE"
const ReduceMean Reducer = "REDUCE_MEAN"
const ReduceMin Reducer = "REDUCE_MIN"
const ReduceMax Reducer = "REDUCE_MAX"
const ReduceSum Reducer = "REDUCE_SUM"
const ReduceStdDev Reducer = "REDUCE_STDDEV"
const ReduceCount Reducer = "REDUCE_COUNT"
const ReduceCountTrue Reducer = "REDUCE_COUNT_TRUE"
const ReduceCountFalse Reducer = "REDUCE_COUNT_FALSE"
const ReduceCountFractionTrue Reducer = "REDUCE_FRACTION_TRUE"
const ReducePercentile99 Reducer = "REDUCE_PERCENTILE_99"
const ReducePercentile95 Reducer = "REDUCE_PERCENTILE_95"
const ReducePercentile50 Reducer = "REDUCE_PERCENTILE_50"
const ReducePercentile05 Reducer = "REDUCE_PERCENTILE_05"
type Stackdriver struct {
	Builder *sdk.Target
}
func Delta(metricType string, options ...Option) *Stackdriver {
	return newMetric("DELTA", metricType, options...)
}
func Gauge(metricType string, options ...Option) *Stackdriver {
	return newMetric("GAUGE", metricType, options...)
}
func Cumulative(metricType string, options ...Option) *Stackdriver {
	return newMetric("CUMULATIVE", metricType, options...)
}
func newMetric(metricKind string, metricType string, options ...Option) *Stackdriver {
	stackdriver := &Stackdriver{
		Builder: &sdk.Target{
			MetricType:   metricType,
			MetricKind:   metricKind,
			AlignOptions: []sdk.StackdriverAlignOptions{defaultAlignmentOpts()},
			ValueType:    "INT64",
		},
	}
	for _, opt := range append(defaults(), options...) {
		opt(stackdriver)
	}
	return stackdriver
}
func defaults() []Option {
	return []Option{
		Aggregation(ReduceMean),
		Alignment(AlignDelta, AlignmentStackdriverAuto),
	}
}
func Ref(ref string) Option {
	return func(stackdriver *Stackdriver) {
		stackdriver.Builder.RefID = ref
	}
}
func Hide() Option {
	return func(stackdriver *Stackdriver) {
		stackdriver.Builder.Hide = true
	}
}
func Legend(legend string) Option {
	return func(stackdriver *Stackdriver) {
		stackdriver.Builder.AliasBy = legend
	}
}