Description
gocraft/health is a Go library for instrumenting a web service with logging and metrics. You create a stream, attach one or more sinks to it, and the library sends the instrumentation to log files, StatsD, Bugsnag, or a JSON API that can be polled and aggregated. It is organised around jobs, such as serving an HTTP request, handling an RPC call or processing a message from a work queue. Each job records how long it took, how it completed, and the instrumentation that happened inside it. The completion statuses are success, error, panic and validation error. The library also ships with healthd, an aggregator in the style of New Relic that shows your slowest endpoints, the top error producers and the endpoints with the highest throughput. The README covers events, timings, gauges, errors, and keys and values, and it explains how to write your own sink. It suggests middleware for creating jobs when a service has more than a few endpoints. The code is public on GitHub.…
Highlights
- Logging and metrics for Go web services
- Sinks for log files, StatsD, Bugsnag and a JSON API
- Job timings and completion statuses
- healthd aggregator for slow and failing endpoints
- Write your own sink
Ratings & Reviews
No ratings yet
Be the first to rate Health.
People also visit

golang-observability
Golang everyday observability — the always-on signals in production
Go Http Metrics
Go modular http middleware to measure HTTP requests independent of metrics…

golang-samber-slog
Structured logging extensions for Golang using samber/slog-**** packages
Health FAQ
What is gocraft/health for?
Instrumenting a Go service so you get logs and metrics about its jobs, such as request timings and error counts.
Where can the metrics go?
To log files, StatsD, Bugsnag, or a JSON API that can be polled and aggregated.
What is healthd?
An aggregator bundled with the library that shows your slowest endpoints, top error producers and highest-throughput endpoints.
Can I send data somewhere else?
Yes. The README explains how to write your own sink.
What are the best Health alternatives?
Popular alternatives to Health include Go Http Metrics, Outrig and Orchestrion. See all Health alternatives



