opentsdb

package
v0.19.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Overview

Package opentsdb adds support for pushing stats to opentsdb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(prefix string)

Init attempts to create a singleton *opentsdb.backend and register it as a PushBackend. If it fails to create one, this is a noop. The prefix argument is an optional string to prepend to the name of every data point reported.

func InitWithoutServenv added in v0.11.0

func InitWithoutServenv(prefix string) (stats.PushBackend, error)

InitWithoutServenv initializes the opentsdb without servenv

Types

type DataPoint added in v0.18.0

type DataPoint struct {
	// Example: sys.cpu.nice
	Metric string `json:"metric"`
	// Seconds or milliseconds since unix epoch.
	Timestamp float64           `json:"timestamp"`
	Value     float64           `json:"value"`
	Tags      map[string]string `json:"tags"`
}

DataPoint represents a single OpenTSDB data point.

func (*DataPoint) MarshalText added in v0.18.0

func (dp *DataPoint) MarshalText() (string, error)

type DataPointReader added in v0.18.0

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

DataPointReader parses bytes from io.Reader into DataPoints.

func NewDataPointReader added in v0.18.0

func NewDataPointReader(r io.Reader) *DataPointReader

func (*DataPointReader) Read added in v0.18.0

func (tr *DataPointReader) Read() (*DataPoint, error)

Read returns a DataPoint from the underlying io.Reader.

Returns an error if no DataPoint could be parsed.

Jump to

Keyboard shortcuts

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