Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,14 @@ import (
"github.com/segmentio/stats/v5/prometheus"
)

handler := prometheus.NewHandler()
stats.Register(handler)
http.Handle("/metrics", handler)
stats.Register(prometheus.DefaultHandler)
http.Handle("/metrics", prometheus.DefaultHandler)
```

`Handler` has no `NewHandler` constructor; `DefaultHandler` is a ready-to-use zero-config
instance. Construct your own `&prometheus.Handler{}` literal instead if you need to set
`TrimPrefix`, `MetricTimeout`, or `Buckets`.

### InfluxDB

The [github.com/segmentio/stats/v5/influxdb](https://godoc.org/github.com/segmentio/stats/v5/influxdb) package sends metrics to InfluxDB using the line protocol over HTTP.
Expand Down
Loading