Documentation ¶
Index ¶
- func ExternalLabels(ctx context.Context, logger log.Logger, base *url.URL) (labels.Labels, error)
- func IsWALDirAccesible(dir string) error
- func PromqlQueryInstant(ctx context.Context, logger log.Logger, base *url.URL, query string, ...) (promql.Vector, error)
- func QueryInstant(ctx context.Context, logger log.Logger, base *url.URL, query string, ...) (model.Vector, error)
- func Snapshot(ctx context.Context, logger log.Logger, base *url.URL, skipHead bool) (string, error)
- type Flags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExternalLabels ¶
ExternalLabels returns external labels from /api/v1/status/config Prometheus endpoint. Note that configuration can be hot reloadable on Prometheus, so this config might change in runtime.
func IsWALDirAccesible ¶
IsWALFileAccesible returns no error if WAL dir can be found. This helps to tell if we have access to Prometheus TSDB directory.
func PromqlQueryInstant ¶
func PromqlQueryInstant(ctx context.Context, logger log.Logger, base *url.URL, query string, t time.Time, dedup bool) (promql.Vector, error)
PromqlQueryInstant performs instant query and returns results in promql.Vector type that is compatible with promql package.
func QueryInstant ¶
func QueryInstant(ctx context.Context, logger log.Logger, base *url.URL, query string, t time.Time, dedup bool) (model.Vector, error)
QueryInstant performs instant query and returns results in model.Vector type.
Types ¶
type Flags ¶
type Flags struct { TSDBPath string `json:"storage.tsdb.path"` TSDBRetention model.Duration `json:"storage.tsdb.retention"` TSDBMinTime model.Duration `json:"storage.tsdb.min-block-duration"` TSDBMaxTime model.Duration `json:"storage.tsdb.max-block-duration"` WebEnableAdminAPI bool `json:"web.enable-admin-api"` WebEnableLifecycle bool `json:"web.enable-lifecycle"` }
func ConfiguredFlags ¶
ConfiguredFlags returns configured flags from /api/v1/status/flags Prometheus endpoint. Added to Prometheus from v2.2.
func (*Flags) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.