Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GCMServiceAccountOrFail ¶
GCMServiceAccountOrFail gets the Google SA JSON content from GCM_SECRET environment variable or fails.
func NewIngestionTest ¶
NewIngestionTest takes testing T and returns test instance as well as registry that can be used to register test metrics.
NOTE(bwplotka): All test functionality fails tests on error (instead of returning error).
func NoopBackend ¶
func NoopBackend() noopBackend
NoopBackend creates noop backend, useful when you want to skip one backend for local debugging purpose without changing test significantly.
Types ¶
type Backend ¶
type Backend interface { Ref() string // contains filtered or unexported methods }
func LocalExportWithGCM ¶
LocalExportWithGCM represents locally imported export pkg with GCM as a backend. In particular this backend is mimicking our GMP collector, while allowing quickest feedback loop for experiment and using IDE debuggers.
In particular this backend uses following data models, which is what our Prometheus fork is doing when scraping any scrape target:
* (Exposed to user) Go Prometheus SDK client types e.g. prometheus.NewCounter. * Go Prometheus SDK dto (Prometheus proto exposition format https://github.com/prometheus/client_model/blob/master/io/prometheus/client/metrics.proto). * Internal Prometheus parser (https://pkg.go.dev/github.com/prometheus/prometheus/pkg/textparse). * Internal Prometheus TSDB (head block) dto (e.g. records https://pkg.go.dev/github.com/prometheus/prometheus@v0.47.2/tsdb/record). * GCM monitoring API proto ingested by Monarch.
func Prometheus ¶
type ExpectationsRecorder ¶
type ExpectationsRecorder interface {
Expect(val float64, metric prometheus.Metric, b Backend) ExpectationsRecorder
}
type Scrape ¶
type Scrape func(after time.Duration) ExpectationsRecorder