Documentation ¶
Index ¶
- Constants
- Variables
- func Run(ctx context.Context, wg *sync.WaitGroup, configPath string, once bool) error
- type AggregateDefinition
- type CommandProbe
- func (p *CommandProbe) GetGraphDefs() (*GraphsOutput, error)
- func (p *CommandProbe) HostID() string
- func (p *CommandProbe) MetricName(name string) string
- func (p *CommandProbe) PostGraphDefs(client *mackerel.Client, pc *CommandProbeConfig) error
- func (p *CommandProbe) Run(ctx context.Context) (ms HostMetrics, err error)
- func (p *CommandProbe) String() string
- type CommandProbeConfig
- type Config
- type Graph
- type GraphDefsMetric
- type GraphsOutput
- type HTTPProbe
- type HTTPProbeConfig
- type HostMetric
- type HostMetrics
- type MetricConfig
- type OutputConfig
- type PingProbe
- type PingProbeConfig
- type Probe
- type ProbeConfig
- type ProbeDefinition
- type ServiceMetric
- type ServiceMetrics
- type TCPProbe
- type TCPProbeConfig
Constants ¶
View Source
const CustomPrefix = "custom."
Variables ¶
View Source
var ( DefaultHTTPTimeout = 15 * time.Second DefaultHTTPMetricKeyPrefix = "http" )
View Source
var ( Version = "0.3.0" MaxConcurrency = 100 MaxClientConcurrency = 5 PostMetricBufferLength = 100 ProbeInterval = 60 * time.Second )
View Source
var ( DefaultPingTimeout = time.Second DefaultPingCount = 3 DefaultPingMetricName = "ping" )
View Source
var ( DefaultTCPTimeout = 5 * time.Second DefaultTCPMaxBytes = 32 * 1024 DefaultTCPMetricKeyPrefix = "tcp" )
View Source
var DefaultCommandTimeout = 15 * time.Second
Functions ¶
Types ¶
type AggregateDefinition ¶ added in v0.2.0
type AggregateDefinition struct { Service string `yaml:"service"` Role string `yaml:"role"` Roles []string `yaml:"roles"` Statuses []string `yaml:"statuses"` Metrics []*MetricConfig `yaml:"metrics"` }
type CommandProbe ¶
type CommandProbe struct { Command []string Timeout time.Duration GraphDefs bool // contains filtered or unexported fields }
func (*CommandProbe) GetGraphDefs ¶ added in v0.1.0
func (p *CommandProbe) GetGraphDefs() (*GraphsOutput, error)
func (*CommandProbe) HostID ¶
func (p *CommandProbe) HostID() string
func (*CommandProbe) MetricName ¶
func (p *CommandProbe) MetricName(name string) string
func (*CommandProbe) PostGraphDefs ¶ added in v0.1.0
func (p *CommandProbe) PostGraphDefs(client *mackerel.Client, pc *CommandProbeConfig) error
func (*CommandProbe) Run ¶
func (p *CommandProbe) Run(ctx context.Context) (ms HostMetrics, err error)
func (*CommandProbe) String ¶
func (p *CommandProbe) String() string
type CommandProbeConfig ¶
type CommandProbeConfig struct { RawCommand interface{} `yaml:"command"` Timeout time.Duration `yaml:"timeout"` GraphDefs bool `yaml:"graph_defs"` // contains filtered or unexported fields }
func (*CommandProbeConfig) GenerateProbe ¶
type Config ¶
type Config struct { Probes []*ProbeDefinition `yaml:"probes"` PostProbedMetrics bool `yaml:"post_probed_metrics"` Aggregates []*AggregateDefinition `yaml:"aggregates"` PostAggregatedMetrics bool `yaml:"post_aggregated_metrics"` ProbeOnly *bool `yaml:"probe_only"` // deprecated // contains filtered or unexported fields }
type Graph ¶ added in v0.1.0
type Graph struct { Label string `json:"label"` Unit string `json:"unit"` Metrics []GraphDefsMetric `json:"metrics"` }
type GraphDefsMetric ¶ added in v0.1.0
type GraphsOutput ¶ added in v0.1.0
type HTTPProbe ¶
type HTTPProbe struct { URL string Method string Headers map[string]string Body string ExpectPattern *regexp.Regexp Timeout time.Duration NoCheckCertificate bool // contains filtered or unexported fields }
func (*HTTPProbe) MetricName ¶
type HTTPProbeConfig ¶
type HTTPProbeConfig struct { URL string `yaml:"url"` Method string `yaml:"method"` Headers map[string]string `yaml:"headers"` Body string `yaml:"body"` ExpectPattern string `yaml:"expect_pattern"` Timeout time.Duration `yaml:"timeout"` NoCheckCertificate bool `yaml:"no_check_certificate"` MetricKeyPrefix string `yaml:"metric_key_prefix"` }
func (*HTTPProbeConfig) GenerateProbe ¶
func (pc *HTTPProbeConfig) GenerateProbe(host *mackerel.Host) (Probe, error)
type HostMetric ¶ added in v0.2.0
func (HostMetric) HostMetricValue ¶ added in v0.2.0
func (m HostMetric) HostMetricValue() *mackerel.HostMetricValue
func (HostMetric) String ¶ added in v0.2.0
func (m HostMetric) String() string
type HostMetrics ¶ added in v0.2.0
type HostMetrics []HostMetric
func (HostMetrics) String ¶ added in v0.2.0
func (ms HostMetrics) String() string
type MetricConfig ¶ added in v0.2.0
type MetricConfig struct { Name string `yaml:"name"` Outputs []*OutputConfig `yaml:"outputs"` }
type OutputConfig ¶ added in v0.2.0
type PingProbe ¶
type PingProbe struct { Address string Count int Timeout time.Duration // contains filtered or unexported fields }
func (*PingProbe) MetricName ¶
type PingProbeConfig ¶
type PingProbeConfig struct { Address string `yaml:"address"` Count int `yaml:"count"` Timeout time.Duration `yaml:"timeout"` MetricKeyPrefix string `yaml:"metric_key_prefix"` }
func (*PingProbeConfig) GenerateProbe ¶
func (pc *PingProbeConfig) GenerateProbe(host *mackerel.Host) (Probe, error)
type ProbeDefinition ¶
type ProbeDefinition struct { Service exString `yaml:"service"` Role exString `yaml:"role"` Roles []exString `yaml:"roles"` Statuses []exString `yaml:"statuses"` Ping *PingProbeConfig `yaml:"ping"` TCP *TCPProbeConfig `yaml:"tcp"` HTTP *HTTPProbeConfig `yaml:"http"` Command *CommandProbeConfig `yaml:"command"` }
func (*ProbeDefinition) GenerateProbes ¶
type ServiceMetric ¶ added in v0.2.0
func (ServiceMetric) MetricValue ¶ added in v0.2.0
func (m ServiceMetric) MetricValue() *mackerel.MetricValue
func (ServiceMetric) String ¶ added in v0.2.0
func (m ServiceMetric) String() string
type ServiceMetrics ¶ added in v0.2.0
type ServiceMetrics []ServiceMetric
func (ServiceMetrics) String ¶ added in v0.2.0
func (ms ServiceMetrics) String() string
type TCPProbe ¶
type TCPProbe struct { Host string Port string Send string Quit string MaxBytes int ExpectPattern *regexp.Regexp Timeout time.Duration TLS bool NoCheckCertificate bool // contains filtered or unexported fields }
func (*TCPProbe) MetricName ¶
type TCPProbeConfig ¶
type TCPProbeConfig struct { Host string `yaml:"host"` Port string `yaml:"port"` Timeout time.Duration `yaml:"timeout"` Send string `yaml:"send"` Quit string `yaml:"quiet"` MaxBytes int `yaml:"max_bytes"` ExpectPattern string `yaml:"expect_pattern"` TLS bool `yaml:"tls"` NoCheckCertificate bool `yaml:"no_check_certificate"` MetricKeyPrefix string `yaml:"metric_key_prefix"` }
func (*TCPProbeConfig) GenerateProbe ¶
func (pc *TCPProbeConfig) GenerateProbe(host *mackerel.Host) (Probe, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.