prober

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 48 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Probers = map[string]ProbeFn{
		"http": ProbeHTTP,
		"tcp":  ProbeTCP,
		"icmp": ProbeICMP,
		"dns":  ProbeDNS,
		"grpc": ProbeGRPC,
	}
)

Functions

func DebugOutput added in v0.23.0

func DebugOutput(module *config.Module, logBuffer *bytes.Buffer, registry *prometheus.Registry) string

DebugOutput returns plaintext debug output for a probe.

func Handler added in v0.23.0

func Handler(w http.ResponseWriter, r *http.Request, c *config.Config, logger log.Logger, rh *ResultHistory, timeoutOffset float64, params url.Values,
	moduleUnknownCounter prometheus.Counter,
	logLevelProber level.Option)

func ProbeDNS

func ProbeDNS(ctx context.Context, target string, module config.Module, registry *prometheus.Registry, logger log.Logger) bool

func ProbeGRPC added in v0.20.0

func ProbeGRPC(ctx context.Context, target string, module config.Module, registry *prometheus.Registry, logger log.Logger) (success bool)

func ProbeHTTP

func ProbeHTTP(ctx context.Context, target string, module config.Module, registry *prometheus.Registry, logger log.Logger) (success bool)

func ProbeICMP

func ProbeICMP(ctx context.Context, target string, module config.Module, registry *prometheus.Registry, logger log.Logger) (success bool)

func ProbeTCP

func ProbeTCP(ctx context.Context, target string, module config.Module, registry *prometheus.Registry, logger log.Logger) bool

Types

type GRPCHealthCheck added in v0.20.0

type GRPCHealthCheck interface {
	Check(c context.Context, service string) (bool, codes.Code, *peer.Peer, string, error)
}

func NewGrpcHealthCheckClient added in v0.20.0

func NewGrpcHealthCheckClient(conn *grpc.ClientConn) GRPCHealthCheck

type ProbeFn

type ProbeFn func(ctx context.Context, target string, config config.Module, registry *prometheus.Registry, logger log.Logger) bool

type Result added in v0.23.0

type Result struct {
	Id          int64
	ModuleName  string
	Target      string
	DebugOutput string
	Success     bool
}

Result contains the result of the execution of a probe

type ResultHistory added in v0.23.0

type ResultHistory struct {
	MaxResults uint
	// contains filtered or unexported fields
}

ResultHistory contains two history slices: `results` contains most recent `maxResults` results. After they expire out of `results`, failures will be saved in `preservedFailedResults`. This ensures that we are always able to see debug information about recent failures.

func (*ResultHistory) Add added in v0.23.0

func (rh *ResultHistory) Add(moduleName, target, debugOutput string, success bool)

Add a result to the history.

func (*ResultHistory) GetById added in v0.25.0

func (rh *ResultHistory) GetById(id int64) *Result

Get returns a given result by id.

func (*ResultHistory) GetByTarget added in v0.25.0

func (rh *ResultHistory) GetByTarget(target string) *Result

Get returns a given result by url.

func (*ResultHistory) List added in v0.23.0

func (rh *ResultHistory) List() []*Result

List returns a list of all results.

Jump to

Keyboard shortcuts

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