Versions in this module Expand all Collapse all v1 v1.2.3 Nov 28, 2019 Changes in this version + const AlertStateFiring + const AlertStateInactive + const AlertStatePending + const ErrBadData + const ErrBadResponse + const ErrCanceled + const ErrClient + const ErrExec + const ErrServer + const ErrTimeout + const HealthBad + const HealthGood + const HealthUnknown + const MetricTypeCounter + const MetricTypeGauge + const MetricTypeGaugeHistogram + const MetricTypeHistogram + const MetricTypeInfo + const MetricTypeStateset + const MetricTypeSummary + const MetricTypeUnknown + const RuleHealthBad + const RuleHealthGood + const RuleHealthUnknown + const RuleTypeAlerting + const RuleTypeRecording + type API interface + AlertManagers func(ctx context.Context) (AlertManagersResult, error) + Alerts func(ctx context.Context) (AlertsResult, error) + CleanTombstones func(ctx context.Context) error + Config func(ctx context.Context) (ConfigResult, error) + DeleteSeries func(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) error + Flags func(ctx context.Context) (FlagsResult, error) + LabelNames func(ctx context.Context) ([]string, api.Warnings, error) + LabelValues func(ctx context.Context, label string) (model.LabelValues, api.Warnings, error) + Query func(ctx context.Context, query string, ts time.Time) (model.Value, api.Warnings, error) + QueryRange func(ctx context.Context, query string, r Range) (model.Value, api.Warnings, error) + Rules func(ctx context.Context) (RulesResult, error) + Series func(ctx context.Context, matches []string, startTime time.Time, endTime time.Time) ([]model.LabelSet, api.Warnings, error) + Snapshot func(ctx context.Context, skipHead bool) (SnapshotResult, error) + Targets func(ctx context.Context) (TargetsResult, error) + TargetsMetadata func(ctx context.Context, matchTarget string, metric string, limit string) ([]MetricMetadata, error) + func NewAPI(c api.Client) API + type ActiveTarget struct + DiscoveredLabels map[string]string + Health HealthStatus + Labels model.LabelSet + LastError string + LastScrape time.Time + ScrapeURL string + type Alert struct + ActiveAt time.Time + Annotations model.LabelSet + Labels model.LabelSet + State AlertState + Value string + type AlertManager struct + URL string + type AlertManagersResult struct + Active []AlertManager + Dropped []AlertManager + type AlertState string + type AlertingRule struct + Alerts []*Alert + Annotations model.LabelSet + Duration float64 + Health RuleHealth + Labels model.LabelSet + LastError string + Name string + Query string + func (r *AlertingRule) UnmarshalJSON(b []byte) error + type AlertsResult struct + Alerts []Alert + type ConfigResult struct + YAML string + type DroppedTarget struct + DiscoveredLabels map[string]string + type Error struct + Detail string + Msg string + Type ErrorType + func (e *Error) Error() string + type ErrorType string + type FlagsResult map[string]string + type HealthStatus string + type MetricMetadata struct + Help string + Metric string + Target map[string]string + Type MetricType + Unit string + type MetricType string + type Range struct + End time.Time + Start time.Time + Step time.Duration + type RecordingRule struct + Health RuleHealth + Labels model.LabelSet + LastError string + Name string + Query string + func (r *RecordingRule) UnmarshalJSON(b []byte) error + type RuleGroup struct + File string + Interval float64 + Name string + Rules Rules + func (rg *RuleGroup) UnmarshalJSON(b []byte) error + type RuleHealth string + type RuleType string + type Rules []interface + type RulesResult struct + Groups []RuleGroup + type SnapshotResult struct + Name string + type TargetsResult struct + Active []ActiveTarget + Dropped []DroppedTarget