cloudprober: Index | Files | Directories

package probes

import ""

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


Package Files

probes.go probes_status_tmpl.go


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 (

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 {
    Options       *options.Options
    Name          string
    Type          string
    Interval      string
    Timeout       string
    TargetsDesc   string
    LatencyDistLB string
    LatencyUnit   string
    ProbeConf     string
    SourceIP      string

ProbeInfo encapsulates the probe and associated information.


dnsPackage dns implements a DNS prober.
dns/cmdDns_bin implements a stand-alone dns prober binary using the cloudprober/probes/dns package.
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/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.
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.
probeutilsPackage probeutils implements utilities that are shared across multiple probe types.
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.

Package probes imports 20 packages (graph) and is imported by 2 packages. Updated 2019-04-04. Refresh now. Tools for package owners.