honeycomb

package module
v0.0.0-...-40ca986 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

README

logspout-honeycomb

OSS Lifecycle

STATUS: this project is archived. Logspout users can use one of the logspout third-party modules that integrates with logstash or fluentd to send logs to Honeycomb.

Questions? You can chat with us in the Honeycomb Pollinators Slack. You can find a direct link to request an invite in Spread the Love: Appreciating Our Pollinators Community.


Honeycomb adapter for Logspout. More documentation can be found in Honeycomb docs.

Expects to ingest JSON log lines, and will send JSON blobs up to Honeycomb, annotated with the current logspout stream, container, container ID, hostname, and docker image name.

If the log lines being streamed through Logspout aren't JSON, the contents of the message will be tucked under a "message" key in the Honeycomb payload, alongside the metadata mentioned above.

Building

To build the Honeycomb Logspout Docker image, run:

  • make docker

Configuration and invocation

This module can be configured either by setting environment variables in Docker, or by using the Logspout routesapi. The following variables are available:

Env. Variable routesapi key Type Required? Description
HONEYCOMB_WRITE_KEY writeKey string required Your Honeycomb team's write key.
HONEYCOMB_DATASET dataset string required The name of the destination dataset in your Honeycomb account. It will be created if it does not already exist.
HONEYCOMB_SAMPLE_RATE sampleRate integer optional Sample your event stream: send 1 out of every N events
Environment variables

Configure the logspout-honeycomb image via environment variables and run the container:

docker run \
    -e "ROUTE_URIS=honeycomb://localhost" \
    -e "HONEYCOMB_WRITE_KEY=<YOUR_WRITE_KEY>" \
    -e "HONEYCOMB_DATASET=<YOUR_DATASET>" \
    --volume=/var/run/docker.sock:/var/run/docker.sock \
    --publish=127.0.0.1:8000:80 \
    honeycombio/logspout-honeycomb:1.13
routesapi

Configuration can be set after the logspout-honeycomb image is already running via routesapi:

docker run \
    --volume=/var/run/docker.sock:/var/run/docker.sock \
    --publish=127.0.0.1:8000:80 \
    honeycombio/logspout-honeycomb:1.13

curl $(docker port `docker ps -lq` 80)/routes \
    -X POST \
        -d '{"adapter": "honeycomb",
             "address": "honeycomb://localhost",
             "options": {"writeKey":"<YOUR_WRITE_KEY>",
                         "dataset":"<YOUR_DATASET>"}}'

Documentation

Index

Constants

View Source
const (
	DefaultHoneycombAPIURL = "https://api.honeycomb.io"
	DefaultSampleRate      = 1
)

Variables

This section is empty.

Functions

func NewHoneycombAdapter

func NewHoneycombAdapter(route *router.Route) (router.LogAdapter, error)

NewHoneycombAdapter creates a HoneycombAdapter

Types

type HoneycombAdapter

type HoneycombAdapter struct {
	// contains filtered or unexported fields
}

HoneycombAdapter is an adapter that streams JSON to Logstash.

func (*HoneycombAdapter) Stream

func (a *HoneycombAdapter) Stream(logstream chan *router.Message)

Stream implements the router.LogAdapter interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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