external

package
v0.0.0-...-eff70b3 Latest Latest
Warning

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

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

Documentation

Overview

Package external is a generated protocol buffer package.

It is generated from these files:

github.com/google/cloudprober/probes/external/config.proto

It has these top-level messages:

ProbeConf
OutputMetricsOptions

Package external implements an external probe type for cloudprober.

External probe type executes an external process for actual probing. These probes can have two modes: "once" and "server". In "once" mode, the external process is started for each probe run cycle, while in "server" mode, external process is started only if it's not running already and Cloudprober communicates with it over stdin/stdout for each probe cycle.

TODO: Add a way to test this program. Write another program that implements the probe server protocol and use that for testing.

Index

Constants

View Source
const Default_OutputMetricsOptions_AggregateInCloudprober bool = false
View Source
const Default_ProbeConf_IpVersion int32 = 4
View Source
const Default_ProbeConf_OutputAsMetrics bool = true

Variables

View Source
var OutputMetricsOptions_MetricsKind_name = map[int32]string{
	0: "UNDEFINED",
	1: "GAUGE",
	2: "CUMULATIVE",
}
View Source
var OutputMetricsOptions_MetricsKind_value = map[string]int32{
	"UNDEFINED":  0,
	"GAUGE":      1,
	"CUMULATIVE": 2,
}
View Source
var ProbeConf_Mode_name = map[int32]string{
	0: "ONCE",
	1: "SERVER",
}
View Source
var ProbeConf_Mode_value = map[string]int32{
	"ONCE":   0,
	"SERVER": 1,
}
View Source
var (
	// TimeBetweenRequests is the time interval between probe requests for
	// multiple targets. In server mode, probe requests for multiple targets are
	// sent to the same external probe process. Sleeping between requests provides
	// some time buffer for the probe process to dequeue the incoming requests and
	// avoids filling up the communication pipe.
	//
	// Note that this value impacts the effective timeout for a target as timeout
	// is applied for all the targets in aggregate. For example, 100th target in
	// the targets list will have the effective timeout of (timeout - 1ms).
	// TODO: Make sure that the last target in the list has an impact of
	// less than 1% on its timeout.
	TimeBetweenRequests = 10 * time.Microsecond
)

Functions

This section is empty.

Types

type OutputMetricsOptions

type OutputMetricsOptions struct {
	MetricsKind *OutputMetricsOptions_MetricsKind `` /* 154-byte string literal not displayed */
	// Additional labels (comma-separated) to attach to the output metrics, e.g.
	// "region=us-east1,zone=us-east1-d". ptype="external" and probe="<probeName>"
	// are attached automatically.
	AdditionalLabels *string `protobuf:"bytes,2,opt,name=additional_labels,json=additionalLabels" json:"additional_labels,omitempty"`
	// Whether to aggregate metrics in Cloudprober. If enabled, Cloudprober
	// aggregates the metrics returned by the external probe process -- external
	// probe process should return metrics only since the last probe run.
	// Note that this option is mutually exclusive with GAUGE metrics and
	// cloudprober will fail during initialization if both options are enabled.
	AggregateInCloudprober *bool `` /* 129-byte string literal not displayed */
	// Metrics that should be treated as distributions. These metrics are exported
	// by the external probe program as comma-separated list of values, for
	// example: "op_latency 4.7,5.6,5.9,6.1,4.9". To be able to build distribution
	// from these values, these metrics should be pre-configured in external
	// probe:
	// dist_metric {
	//   key: "op_latency"
	//   value {
	//     explicit_buckets: "1,2,4,8,16,32,64,128,256"
	//   }
	// }
	DistMetric       map[string]*cloudprober_metrics.Dist `` /* 158-byte string literal not displayed */
	XXX_unrecognized []byte                               `json:"-"`
}

func (*OutputMetricsOptions) Descriptor

func (*OutputMetricsOptions) Descriptor() ([]byte, []int)

func (*OutputMetricsOptions) GetAdditionalLabels

func (m *OutputMetricsOptions) GetAdditionalLabels() string

func (*OutputMetricsOptions) GetAggregateInCloudprober

func (m *OutputMetricsOptions) GetAggregateInCloudprober() bool

func (*OutputMetricsOptions) GetDistMetric

func (m *OutputMetricsOptions) GetDistMetric() map[string]*cloudprober_metrics.Dist

func (*OutputMetricsOptions) GetMetricsKind

func (*OutputMetricsOptions) ProtoMessage

func (*OutputMetricsOptions) ProtoMessage()

func (*OutputMetricsOptions) Reset

func (m *OutputMetricsOptions) Reset()

func (*OutputMetricsOptions) String

func (m *OutputMetricsOptions) String() string

type OutputMetricsOptions_MetricsKind

type OutputMetricsOptions_MetricsKind int32

MetricsKind specifies whether to treat output metrics as GAUGE or CUMULATIVE. If left unspecified, metrics from ONCE mode probes are treated as GAUGE and metrics from SERVER mode probes are treated as CUMULATIVE.

const (
	OutputMetricsOptions_UNDEFINED  OutputMetricsOptions_MetricsKind = 0
	OutputMetricsOptions_GAUGE      OutputMetricsOptions_MetricsKind = 1
	OutputMetricsOptions_CUMULATIVE OutputMetricsOptions_MetricsKind = 2
)

