HoneyComb

To send events from HoneyComb, specify the values of your env vars in your HoneyComb code.

  • APIKey/WriteKey: This will be your APIKey generated from HoneyComb.
  • APIHost: The APIHost value is your endpoints URL https://opbizplsf8klnw.ingress.axiom.co generated when creating your endpoints.
  • Dataset: Axiom Dataset created from the Axiom dashboard where your service and honeycomb logs will be sent.

Examples

Send logs from HoneyComb using JavaScript

const Libhoney = require('libhoney');
const hny = new Libhoney({
  writeKey: '',
  dataset: '',
  apiHost: '',
});

hny.sendNow({ message: 'Welcome to Axiom Endpoints!' });

Send logs from HoneyComb using Python

import libhoney
libhoney.init(writekey="", dataset="", api_host="")

event = libhoney.new_event()
event.add_field("foo", "bar")
event.add({"message": "Welcome, to Axiom Endpoints!"})
event.send()

Send logs from HoneyComb using Golang

package main

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

func main() {
	libhoney.Init(libhoney.Config{
		WriteKey: "",
		Dataset:  "",
		APIHost:  "",
	})

	defer libhoney.Close() // Flush any pending calls to Honeycomb

	var ev = libhoney.NewEvent()
	ev.Add(map[string]interface{}{
		"duration_ms":    155.67,
		"method":         "post",
		"hostname":       "endpoints",
		"payload_length": 43,
	})
	ev.Send()
}

Was this page helpful?