sink

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 29 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 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