circonus

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: BSD-3-Clause Imports: 43 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 // sync w/NOIT_TAG_MAX_PAIR_LEN https://github.com/circonus-labs/reconnoiter/blob/master/src/noit_metric.h#L102
	MaxTagCat = 254 // sync w/NOIT_TAG_MAX_CAT_LEN https://github.com/circonus-labs/reconnoiter/blob/master/src/noit_metric.h#L104

	// 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#L46

	// 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#L45
)

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(ctx context.Context, parentLogger zerolog.Logger, cfg *config.Circonus, clusterCfg *config.Cluster) (*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)

FlushCGM sends the tracking metrics collected in a CGM instance within the Check.

func (*Check) FlushCollectorMetrics added in v0.18.0

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

FlushCollectorMetrics sends metrics from discrete collectors and sub-collectors

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) 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 {
	RuleSettings map[string]RuleSettings `json:"rule_settings"`
	Contact      AlertContact            `json:"contact"`
}

type Metric added in v0.7.1

type Metric struct {
	Name  string
	Value MetricSample
}

type MetricFilter added in v0.7.1

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

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 {
	Threshold    string `json:"threshold"`
	MinThreshold string `json:"min_threshold"`
	MaxThreshold string `json:"max_threshold"`
	MaxWindow    uint   `json:"max_window"`
	Window       uint   `json:"window"`
	MinWindow    uint   `json:"min_window"`
	Disabled     bool   `json:"disabled"`
}

type Stats

type Stats struct {
	Transmitted string
	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 // size of raw data (not compressed)
	SentSize    uint64 // actual size of data sent
}

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
	Error      string `json:"error,omitempty"`
	Filtered   uint64 `json:"filtered,omitempty"`
	Stats      uint64 `json:"stats"`
	SubmitUUID uuid.UUID
}

Jump to

Keyboard shortcuts

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