Versions in this module Expand all Collapse all v0 v0.0.3 May 12, 2022 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, startTime time.Time, endTime time.Time) ([]string, Warnings, error) + LabelValues func(ctx context.Context, label string, startTime time.Time, endTime time.Time) (model.LabelValues, Warnings, error) + Metadata func(ctx context.Context, metric string, limit string) (map[string][]Metadata, error) + Query func(ctx context.Context, query string, ts time.Time) (model.Value, Warnings, error) + QueryRange func(ctx context.Context, query string, r Range) (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 time.Time, 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 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 ApiClient interface + Do func(context.Context, *http.Request) (*http.Response, []byte, Warnings, error) + DoGetFallback func(ctx context.Context, u *url.URL, args url.Values) (*http.Response, []byte, Warnings, error) + URL func(ep string, args map[string]string) *url.URL + func NewApiClient(c api.Client) ApiClient + 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 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 QueryResult queryResult + 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 RuntimeinfoResult struct + CWD string + ChunkCount int + CorruptionCount int + GODEBUG string + GOGC string + GOMAXPROCS int + GoroutineCount int + LastConfigTime time.Time + ReloadConfigSuccess bool + StartTime time.Time + StorageRetention string + TimeSeriesCount int + type SnapshotResult struct + Name string + type Stat struct + Name string + Value uint64 + type TSDBResult struct + LabelValueCountByLabelName []Stat + MemoryInBytesByLabelName []Stat + SeriesCountByLabelValuePair []Stat + SeriesCountByMetricName []Stat + type TargetsResult struct + Active []ActiveTarget + Dropped []DroppedTarget + type Warnings []string