func (OutputMetricsOptions_MetricsKind) Enum

func (OutputMetricsOptions_MetricsKind) EnumDescriptor

func (OutputMetricsOptions_MetricsKind) EnumDescriptor() ([]byte, []int)

func (OutputMetricsOptions_MetricsKind) String

func (*OutputMetricsOptions_MetricsKind) UnmarshalJSON

func (x *OutputMetricsOptions_MetricsKind) UnmarshalJSON(data []byte) error

type Probe

type Probe struct {
	// contains filtered or unexported fields
}

Probe holds aggregate information about all probe runs, per-target.

func (*Probe) Init

func (p *Probe) Init(name string, opts *options.Options) error

Init initializes the probe with the given params.

func (*Probe) Start

func (p *Probe) Start(ctx context.Context, dataChan chan *metrics.EventMetrics)

Start starts and runs the probe indefinitely.

type ProbeConf

type ProbeConf struct {
	Mode *ProbeConf_Mode `protobuf:"varint,1,opt,name=mode,enum=cloudprober.probes.external.ProbeConf_Mode,def=0" json:"mode,omitempty"`
	// Command.  For ONCE probes, arguments are processed for the following field
	// substitutions:
	// @probe@    Name of the probe
	// @target@   Hostname of the target
	// @address@  IP address of the target
	//
	// For example, for target ig-us-central1-a, /tools/recreate_vm -vm @target@
	// will get converted to: /tools/recreate_vm -vm ig-us-central1-a
	Command *string             `protobuf:"bytes,2,req,name=command" json:"command,omitempty"`
	Options []*ProbeConf_Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
	// Export output as metrics, where output is the output returned by the
	// external probe process, over stdout for ONCE probes, and through ProbeReply
	// for SERVER probes. Cloudprober expects variables to be in the following
	// format in the output:
	// var1 value1 (for example: total_errors 589)
	OutputAsMetrics      *bool                 `protobuf:"varint,4,opt,name=output_as_metrics,json=outputAsMetrics,def=1" json:"output_as_metrics,omitempty"`
	OutputMetricsOptions *OutputMetricsOptions `protobuf:"bytes,5,opt,name=output_metrics_options,json=outputMetricsOptions" json:"output_metrics_options,omitempty"`
	// IP version: For target resolution
	IpVersion        *int32 `protobuf:"varint,100,opt,name=ip_version,json=ipVersion,def=4" json:"ip_version,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*ProbeConf) Descriptor

func (*ProbeConf) Descriptor() ([]byte, []int)

func (*ProbeConf) GetCommand

func (m *ProbeConf) GetCommand() string

func (*ProbeConf) GetIpVersion

func (m *ProbeConf) GetIpVersion() int32

func (*ProbeConf) GetMode

func (m *ProbeConf) GetMode() ProbeConf_Mode

func (*ProbeConf) GetOptions

func (m *ProbeConf) GetOptions() []*ProbeConf_Option

func (*ProbeConf) GetOutputAsMetrics

func (m *ProbeConf) GetOutputAsMetrics() bool

func (*ProbeConf) GetOutputMetricsOptions

func (m *ProbeConf) GetOutputMetricsOptions() *OutputMetricsOptions

func (*ProbeConf) ProtoMessage

func (*ProbeConf) ProtoMessage()

func (*ProbeConf) Reset

func (m *ProbeConf) Reset()

func (*ProbeConf) String

func (m *ProbeConf) String() string

type ProbeConf_Mode

type ProbeConf_Mode int32

External probes support two mode: ONCE and SERVER. In ONCE mode, external command is re-executed for each probe run, while in SERVER mode, command is run in server mode, re-executed only if not running already.

const (
	ProbeConf_ONCE   ProbeConf_Mode = 0
	ProbeConf_SERVER ProbeConf_Mode = 1
)
const Default_ProbeConf_Mode ProbeConf_Mode = ProbeConf_ONCE

func (ProbeConf_Mode) Enum

func (x ProbeConf_Mode) Enum() *ProbeConf_Mode

func (ProbeConf_Mode) EnumDescriptor

func (ProbeConf_Mode) EnumDescriptor() ([]byte, []int)

func (ProbeConf_Mode) String

func (x ProbeConf_Mode) String() string

func (*ProbeConf_Mode) UnmarshalJSON

func (x *ProbeConf_Mode) UnmarshalJSON(data []byte) error

type ProbeConf_Option

type ProbeConf_Option struct {
	Name             *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Value            *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

Options for the SERVER mode probe requests. These options are passed on to the external probe server as part of the ProbeRequest. Values are substituted similar to command arguments for the ONCE mode probes.

func (*ProbeConf_Option) Descriptor

func (*ProbeConf_Option) Descriptor() ([]byte, []int)

func (*ProbeConf_Option) GetName

func (m *ProbeConf_Option) GetName() string

func (*ProbeConf_Option) GetValue

func (m *ProbeConf_Option) GetValue() string

func (*ProbeConf_Option) ProtoMessage

func (*ProbeConf_Option) ProtoMessage()

func (*ProbeConf_Option) Reset

func (m *ProbeConf_Option) Reset()

func (*ProbeConf_Option) String

func (m *ProbeConf_Option) String() string

Directories

Path Synopsis
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.
Package serverutils is a generated protocol buffer package.
Package serverutils is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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