sink

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_RETRY_BUFFER_SIZE     = 60
	DEFAULT_RETRY_SEND_TIMEOUT    = "5s"
	DEFAULT_RETRY_SEND_RETRY_WAIT = "200ms"
)
View Source
const DEFAULT_CHRONOSPHERE_URL = "http://127.0.0.1:3030/openmetrics/write"
View Source
const (
	MAX_PAYLOAD_SIZE int = 512000
)

Variables

View Source
var Default = "log"

Default is the default sink if config.sinks is not specified.

Functions

func InitFactory

func InitFactory(factories blip.Factories)

func List

func List() []string

func Make

func Make(args blip.SinkFactoryArgs) (blip.Sink, error)

func NewLogSink

func NewLogSink(monitorId string) (logSink, error)

func Register

func Register(name string, f blip.SinkFactory) error

Types

type Chronosphere

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

Chronosphere sends metrics to Chronosphere (https://chronosphere.io) using OpenMetrics.

func NewChronosphere

func NewChronosphere(monitorId string, opts, tags map[string]string) (*Chronosphere, error)

func (*Chronosphere) Name

func (s *Chronosphere) Name() string

func (*Chronosphere) Send

func (s *Chronosphere) Send(ctx context.Context, m *blip.Metrics) (lerr error)

type Datadog

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

Datadog sends metrics to Datadog.

func NewDatadog

func NewDatadog(monitorId string, opts, tags map[string]string, httpClient *http.Client) (*Datadog, error)

func (*Datadog) Name

func (s *Datadog) Name() string

func (*Datadog) Send

func (s *Datadog) Send(ctx context.Context, m *blip.Metrics) error

type Delta added in v1.2.0

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

The Delta sink calculates DELTER_COUNTER metrics from CUMULATIVE_COUNTER metrics. It acts as a transform, removing CUMULATIVE_COUNTER metrics and replacing them with DELTER_COUNTER values. This can be used to wrap sinks that expect counters to be submitted as the number/count of observations in the sampling interval rather than a cumulative total.

The Delta sink is perferable to peforming delta calculations in the wrapped sink as the presence of a Retry sink can cause metrics to be sent to wrapped sink out of order, which can cause incorrect metric values to be submitted then delta calculations are performed. The Delta sink should never be wrapped inside of a Retry sink to prevent this.

func NewDelta added in v1.2.0

func NewDelta(sink blip.Sink) *Delta

func (*Delta) Name added in v1.2.0

func (d *Delta) Name() string

func (*Delta) Send added in v1.2.0

func (d *Delta) Send(ctx context.Context, metrics *blip.Metrics) error

Calculates DELTA_COUNTER values from any CUMULATIVE_COUNTER values in the passed metircs, and then replacees the CUMULATIVE_COUNTER values with the new DELTA_COUNTER values. The updated metrics are forwarded to the next sink.

This is safe to call from multiple goroutines.

type PromPushgateway added in v1.1.0

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

PromPushgateway implmements https://github.com/prometheus/pushgateway.

func NewPromPushgateway added in v1.1.0

func NewPromPushgateway(monitorId string, opts, tags map[string]string) (*PromPushgateway, error)

func (*PromPushgateway) Collect added in v1.1.0

func (s *PromPushgateway) Collect(ch chan<- prometheus.Metric)

func (*PromPushgateway) Describe added in v1.1.0

func (s *PromPushgateway) Describe(descs chan<- *prometheus.Desc)

func (*PromPushgateway) Name added in v1.1.0

func (s *PromPushgateway) Name() string

func (*PromPushgateway) Send added in v1.1.0

func (s *PromPushgateway) Send(ctx context.Context, m *blip.Metrics) error

type Retry

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

Retry is a pseudo-sink that provides buffering, serialization, and retry for a real sink. The built-in sinks, except "log", use Retry to handle those three complexities.

Retry uses a LIFO queue (a stack) to prioritize sending the latest metrics. This means that, during a long outage of the real sink, Retry drops the oldest metrics and keeps the latest metrics, up to its buffer size, which is configurable.

Retry sends SINK_SEND_ERROR events on Send error; the real sink should not.

func NewRetry

func NewRetry(args RetryArgs) *Retry

func (*Retry) Name

func (rb *Retry) Name() string

Name returns the name of the real sink, not "retry".

func (*Retry) Send

func (rb *Retry) Send(ctx context.Context, m *blip.Metrics) error

Send buffers, sends, and retries sending metrics on failure. It is safe to call from multiple goroutines.

type RetryArgs

type RetryArgs struct {
	MonitorId     string        // required
	Sink          blip.Sink     // required
	BufferSize    uint          // optional; DEFAULT_RETRY_BUFFER_SIZE
	SendTimeout   time.Duration // optional; DEFAULT_RETRY_SEND_TIMEOUT
	SendRetryWait time.Duration // optional; DEFAULT_RETRY_SEND_RETRY_WAIT
}

type SignalFx

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

SignalFx sends metrics to SignalFx.

func NewSignalFx

func NewSignalFx(monitorId string, opts, tags map[string]string, httpClient *http.Client) (*SignalFx, error)

func (*SignalFx) Name

func (s *SignalFx) Name() string

func (*SignalFx) Send

func (s *SignalFx) Send(ctx context.Context, m *blip.Metrics) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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