dropsonde

package
v0.0.0-...-9038be0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2015 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0

README

Dropsonde

Build Status Coverage Status GoDoc

Go library to collect and emit metric and logging data from CF components. https://godoc.org/github.com/cloudfoundry/dropsonde

Protocol Buffer format

See dropsonde-protocol for the full specification of the dropsonde Protocol Buffer format.

Use this script to generate Go handlers for the various protobuf messages.

Initialization and Configuration

import (
    "github.com/cloudfoundry/dropsonde"
)

func main() {
    dropsonde.Initialize("localhost:3457", "router", "z1", "0")
}

This initializes dropsonde, along with the logs and metrics packages. It also instruments the default HTTP handler for outgoing requests, instrument itself (to count messages sent, etc.), and provides basic runtime stats.

The first argument is the destination for messages (typically metron). The host and port is required. The remaining arguments form the origin. This list is used by downstream portions of the dropsonde system to track the source of metrics.

Alternatively, import github.com/cloudfoundry/dropsonde/metrics to include the ability to send custom metrics, via metrics.SendValue and metrics.IncrementCounter.

Manual usage

For details on manual usage of dropsonde, please refer to the Godocs. Pay particular attenion to the ByteEmitter, InstrumentedHandler, and InstrumentedRoundTripper types.

Handling dropsonde events

Programs wishing to emit events and metrics should use the package as described above. For programs that wish to process events, we provide the dropsonde/unmarshaller and dropsonde/marshaller packages for decoding/reencoding raw Protocol Buffer messages. Use dropsonde/signature to sign and validate messages.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutowiredEmitter

func AutowiredEmitter() emitter.EventEmitter

func Initialize

func Initialize(destination string, origin ...string) error

Initialize creates default emitters and instruments the default HTTP transport.

The origin variable is required and specifies the source name for all metrics emitted by this process. If it is not set, the program will run normally but will not emit metrics.

The destination variable sets the host and port to which metrics are sent. It is optional, and defaults to DefaultDestination.

func InitializeWithEmitter

func InitializeWithEmitter(emitter emitter.EventEmitter)

func InstrumentedHandler

func InstrumentedHandler(handler http.Handler) http.Handler

InstrumentedHandler returns a Handler pre-configured to emit HTTP server request metrics to AutowiredEmitter.

func InstrumentedRoundTripper

func InstrumentedRoundTripper(roundTripper http.RoundTripper) http.RoundTripper

InstrumentedRoundTripper returns a RoundTripper pre-configured to emit HTTP client request metrics to AutowiredEmitter.

Types

type NullEventEmitter

type NullEventEmitter struct{}

func (*NullEventEmitter) Close

func (*NullEventEmitter) Close()

func (*NullEventEmitter) Emit

Directories

Path Synopsis
Package control is a generated protocol buffer package.
Package control is a generated protocol buffer package.
Package dropsonde_marshaller provides a tool for marshalling Envelopes to Protocol Buffer messages.
Package dropsonde_marshaller provides a tool for marshalling Envelopes to Protocol Buffer messages.
Package dropsonde_unmarshaller provides a tool for unmarshalling Envelopes from Protocol Buffer messages.
Package dropsonde_unmarshaller provides a tool for unmarshalling Envelopes from Protocol Buffer messages.
Package events is a generated protocol buffer package.
Package events is a generated protocol buffer package.
Package logs provides a simple API for sending app logs from STDOUT and STDERR through the dropsonde system.
Package logs provides a simple API for sending app logs from STDOUT and STDERR through the dropsonde system.
Package metrics provides a simple API for sending value and counter metrics through the dropsonde system.
Package metrics provides a simple API for sending value and counter metrics through the dropsonde system.
Messages are prepended with a HMAC SHA256 signature (the signature makes up the first 32 bytes of a signed message; the remainder is the original message in cleartext).
Messages are prepended with a HMAC SHA256 signature (the signature makes up the first 32 bytes of a signed message; the remainder is the original message in cleartext).

Jump to

Keyboard shortcuts

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