promclient

package
v0.0.0-...-9250c3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	QueryClient
	RulesClient
}

type QueryClient

type QueryClient interface {
	Query(ctx context.Context, environment string, query string, opts ...QueryOption) (prom.Vector, error)
	QueryAll(ctx context.Context, query string, opts ...QueryOption) (prom.Vector, error)
	QueryRange(ctx context.Context, environment string, query string, promRange promv1.Range) (prom.Value, promv1.Warnings, error)
}

type QueryOption

type QueryOption func(*QueryOpts)

func WithTime

func WithTime(t time.Time) QueryOption

type QueryOpts

type QueryOpts struct {
	Time time.Time
}

type RealClient

type RealClient struct {
	// contains filtered or unexported fields
}

func New

func New(tenant string, log logrus.FieldLogger) (*RealClient, error)

func (*RealClient) Query

func (c *RealClient) Query(ctx context.Context, environmentName string, query string, opts ...QueryOption) (prom.Vector, error)

func (*RealClient) QueryAll

func (c *RealClient) QueryAll(ctx context.Context, query string, opts ...QueryOption) (prom.Vector, error)

func (*RealClient) QueryRange

func (c *RealClient) QueryRange(ctx context.Context, environment string, query string, promRange promv1.Range) (prom.Value, promv1.Warnings, error)

func (*RealClient) Rules

func (c *RealClient) Rules(ctx context.Context, environment string, teamSlug slug.Slug) (promv1.RulesResult, error)

func (*RealClient) RulesAll

func (c *RealClient) RulesAll(ctx context.Context, teamSlug slug.Slug) (map[string]promv1.RulesResult, error)

type RulesClient

type RulesClient interface {
	Rules(ctx context.Context, environment string, teamSlug slug.Slug) (promv1.RulesResult, error)
	RulesAll(ctx context.Context, teamSlug slug.Slug) (map[string]promv1.RulesResult, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL