Documentation
¶
Index ¶
- Constants
- Variables
- func GetSSMParameter(ctx context.Context, name string) (string, error)
- func Run(ctx context.Context, wg *sync.WaitGroup, configPath string, once bool) error
- func RunFirehoseEndpoint(ctx context.Context, wg *sync.WaitGroup, port int)
- type AggregateDefinition
- type Attribute
- type BackupConfig
- type Channels
- type Client
- type CommandProbe
- func (p *CommandProbe) GetGraphDefs() (*GraphsOutput, error)
- func (p *CommandProbe) MetricName(name string) string
- func (p *CommandProbe) PostGraphDefs(client *mackerel.Client, pc *CommandProbeConfig) error
- func (p *CommandProbe) Run(_ context.Context) (ms Metrics, err error)
- func (p *CommandProbe) String() string
- func (p *CommandProbe) TempDir() string
- type CommandProbeConfig
- type Config
- type DestinationConfig
- type Graph
- type GraphDefsMetric
- type GraphsOutput
- type HTTPProbe
- type HTTPProbeConfig
- type HostMetric
- type HostMetrics
- type MackerelConfig
- type Metric
- type MetricConfig
- type Metrics
- type OtelConfig
- type OtelMetric
- type OutputConfig
- type PingProbe
- type PingProbeConfig
- type Probe
- type ProbeConfig
- type ProbeDefinition
- func (pd *ProbeDefinition) GenerateProbes(host *mackerel.Host, client *mackerel.Client) []Probe
- func (pd *ProbeDefinition) RunHostProbes(ctx context.Context, client *Client) []HostMetric
- func (pd *ProbeDefinition) RunProbes(ctx context.Context, client *Client, chs *Channels, wg *sync.WaitGroup)
- func (pd *ProbeDefinition) RunServiceProbes(ctx context.Context, client *Client) []ServiceMetric
- func (pd *ProbeDefinition) Validate() error
- 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 = "HEAD" MaxConcurrency = 100 MaxClientConcurrency = 5 PostMetricBufferLength = 100 ProbeInterval = 60 * time.Second MackerelAPIKey string )
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 ¶
func GetSSMParameter ¶ added in v0.5.1
Types ¶
type AggregateDefinition ¶ added in v0.2.0
type AggregateDefinition struct { Service exString `yaml:"service"` Role exString `yaml:"role"` Roles []exString `yaml:"roles"` Statuses []exString `yaml:"statuses"` Metrics []*MetricConfig `yaml:"metrics"` }
type Attribute ¶ added in v0.7.0
func (*Attribute) Otel ¶ added in v0.7.0
func (a *Attribute) Otel() *otelattribute.Set
type BackupConfig ¶ added in v0.4.0
type BackupConfig struct {
FirehoseStreamName string `yaml:"firehose_stream_name"`
}
type Channels ¶ added in v0.7.0
type Channels struct { ServiceMetrics chan ServiceMetric HostMetrics chan HostMetric OtelMetrics chan Metric Destination *DestinationConfig }
func NewChannels ¶ added in v0.7.0
func NewChannels(dst *DestinationConfig) *Channels
func (*Channels) SendAggregatedMetric ¶ added in v0.7.0
func (ch *Channels) SendAggregatedMetric(m ServiceMetric)
func (*Channels) SendHostMetric ¶ added in v0.7.0
func (ch *Channels) SendHostMetric(m HostMetric)
func (*Channels) SendServiceMetric ¶ added in v0.7.0
func (ch *Channels) SendServiceMetric(m ServiceMetric)
type Client ¶ added in v0.4.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) PostHostMetricValues ¶ added in v0.4.0
func (c *Client) PostHostMetricValues(mvs []*mackerel.HostMetricValue) error
func (*Client) PostServiceMetricValues ¶ added in v0.4.0
func (c *Client) PostServiceMetricValues(serviceName string, mvs []*mackerel.MetricValue) error
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) 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) String ¶
func (p *CommandProbe) String() string
func (*CommandProbe) TempDir ¶ added in v0.3.5
func (p *CommandProbe) TempDir() string
type CommandProbeConfig ¶
type CommandProbeConfig struct { RawCommand interface{} `yaml:"command"` Timeout time.Duration `yaml:"timeout"` GraphDefs bool `yaml:"graph_defs"` Env map[string]string `yaml:"env"` // 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 Backup *BackupConfig `yaml:"backup"` Destination *DestinationConfig `yaml:"destination"` // contains filtered or unexported fields }
type DestinationConfig ¶ added in v0.7.0
type DestinationConfig struct { Mackerel *MackerelConfig `yaml:"mackerel"` Otel *OtelConfig `yaml:"otel"` }
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 MackerelConfig ¶ added in v0.7.0
type MackerelConfig struct {
Enabled bool `yaml:"enabled"`
}
type Metric ¶
func (Metric) HostMetric ¶ added in v0.6.0
func (m Metric) HostMetric(hostID string) HostMetric
func (Metric) Otel ¶ added in v0.7.0
func (m Metric) Otel() otelmetricdata.Metrics
func (Metric) OtelString ¶ added in v0.7.0
func (Metric) ServiceMetric ¶ added in v0.6.0
func (m Metric) ServiceMetric(service string) ServiceMetric
type MetricConfig ¶ added in v0.2.0
type MetricConfig struct { Name exString `yaml:"name"` Outputs []*OutputConfig `yaml:"outputs"` }
type OtelConfig ¶ added in v0.7.0
type OtelMetric ¶ added in v0.7.0
type OtelMetric interface { ServiceMetric | HostMetric }
type OutputConfig ¶ added in v0.2.0
type OutputConfig struct { Func exString `yaml:"func"` Name exString `yaml:"name"` EmitZero bool `yaml:"emit_zero"` // contains filtered or unexported fields }
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"` IsServiceMetric bool `yaml:"service_metric"` Ping *PingProbeConfig `yaml:"ping"` TCP *TCPProbeConfig `yaml:"tcp"` HTTP *HTTPProbeConfig `yaml:"http"` Command *CommandProbeConfig `yaml:"command"` Attributes map[string]string `yaml:"attributes"` }
func (*ProbeDefinition) GenerateProbes ¶
func (*ProbeDefinition) RunHostProbes ¶ added in v0.6.0
func (pd *ProbeDefinition) RunHostProbes(ctx context.Context, client *Client) []HostMetric
func (*ProbeDefinition) RunServiceProbes ¶ added in v0.6.0
func (pd *ProbeDefinition) RunServiceProbes(ctx context.Context, client *Client) []ServiceMetric
func (*ProbeDefinition) Validate ¶ added in v0.6.0
func (pd *ProbeDefinition) Validate() error
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.