Documentation ¶
Overview ¶
Package dropsonde provides sensible defaults for using dropsonde.
The default HTTP transport is instrumented, as well as some basic stats about the Go runtime. The default emitter sends events over UDP.
Use ¶
dropsonde.Initialize("localhost:3457", origins...)
to initialize. See package metrics and logs for other usage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
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 EventEmitter)
InitializeWithEmitter sets up Dropsonde with the passed emitter, instead of creating one.
func InstrumentedHandler ¶
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 EventEmitter ¶
type EventEmitter interface { Emit(events.Event) error EmitEnvelope(*events.Envelope) error Origin() string }
var (
DefaultEmitter EventEmitter = &NullEventEmitter{}
)
func AutowiredEmitter ¶
func AutowiredEmitter() EventEmitter
AutowiredEmitter exposes the emitter used by Dropsonde after its initialization.
type NullEventEmitter ¶
type NullEventEmitter struct{}
NullEventEmitter is used when no event emission is desired. See http://en.wikipedia.org/wiki/Null_Object_pattern.
func (*NullEventEmitter) Close ¶
func (*NullEventEmitter) Close()
Close ceases emitter operations. On NullEventEmitter, it is a no-op.
func (*NullEventEmitter) Emit ¶
func (*NullEventEmitter) Emit(events.Event) error
Emit is called to send an event to a remote host. On NullEventEmitter, it is a no-op.
func (*NullEventEmitter) EmitEnvelope ¶
func (*NullEventEmitter) EmitEnvelope(*events.Envelope) error
EmitEnvelope is called to send an envelope to a remote host. On NullEventEmitter, it is a no-op.
func (*NullEventEmitter) Origin ¶
func (*NullEventEmitter) Origin() string
Origin returns the origin that is set on the event.Envelope
Directories ¶
Path | Synopsis |
---|---|
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 envelopes provides a simple API for sending dropsonde envelopes through the dropsonde system.
|
Package envelopes provides a simple API for sending dropsonde envelopes through the dropsonde system. |
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 metricbatcher provides a mechanism to batch counter updates into a single event.
|
package metricbatcher provides a mechanism to batch counter updates into a single event. |
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). |