Documentation ¶
Index ¶
- Variables
- func ExternalLabels(ctx context.Context, logger log.Logger, base *url.URL) (labels.Labels, error)
- func IsWALDirAccesible(dir string) error
- func MetricValues(ctx context.Context, logger log.Logger, base *url.URL, ...) error
- func PromqlQueryInstant(ctx context.Context, logger log.Logger, base *url.URL, query string, ...) (promql.Vector, []string, error)
- func QueryInstant(ctx context.Context, logger log.Logger, base *url.URL, query string, ...) (model.Vector, []string, error)
- func Snapshot(ctx context.Context, logger log.Logger, base *url.URL, skipHead bool) (string, error)
- type Flags
- type QueryOptions
Constants ¶
This section is empty.
Variables ¶
var ErrFlagEndpointNotFound = errors.New("no flag endpoint found")
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 ¶
IsWALDirAccesible returns no error if WAL dir can be found. This helps to tell if we have access to Prometheus TSDB directory.
func MetricValues ¶ added in v0.7.0
func MetricValues(ctx context.Context, logger log.Logger, base *url.URL, perMetricFn func(metric promlabels.Labels, val float64) error) error
MetricValues returns current value of instant query and returns results in model.Vector type.
func PromqlQueryInstant ¶
func PromqlQueryInstant(ctx context.Context, logger log.Logger, base *url.URL, query string, t time.Time, opts QueryOptions) (promql.Vector, []string, 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, opts QueryOptions) (model.Vector, []string, 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.
type QueryOptions ¶ added in v0.7.0
type QueryOptions struct { Deduplicate bool PartialResponseStrategy storepb.PartialResponseStrategy }