modulepackage
2.1.0+incompatible
Repository: https://github.com/honeycombio/libhoney-go.git
Documentation: pkg.go.dev
# README
libhoney
Go library for sending events to Honeycomb, a service for debugging your software in production.
For tracing support and automatic instrumentation of Gorilla, httprouter
, sqlx
, and other common libraries, check out our Beeline for Go.
Dependencies
Golang 1.14+
Contributions
Features, bug fixes and other changes to libhoney are gladly accepted. Please open issues or a pull request with your change. Remember to add your name to the CONTRIBUTORS file!
All contributions will be released under the Apache License 2.0.
# Functions
Add adds its data to the global scope.
AddDynamicField takes a field name and a function that will generate values for that metric.
AddField adds a Field to the global scope.
Close waits for all in-flight messages to be sent.
Flush closes and reopens the Output interface, ensuring events are sent without waiting on the batch to be sent asyncronously.
Init is called on app initialization and passed a Config struct, which configures default behavior.
NewBuilder creates a new event builder.
NewClient creates a Client with defaults correctly set.
NewEvent creates a new event prepopulated with any Fields present in the global scope.
Responses returns the channel from which the caller can read the responses to sent events.
Contrary to its name, SendNow does not block and send data immediately, but only enqueues to be sent asynchronously.
TxResponses returns the channel from which the caller can read the responses to sent events.
VerifyAPIKey calls out to the Honeycomb API to validate the API key so we can exit immediately if desired instead of happily sending events that are all rejected.
VerifyWriteKey is the deprecated call to validate a Honeycomb API key.
# Constants
DefaultBatchTimeout how frequently to send unfilled batches.
DefaultMaxBatchSize how many events to collect in a batch.
DefaultMaxConcurrentBatches how many batches to maintain in parallel.
DefaultPendingWorkCapacity how many events to queue up for busy batches.
# Variables
UserAgentAddition is a variable set at compile time via -ldflags to allow you to augment the "User-Agent" header that libhoney sends along with each event.
# Structs
Builder is used to create templates for new events, specifying default fields and override settings.
Client represents an object that can create new builders and events and send them somewhere.
ClientConfig is a subset of the global libhoney config that focuses on the configuration of the client itself.
Config specifies settings for initializing the library.
DefaultLogger implements Logger and prints messages to stdout prepended by a timestamp (RFC3339 formatted).
DiscardWriter implements the Output interface and drops all events.
Event is used to hold data that can be sent to Honeycomb.
MockOutput implements the Output interface and passes it along to the transmission.MockSender.
Deprecated: Response is deprecated; please use transmission.Response instead.
WriterOutput implements the Output interface and passes it along to the transmission.WriterSender.