internal

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package internal offers helper interfaces that are internal to the Wavefront Go SDK. Interfaces within this package are not guaranteed to be backwards compatible between releases.

Index

Constants

View Source
const (
	DeltaPrefix    = "\u2206"
	AltDeltaPrefix = "\u0394"
)
View Source
const (
	MetricFormat    = "wavefront"
	HistogramFormat = "histogram"
	TraceFormat     = "trace"
	SpanLogsFormat  = "spanLogs"
	EventFormat     = "event"
)

Variables

This section is empty.

Functions

func DeltaCounterName

func DeltaCounterName(name string) string

Gets a delta counter name prefixed with ∆.

func GetBuffer added in v0.9.8

func GetBuffer() *bytes.Buffer

GetBuffer fetches a buffers from the pool

func GetHostname

func GetHostname(defaultVal string) string

func GetSemVer added in v0.9.8

func GetSemVer(version string) (float64, error)

func HasDeltaPrefix

func HasDeltaPrefix(name string) bool

func PutBuffer added in v0.9.8

func PutBuffer(buf *bytes.Buffer)

PutBuffer returns a buffers to the pool

func Sanitize added in v0.12.0

func Sanitize(str string) string

Sanitize sanitizes string of metric name, source and key of tags according to the rule of Wavefront proxy.

func SanitizeValue added in v0.12.0

func SanitizeValue(str string) string

SanitizeValue sanitizes string of tags value, etc.

Types

type ConnectionHandler

type ConnectionHandler interface {
	Connect() error
	Connected() bool
	Close()
	SendData(lines string) error

	Flusher
}

type Flusher

type Flusher interface {
	Flush() error
	GetFailureCount() int64
	Start()
}

type LineHandler

type LineHandler interface {
	HandleLine(line string) error
	Start()
	Stop()
	Flush() error
	GetFailureCount() int64
}

type LineHandlerOption added in v0.9.3

type LineHandlerOption func(*RealLineHandler)

func SetHandlerPrefix added in v0.9.3

func SetHandlerPrefix(prefix string) LineHandlerOption

func SetLockOnThrottledError added in v0.9.5

func SetLockOnThrottledError(lock bool) LineHandlerOption

func SetRegistry added in v0.9.3

func SetRegistry(registry sdkmetrics.Registry) LineHandlerOption

type RealLineHandler added in v0.14.0

type RealLineHandler struct {
	Reporter      Reporter
	BatchSize     int
	MaxBufferSize int
	Format        string
	// contains filtered or unexported fields
}

func NewLineHandler added in v0.9.3

func NewLineHandler(reporter Reporter, format string, flushInterval time.Duration, batchSize, maxBufferSize int, setters ...LineHandlerOption) *RealLineHandler

func (*RealLineHandler) Flush added in v0.14.0

func (lh *RealLineHandler) Flush() error

func (*RealLineHandler) FlushAll added in v0.14.0

func (lh *RealLineHandler) FlushAll() error

func (*RealLineHandler) GetFailureCount added in v0.14.0

func (lh *RealLineHandler) GetFailureCount() int64

func (*RealLineHandler) GetThrottledCount added in v0.14.0

func (lh *RealLineHandler) GetThrottledCount() int64

GetThrottledCount returns the number of Throttled errors received.

func (*RealLineHandler) HandleLine added in v0.14.0

func (lh *RealLineHandler) HandleLine(line string) error

func (*RealLineHandler) Start added in v0.14.0

func (lh *RealLineHandler) Start()

func (*RealLineHandler) Stop added in v0.14.0

func (lh *RealLineHandler) Stop()

type Reporter

type Reporter interface {
	Report(format string, pointLines string) (*http.Response, error)
	ReportEvent(event string) (*http.Response, error)
}

Reporter is an interface for reporting data to a Wavefront service.

func NewReporter added in v0.9.8

func NewReporter(server string, tokenService auth.Service, client *http.Client) Reporter

NewReporter creates a metrics Reporter

Directories

Path Synopsis
csp

Jump to

Keyboard shortcuts

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