Ship your host metrics to Honeybadger Insights

You can use Vector to track metrics on your servers (like CPU, memory usage, disk usage, etc.) and send the metrics to Insights. Here's a sample configuration that will encode the metrics into the newline-delimited JSON format that our API expects:

yaml
# Put this in /etc/vector/vector.yaml sources: host: type: "host_metrics" sinks: honeybadger_events: type: "http" inputs: ["host"] uri: "https://api.honeybadger.io/v1/events" request: headers: X-API-Key: "Your project API key" encoding: codec: "json" framing: method: "newline_delimited"

The metrics look like this in the Insights UI:

Screenshot of host metrics in Insights query results

Here's an example BadgerQL query you can use to get a snapshot of the disk usage:

fields @ts, tags.mountpoint::str, round(gauge.value::float * 100, 2) as used_percentage | filter namespace::str == "host" | filter name::str == "filesystem_used_ratio" | filter gauge.value::float > 0.0 | filter tags.filesystem::str not in ["tmpfs", "devtmpfs", "squashfs"] | sort @ts | limit 1 by tags.mountpoint

Screenshot of disk usage in Insights query results

Additional information about how to configure Vector to capture host metrics can be found here.

The easiest way to run Vector is via Docker. Here's a sample Docker Compose configuration you can use, assuming your Vector configuration is in a file named vector.yaml:

yaml
version: "3.2" services: vector: image: timberio/vector:latest-alpine volumes: - "vector.yaml:/etc/vector/vector.yaml:ro"