Send data from Honeycomb to Axiom
Prerequisites#
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to ingest data to the dataset you have created.
Configure the endpoint in Axiom#
- Click Settings > Endpoints.
- Click New endpoint.
- Click Honeycomb.
- Name the endpoint.
- Select the dataset where you want to send data.
- Copy the URL displayed for the newly created endpoint. This is the target URL where you send the data.
Configure Honeycomb#
In Honeycomb, specify the following environment variables:
APIKeyorWriteKeyis your Honeycomb API token. For information, see the Honeycomb documentation.APIHostis the target URL for the endpoint you have generated in Axiom by following the procedure above. For example,https://opbizplsf8klnw.ingress.axiom.co.Datasetis the name of the Axiom dataset where you want to send data.
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()
}