circonus

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: BSD-3-Clause Imports: 40 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"

	// 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 Check

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

func NewCheck

func NewCheck(parentLogger zerolog.Logger, cfg *config.Circonus) (*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) AddMetricSet added in v0.5.6

func (c *Check) AddMetricSet(metrics []byte, logger zerolog.Logger)

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) ConcurrentSubmissions added in v0.5.6

func (c *Check) ConcurrentSubmissions() bool

ConcurrentSubmissions enable sending metrics to circonus concurrently when disabled collection time is increased, when enabled may produce gaps

func (*Check) DebugSubmissions added in v0.4.0

func (c *Check) DebugSubmissions() bool

DebugSubmissions will dump the submission request to stdout

func (*Check) FlushCGM added in v0.5.0

func (c *Check) FlushCGM(ctx context.Context, ts *time.Time)

func (*Check) IncrementCounter added in v0.5.0

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

IncrementCounter to queue for submission

func (*Check) MaxMetricBucketSize added in v0.5.6

func (c *Check) MaxMetricBucketSize() int

MaxMetricBucketSize used by promtext parser to bucket metrics for submissions (may stabilize memory with large prom output)

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()

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) Submit added in v0.5.6

func (c *Check) Submit(ctx context.Context, metrics io.Reader, resultLogger zerolog.Logger) error

Submit sends metrics to a circonus trap

func (*Check) SubmitQueue

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

func (*Check) SubmitStats

func (c *Check) SubmitStats() Stats

func (*Check) Submitter added in v0.5.6

func (c *Check) Submitter(ctx context.Context)

func (*Check) UseCompression

func (c *Check) UseCompression() bool

UseCompression indicates whether the data being sent should be compressed

type MetricSample

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

type MetricSet added in v0.5.6

type MetricSet struct {
	Metrics []byte
	Logger  zerolog.Logger
}

type Stats

type Stats struct {
	Metrics   uint64
	SentBytes uint64
	SentSize  string
}

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
	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