apiv2

package
v1.8.2-0...-6f29659 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API encapsulates all API services.

func New

func New(
	db TSDBAdmin,
	dbDir string,
	enableAdmin bool,
) *API

New returns a new API object.

func (*API) HTTPHandler

func (api *API) HTTPHandler(ctx context.Context, grpcAddr string) (http.Handler, error)

HTTPHandler returns an HTTP handler for a REST API gateway to the given grpc address.

func (*API) RegisterGRPC

func (api *API) RegisterGRPC(srv *grpc.Server)

RegisterGRPC registers all API services with the given server.

type Admin

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

Admin provides an administration interface to Prometheus.

func NewAdmin

func NewAdmin(db TSDBAdmin, dbDir string) *Admin

NewAdmin returns a Admin server.

func (*Admin) DeleteSeries

DeleteSeries implements pb.AdminServer.

func (*Admin) TSDBCleanTombstones

TSDBCleanTombstones implements pb.AdminServer.

func (*Admin) TSDBSnapshot

func (s *Admin) TSDBSnapshot(_ context.Context, req *pb.TSDBSnapshotRequest) (*pb.TSDBSnapshotResponse, error)

TSDBSnapshot implements pb.AdminServer.

type AdminDisabled

type AdminDisabled struct {
}

AdminDisabled implements the administration interface that informs that the API endpoints are disabled.

func (*AdminDisabled) DeleteSeries

DeleteSeries implements pb.AdminServer.

func (*AdminDisabled) TSDBCleanTombstones

TSDBCleanTombstones implements pb.AdminServer.

func (*AdminDisabled) TSDBSnapshot

TSDBSnapshot implements pb.AdminServer.

type TSDBAdmin

type TSDBAdmin interface {
	CleanTombstones() error
	Delete(mint, maxt int64, ms ...*labels.Matcher) error
	Snapshot(dir string, withHead bool) error
}

TSDBAdmin defines the tsdb interfaces used by the v1 API for admin operations as well as statistics.

Jump to

Keyboard shortcuts

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