Back to godoc.org
bosun.org / metadata

Package metadata

v0.0.0-...-8a7cd2d
Latest Go to latest

The latest major version is .

Published: Jun 18, 2020 | License: MIT | Module: bosun.org

Overview

Package metadata provides metadata information between bosun and OpenTSDB.

Index

Constants

const (
	// Unknown is a not-yet documented rate type.
	Unknown RateType = ""
	// Gauge rate type.
	Gauge = "gauge"
	// Counter rate type.
	Counter = "counter"
	// Rate rate type.
	Rate = "rate"
)
const (
	// None is a not-yet documented unit.
	None            Unit = ""
	A                    = "A"            // Amps
	ActiveUsers          = "active users" // Google Analytics
	Alert                = "alerts"
	Abort                = "aborts"
	Bool                 = "bool"
	BitsPerSecond        = "bits per second"
	Bytes                = "bytes"
	BytesPerSecond       = "bytes per second"
	C                    = "C" // Celsius
	CacheHit             = "cache hits"
	CacheMiss            = "cache misses"
	Change               = "changes"
	Channel              = "channels"
	Check                = "checks"
	CHz                  = "CentiHertz"
	Client               = "clients"
	Command              = "commands"
	Connection           = "connections"
	Consumer             = "consumers"
	Context              = "contexts"
	ContextSwitch        = "context switches"
	Count                = ""
	Document             = "documents"
	Enabled              = "enabled"
	Entropy              = "entropy"
	Error                = "errors"
	Event                = ""
	Eviction             = "evictions"
	Exchange             = "exchanges"
	Fault                = "faults"
	Flush                = "flushes"
	Files                = "files"
	Frame                = "frames"
	Fraction             = "fraction"
	Get                  = "gets"
	GetExists            = "get exists"
	Group                = "groups"
	Incident             = "incidents"
	Interupt             = "interupts"
	InProgress           = "in progress"
	Item                 = "items"
	KBytes               = "kbytes"
	Key                  = "keys"
	Load                 = "load"
	EMail                = "emails"
	MHz                  = "MHz" // MegaHertz
	Megabit              = "Mbit"
	Merge                = "merges"
	Message              = "messages"
	MilliSecond          = "milliseconds"
	Nanosecond           = "nanoseconds"
	Node                 = "nodes"
	Ok                   = "ok" // "OK" or not status, 0 = ok, 1 = not ok
	Operation            = "Operations"
	Packet               = "packets"
	Page                 = "pages"
	Pct                  = "percent" // Range of 0-100.
	PerSecond            = "per second"
	Pool                 = "pools"
	Process              = "processes"
	Priority             = "priority"
	Query                = "queries"
	Queue                = "queues"
	Ratio                = "ratio"
	Redispatch           = "redispatches"
	Refresh              = "refreshes"
	Replica              = "replicas"
	Retry                = "retries"
	Response             = "responses"
	Request              = "requests"
	RPM                  = "RPM" // Rotations per minute.
	Scheduled            = "scheduled"
	Score                = "score"
	Second               = "seconds"
	Sector               = "sectors"
	Segment              = "segments"
	Server               = "servers"
	Session              = "sessions"
	Shard                = "shards"
	Slave                = "slaves"
	Socket               = "sockets"
	Suggest              = "suggests"
	StatusCode           = "status code"
	Resync               = "resynchronizations"
	Syscall              = "system calls"
	Thread               = "threads"
	Timestamp            = "timestamp"
	Transition           = "transitions"
	USD                  = "US dollars"
	V                    = "V" // Volts
	V10                  = "tenth-Volts"
	Vulnerabilities      = "vulnerabilities"
	Watt                 = "Watts"
	Weight               = "weight"
	Yield                = "yields"
)

Variables

var (
	// AuthToken is an optional string that sets the X-Access-Token HTTP header
	// which is used to authenticate against Bosun
	AuthToken string
)

func AddMeta

func AddMeta(metric string, tags opentsdb.TagSet, name string, value interface{}, setHost bool)

AddMeta adds a metadata entry to memory, which is queued for later sending.

func AddMetricMeta

func AddMetricMeta(metric string, rate RateType, unit Unit, desc string)

AddMetricMeta is a convenience function to set the main metadata fields for a metric. Those fields are rate, unit, and description. If you need to document tag keys then use AddMeta.

func FlushMetadata

func FlushMetadata()

func Init

func Init(u *url.URL, debug bool) error

Init initializes the metadata send queue.

func InitF

func InitF(debug bool, f func(k Metakey, v interface{}) error) error

type HWControllerMeta

type HWControllerMeta struct {
	Name            string
	SlotId          string
	State           string
	FirmwareVersion string
	DriverVersion   string
}

type HWDiskMeta

type HWDiskMeta struct {
	Name            string
	Media           string
	Capacity        string
	VendorId        string
	ProductId       string
	Serial          string
	Part            string
	NegotatiedSpeed string
	CapableSpeed    string
	SectorSize      string
}

type HWPowerSupplyMeta

type HWPowerSupplyMeta struct {
	RatedInputWattage  string
	RatedOutputWattage string
}

type Metakey

type Metakey struct {
	Metric string
	Tags   string
	Name   string
}

Metakey uniquely identifies a metadata entry.

func (Metakey) TagSet

func (m Metakey) TagSet() opentsdb.TagSet

TagSet returns m's tags.

type Metasend

type Metasend struct {
	Metric string          `json:",omitempty"`
	Tags   opentsdb.TagSet `json:",omitempty"`
	Name   string          `json:",omitempty"`
	Value  interface{}
	Time   *time.Time `json:",omitempty"`
}

Metasend is the struct for sending metadata to bosun.

type RateType

type RateType string

RateType is the type of rate for a metric: gauge, counter, or rate.

type Unit

type Unit string

Unit is the unit for a metric.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier