Versions in this module Expand all Collapse all v1 v1.17.2 Nov 14, 2023 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) + Buildinfo func(ctx context.Context) (BuildinfoResult, error) + CleanTombstones func(ctx context.Context) error + Config func(ctx context.Context) (ConfigResult, error) + DeleteSeries func(ctx context.Context, matches []string, startTime, endTime time.Time) error + Flags func(ctx context.Context) (FlagsResult, error) + LabelNames func(ctx context.Context, matches []string, startTime, endTime time.Time) ([]string, Warnings, error) + LabelValues func(ctx context.Context, label string, matches []string, ...) (model.LabelValues, Warnings, error) + Metadata func(ctx context.Context, metric, limit string) (map[string][]Metadata, error) + Query func(ctx context.Context, query string, ts time.Time, opts ...Option) (model.Value, Warnings, error) + QueryExemplars func(ctx context.Context, query string, startTime, endTime time.Time) ([]ExemplarQueryResult, error) + QueryRange func(ctx context.Context, query string, r Range, opts ...Option) (model.Value, Warnings, error) + Rules func(ctx context.Context) (RulesResult, error) + Runtimeinfo func(ctx context.Context) (RuntimeinfoResult, error) + Series func(ctx context.Context, matches []string, startTime, endTime time.Time) ([]model.LabelSet, Warnings, error) + Snapshot func(ctx context.Context, skipHead bool) (SnapshotResult, error) + TSDB func(ctx context.Context) (TSDBResult, error) + Targets func(ctx context.Context) (TargetsResult, error) + TargetsMetadata func(ctx context.Context, matchTarget, metric, limit string) ([]MetricMetadata, error) + WalReplay func(ctx context.Context) (WalReplayStatus, error) + func NewAPI(c api.Client) API + type ActiveTarget struct + DiscoveredLabels map[string]string + GlobalURL string + Health HealthStatus + Labels model.LabelSet + LastError string + LastScrape time.Time + LastScrapeDuration float64 + ScrapePool string + 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 + EvaluationTime float64 + Health RuleHealth + Labels model.LabelSet + LastError string + LastEvaluation time.Time + Name string + Query string + State string + func (r *AlertingRule) UnmarshalJSON(b []byte) error + type AlertsResult struct + Alerts []Alert + type BuildinfoResult struct + Branch string + BuildDate string + BuildUser string + GoVersion string + Revision string + Version string + 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 Exemplar struct + Labels model.LabelSet + Timestamp model.Time + Value model.SampleValue + type ExemplarQueryResult struct + Exemplars []Exemplar + SeriesLabels model.LabelSet + type FlagsResult map[string]string + type HealthStatus string + type Metadata struct + Help string + Type MetricType + Unit string + type MetricMetadata struct + Help string + Metric string + Target map[string]string + Type MetricType + Unit string + type MetricType string + type Option func(c *apiOptions) + func WithTimeout(timeout time.Duration) Option + type Range struct + End time.Time + Start time.Time + Step time.Duration + type RecordingRule struct + EvaluationTime float64 + Health RuleHealth + Labels model.LabelSet + LastError string + LastEvaluation time.Time + 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 RuntimeinfoResult struct + CWD string + CorruptionCount int + GODEBUG string + GOGC string + GOMAXPROCS int + GoroutineCount int + LastConfigTime time.Time + ReloadConfigSuccess bool + StartTime time.Time + StorageRetention string + type SnapshotResult struct + Name string + type Stat struct + Name string + Value uint64 + type TSDBHeadStats struct + ChunkCount int + MaxTime int + MinTime int + NumLabelPairs int + NumSeries int + type TSDBResult struct + HeadStats TSDBHeadStats + LabelValueCountByLabelName []Stat + MemoryInBytesByLabelName []Stat + SeriesCountByLabelValuePair []Stat + SeriesCountByMetricName []Stat + type TargetsResult struct + Active []ActiveTarget + Dropped []DroppedTarget + type WalReplayStatus struct + Current int + Max int + Min int + type Warnings []string