/libhoney-go

Go library for sending data to Honeycomb

Primary LanguageGoApache License 2.0Apache-2.0

libhoney Build Status

Go library for sending events to Honeycomb. (See here for more information about using Honeycomb and its libraries.)

Installation:

go get -v github.com/honeycombio/libhoney-go

Documentation

A godoc API reference is available at https://godoc.org/github.com/honeycombio/libhoney-go

Example

Honeycomb can calculate all sorts of statistics, so send the values you care about and let us crunch the averages, percentiles, lower/upper bounds, cardinality -- whatever you want -- for you.

import "github.com/honeycombio/libhoney-go"

// Call Init to configure libhoney
libhoney.Init(libhoney.Config{
  WriteKey: "YOUR_WRITE_KEY",
  Dataset: "honeycomb-golang-example",
})
defer libhoney.Close() // Flush any pending calls to Honeycomb

libhoney.SendNow(map[string]interface{}{
  "duration_ms": 153.12,
  "method": "get",
  "hostname": "appserver15",
  "payload_length": 27,
})

See the examples directory for sample code demonstrating how to use events, builders, fields, and dynamic fields.

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.