dropsonde

package
v0.0.0-...-b7aefed Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2014 License: Apache-2.0, Apache-2.0, BSD-2-Clause-Views, + 2 more Imports: 8 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.

Autowire

The intended use of dropsonde is through the autowire sub-package. Simply anonymously import the package

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

and it will automatically initialize, instrument the default HTTP handler for outgoing requests, instrument itself (to count messages sent, etc.), and provide basic runtime stats.

Alternatively, import github.com/cloudfoundry/dropsonde/autowire/metrics to include the ability to send custom metrics, via metrics.SendValue and metrics.IncrementCounter. (The same auto- initialization will apply when importing metrics.)

Configuration

Before running a program using autowire, you must set the DROPSONDE_ORIGIN environment variable. This string is used by downstream portions of the dropsonde system to track the source of metrics. Failing to set this variable will result in the program running, but without any instrumentation.

You may (optionally) set DROPSONDE_DESTINATION to configure the recipient of event messages. If left unset, a default will be used.

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, or should use dropsonde/autowire (or dropsonde/autowire/metrics). 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

View Source
var GenerateUuid = uuid.NewV4

Functions

func InstrumentedHandler

func InstrumentedHandler(handler http.Handler, emitter emitter.EventEmitter) http.Handler

Helper for creating an Instrumented Handler which will delegate to the given http.Handler.

func InstrumentedRoundTripper

func InstrumentedRoundTripper(roundTripper http.RoundTripper, emitter emitter.EventEmitter) http.RoundTripper

Helper for creating an InstrumentedRoundTripper which will delegate to the given RoundTripper

Types

This section is empty.

Directories

Path Synopsis
Package autowire provides sensible defaults for using dropsonde.
Package autowire provides sensible defaults for using dropsonde.
logs
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.
metrics
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.
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.
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