Browse Source

improve the docs

pull/1/head
Brett Langdon 9 years ago
parent
commit
4aa2384a4f
No known key found for this signature in database GPG Key ID: A2ECAB73CE12147F
2 changed files with 27 additions and 4 deletions
  1. +24
    -3
      README.md
  2. +3
    -1
      doc.go

+ 24
- 3
README.md View File

@ -1,10 +1,12 @@
caddy dogstatsd
===============
A [Caddy](https://caddyserver.com/) plugin for reporting metrics to [Datadog](https://datadoghq.com).
A [Caddy](https://caddyserver.com/) middleware plugin for reporting metrics to [Datadog](https://datadoghq.com).
## Installation
**Coming soon**
## Configuration
```
@ -20,7 +22,26 @@ dogstatsd {
}
```
### Configuration options
- `host` - the `host:port` where `dogstatsd` metrics should be sent - default: `127.0.0.1:8125`
- `samplerate` - a `float` indicating the sample rate of requests to record metrics for
- For example, a `samplerate` of `0.5` means metrics will be emitted for only half of the requests
- `namespace` - an optional namespace to prepend to each metric emitted - by default there is none
- For example, a `namespace` of `my_app` will yield `my_app.caddy.response.time` as a metric
- `tags` - an optional list of global tags to set for this server - by default there are none
- Example tags, `env:production`, `app:my_app`
### Example config
```
dogstatsd {
samplerate 0.75
namespace my_app
tags env:production service:caddy
}
```
## Metrics
caddy.response.count - counter - number of requests handled
caddy.response.time - histogram - milliseconds spent handling request
- `[namespace.]caddy.response.count` - counter - number of requests handled
- `[namespace.]caddy.response.time` - histogram - milliseconds spent handling request

+ 3
- 1
doc.go View File

@ -1,5 +1,7 @@
// Package caddydogstatsd provides a Datadog middleware for caddy.
// Package caddydogstatsd provides a Datadog middleware for Caddy.
//
// caddydogstatsd is a plugin for https://caddyserver.com which will emit Datadog dogstatsd metrics
// after each request is handled.
//
// See https://github.com/brettlangdon/caddydogstatsd for more information
package caddydogstatsd

Loading…
Cancel
Save