probes

package
v0.0.0-...-e1c190b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

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

Init initializes the probes defined in the config.

func RegisterProbeType

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

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)
}

Types

type Probe

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.

Directories

Path Synopsis
dns
Package dns implements a DNS prober.
Package dns implements a DNS prober.
cmd
Dns_bin implements a stand-alone dns prober binary using the cloudprober/probes/dns package.
Dns_bin implements a stand-alone dns prober binary using the cloudprober/probes/dns package.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package external implements an external probe type for cloudprober.
Package external implements an external probe type for cloudprober.
cmd
This program implements a stand-alone external prober binary using the cloudprober/probes/external package.
This program implements a stand-alone external prober binary using the cloudprober/probes/external package.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
serverutils
Package serverutils provides utilities to work with the cloudprober's external probe.
Package serverutils provides utilities to work with the cloudprober's external probe.
Package http implements HTTP probe type.
Package http implements HTTP probe type.
cmd
This program implements a stand-alone http prober binary using the cloudprober/http package.
This program implements a stand-alone http prober binary using the cloudprober/http package.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package options provides a shared interface to common probe options.
Package options provides a shared interface to common probe options.
Package ping implements a fast ping prober.
Package ping implements a fast ping prober.
cmd
This program implements a stand-alone ping prober binary using the cloudprober/ping package.
This program implements a stand-alone ping prober binary using the cloudprober/ping package.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
udp
Package udp implements a UDP prober.
Package udp implements a UDP prober.
cmd
Udp_bin implements a stand-alone udp prober binary using the cloudprober/probes/udp package.
Udp_bin implements a stand-alone udp prober binary using the cloudprober/probes/udp package.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
Package udplistener implements a UDP listener.
Package udplistener implements a UDP listener.
proto
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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