cloudprober: github.com/google/cloudprober/probes Index | Files | Directories

package probes

import "github.com/google/cloudprober/probes"

Package probes provides an interface to initialize probes using prober config.

Index

Package Files

probes.go probes_status_tmpl.go

Variables

var StatusTmpl = template.Must(template.New("statusTmpl").Parse("" /* 665 byte string literal not displayed */,
))

StatusTmpl variable stores the HTML template suitable to generate the probes' status for cloudprober's /status page. It expects an array of ProbeInfo objects as input.

func Init Uses

func Init(probeProtobufs []*configpb.ProbeDef, globalTargetsOpts *targetspb.GlobalTargetsOptions, l *logger.Logger, sysVars map[string]string) (map[string]*ProbeInfo, error)

Init initializes the probes defined in the config.

func RegisterProbeType Uses

func RegisterProbeType(extensionFieldNo int, newProbeFunc func() Probe)

RegisterProbeType registers a new probe-type. New probe types are integrated with the config subsystem using the protobuf extensions.

TODO(manugarg): Add a full example of using extensions.

func RegisterUserDefined Uses

func RegisterUserDefined(name string, probe Probe)

RegisterUserDefined allows you to register a user defined probe with cloudprober. Example usage:

import (
	"github.com/google/cloudprober"
	"github.com/google/cloudprober/probes"
)

p := &FancyProbe{}
probes.RegisterUserDefined("fancy_probe", p)
pr, err := cloudprober.InitFromConfig(*configFile)
if err != nil {
	log.Exitf("Error initializing cloudprober. Err: %v", err)
}

type Probe Uses

type Probe interface {
    Init(name string, opts *options.Options) error
    Start(ctx context.Context, dataChan chan *metrics.EventMetrics)
}

Probe interface represents a probe.

A probe is initilized using the Init() method. Init takes the name of the probe and probe options.

Start() method starts the probe. Start is not expected to return for the lifetime of the prober. It takes a data channel that it writes the probe results on. Actual publishing of these results is handled by cloudprober itself.

type ProbeInfo Uses

type ProbeInfo struct {
    Probe
    Name          string
    Type          string
    Interval      string
    Timeout       string
    TargetsDesc   string
    LatencyDistLB string
    LatencyUnit   string
    ProbeConf     string
}

ProbeInfo encapsulates the probe and associated information.

Directories

PathSynopsis
dnsPackage dns implements a DNS prober.
dns/cmdDns_bin implements a stand-alone dns prober binary using the cloudprober/probes/dns package.
dns/proto
externalPackage external implements an external probe type for cloudprober.
external/cmdThis program implements a stand-alone external prober binary using the cloudprober/probes/external package.
external/proto
external/serverutilsPackage serverutils provides utilities to work with the cloudprober's external probe.
httpPackage http implements HTTP probe type.
http/cmdThis program implements a stand-alone http prober binary using the cloudprober/http package.
http/proto
optionsPackage options provides a shared interface to common probe options.
pingPackage ping implements a fast ping prober.
ping/cmdThis program implements a stand-alone ping prober binary using the cloudprober/ping package.
ping/proto
probeutils
proto
udpPackage udp implements a UDP prober.
udp/cmdUdp_bin implements a stand-alone udp prober binary using the cloudprober/probes/udp package.
udplistenerPackage udplistener implements a UDP listener.
udplistener/proto
udp/proto

Package probes imports 23 packages (graph) and is imported by 1 packages. Updated 2018-12-19. Refresh now. Tools for package owners.