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 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 {
    ProbeDef      *configpb.ProbeDef // Full probe definition
    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.

func CreateProbe Uses

func CreateProbe(p *configpb.ProbeDef, opts *options.Options) (*ProbeInfo, error)

CreateProbe creates a new probe.


common/statskeeperPackage statskeeper implements utilities that are shared across multiple probe types.
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.
grpcPackage grpc implements a gRPC 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 17 packages (graph) and is imported by 8 packages. Updated 2020-11-26. Refresh now. Tools for package owners.