circonus

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: BSD-3-Clause Imports: 42 Imported by: 0

Documentation

Overview

Package circonus contains methods for interfacing with circonus

Index

Constants

View Source
const (
	// MetricTypeInt32 reconnoiter
	MetricTypeInt32 = "i"

	// MetricTypeUint32 reconnoiter
	MetricTypeUint32 = "I"

	// MetricTypeInt64 reconnoiter
	MetricTypeInt64 = "l"

	// MetricTypeUint64 reconnoiter
	MetricTypeUint64 = "L"

	// MetricTypeFloat64 reconnoiter
	MetricTypeFloat64 = "n"

	// MetricTypeString reconnoiter
	MetricTypeString = "s"

	// MetricTypeHistogram reconnoiter
	MetricTypeHistogram = "h"

	// MetricTypeCumulativeHistogram reconnoiter
	MetricTypeCumulativeHistogram = "H"

	MaxTagLen = 256
	MaxTagCat = 254

	// MaxTags reconnoiter will accept in stream tagged metric name
	MaxTags = 256 // sync w/MAX_TAGS https://github.com/circonus-labs/reconnoiter/blob/master/src/noit_metric.h#L41

	// MaxMetricNameLen reconnoiter will accept (name+stream tags)
	MaxMetricNameLen = 4096 // sync w/MAX_METRIC_TAGGED_NAME https://github.com/circonus-labs/reconnoiter/blob/master/src/noit_metric.h#L40
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertContact added in v0.9.0

type AlertContact struct {
	Email    string `json:"email"`
	GroupCID string `json:"group_cid"`
}

type Check

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

func NewCheck

func NewCheck(parentLogger zerolog.Logger, cfg *config.Circonus, clusterName string) (*Check, error)

func (*Check) AddGauge added in v0.5.0

func (c *Check) AddGauge(metricName string, tags cgm.Tags, value interface{})

AddGauge to queue for submission

func (*Check) AddHistSample added in v0.5.0

func (c *Check) AddHistSample(metricName string, tags cgm.Tags, value float64)

AddHistSample to queue for submission

func (*Check) AddText added in v0.5.0

func (c *Check) AddText(metricName string, tags cgm.Tags, value string)

AddText to queue for submission

func (*Check) DefaultCGMTags added in v0.9.10

func (c *Check) DefaultCGMTags() cgm.Tags

DefaultCGMTags returns the list of default tags in CGM format

func (*Check) FlushCGM added in v0.5.0

func (c *Check) FlushCGM(ctx context.Context, ts *time.Time, lg zerolog.Logger, agentStats bool)

func (*Check) IncrementCounter added in v0.5.0

func (c *Check) IncrementCounter(metricName string, tags cgm.Tags)

IncrementCounter to queue for submission

func (*Check) IncrementCounterByValue added in v0.9.5

func (c *Check) IncrementCounterByValue(metricName string, tags cgm.Tags, val uint64)

IncrementCounterByValue to queue for submission

func (*Check) LogAgentMetrics added in v0.9.10

func (c *Check) LogAgentMetrics() bool

LogAgentMetrics will dump the submission request to stdout

func (*Check) NewTagList added in v0.10.0

func (c *Check) NewTagList(tagSets ...[]string) []string

func (*Check) QueueMetricSample

func (c *Check) QueueMetricSample(
	metrics map[string]MetricSample,
	metricName,
	metricType string,
	streamTags,
	measurementTags []string,
	value interface{},
	timestamp *time.Time) error

QueueMetricSample to queue for submission

func (*Check) ResetSubmitStats

func (c *Check) ResetSubmitStats()

ResetSubmitStats zeros submission stats

func (*Check) SetCounter added in v0.5.5

func (c *Check) SetCounter(metricName string, tags cgm.Tags, value uint64)

SetCounter to queue for submission

func (*Check) SubmitMetrics added in v0.7.1

func (c *Check) SubmitMetrics(ctx context.Context, metrics map[string]MetricSample, resultLogger zerolog.Logger, includeStats bool) error

Submit sends metrics to a circonus trap

func (*Check) SubmitStats

func (c *Check) SubmitStats() Stats

SubmitStats returns copy of the submission stats

func (*Check) TagListToCGM added in v0.7.1

func (c *Check) TagListToCGM(tags []string) cgm.Tags

func (*Check) UseCompression

func (c *Check) UseCompression() bool

UseCompression indicates whether the data being sent should be compressed

type CustomRules added in v0.9.0

type CustomRules struct {
	Rules []apiclient.RuleSet `json:"rules"`
}

type DefaultAlerts added in v0.9.0

type DefaultAlerts struct {
	Contact      AlertContact            `json:"contact"`
	RuleSettings map[string]RuleSettings `json:"rule_settings"`
}

type Metric added in v0.7.1

type Metric struct {
	Name  string
	Value MetricSample
}

type MetricFilter added in v0.7.1

type MetricFilter struct {
	Allow  bool
	Filter *regexp.Regexp
}

type MetricSample

type MetricSample struct {
	Value     interface{} `json:"_value"`
	Type      string      `json:"_type"`
	Timestamp uint64      `json:"_ts,omitempty"`
}

type RuleSettings added in v0.9.0

type RuleSettings struct {
	Disabled     bool   `json:"disabled"`
	Threshold    string `json:"threshold"`
	Window       uint   `json:"window"`
	MinThreshold string `json:"min_threshold"`
	MinWindow    uint   `json:"min_window"`
	MaxThreshold string `json:"max_threshold"`
	MaxWindow    uint   `json:"max_window"`
}

type Stats

type Stats struct {
	LocFiltered uint64 // agent: filtered based on namerx
	BkrFiltered uint64 // broker: filtered
	RecvMetrics uint64 // broker: "stats" received
	SentMetrics uint64 // agent: total "unique" metrics sent
	SentBytes   uint64
	SentSize    string
}

Stats defines the submission stats tracked across metric submissions to broker

type Tag

type Tag struct {
	Category string
	Value    string
}

Tag defines an individual tag

type Tags

type Tags []Tag

Tags defines a list of tags

type TrapResult

type TrapResult struct {
	CheckUUID  string
	SubmitUUID uuid.UUID
	Filtered   uint64 `json:"filtered,omitempty"`
	Stats      uint64 `json:"stats"`
	Error      string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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