Skip to content

Commit

Permalink
Implement Burrow input plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arkady-emelyanov committed May 20, 2018
1 parent a8a0d07 commit de39ff9
Show file tree
Hide file tree
Showing 24 changed files with 681 additions and 912 deletions.
1 change: 0 additions & 1 deletion Godeps
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ github.com/docker/go-connections 990a1a1a70b0da4c4cb70e117971a4f0babfbf1a
github.com/eapache/go-resiliency b86b1ec0dd4209a588dc1285cdd471e73525c0b3
github.com/eapache/go-xerial-snappy bb955e01b9346ac19dc29eb16586c90ded99a98c
github.com/eapache/queue 44cc805cf13205b55f69e14bcb69867d1ae92f98
github.com/fortytw2/leaktest 3b724c3d7b8729a35bf4e577f71653aec6e53513
github.com/eclipse/paho.mqtt.golang aff15770515e3c57fc6109da73d42b0d46f7f483
github.com/go-logfmt/logfmt 390ab7935ee28ec6b286364bba9b4dd6410cb3d5
github.com/go-sql-driver/mysql 2e00b5cd70399450106cec6431c2e2ce3cae5034
Expand Down
139 changes: 66 additions & 73 deletions plugins/inputs/burrow/README.md
Original file line number Diff line number Diff line change
@@ -1,102 +1,95 @@
# Telegraf Plugin: Burrow

Collect Kafka topics and consumers status
from [Burrow](https://github.com/linkedin/Burrow) HTTP API.
Collect Kafka topic, consumer and partition status
via [Burrow](https://github.com/linkedin/Burrow) HTTP [API](https://github.com/linkedin/Burrow/wiki/HTTP-Endpoint).

### Configuration:
Supported Burrow version: `1.x`

### Configuration

```
[[inputs.burrow]]
## Burrow endpoints in format "sheme://[user:password@]host:port"
## e.g.
## servers = ["http://localhost:8080"]
## servers = ["https://example.com:8000"]
## servers = ["http://user:[email protected]:8000"]
##
servers = [ "http://127.0.0.1:8000" ]
## Prefix all HTTP API requests.
#api_prefix = "/v2/kafka"
## Burrow API endpoints in format "schema://host:port".
## Default is "http://localhost:8000".
servers = ["http://localhost:8000"]
## Maximum time to receive response.
#timeout = "5s"
## Override Burrow API prefix.
## Useful when Burrow is behind reverse-proxy.
# api_prefix = "/v3/kafka"
## Optional, gather info only about specific clusters.
## Default is gather all.
#clusters = ["clustername1"]
## Maximum time to receive response.
# response_timeout = "5s"
## Optional, gather stats only about specific groups.
## Default is gather all.
#groups = ["group1"]
## Limit per-server concurrent connections.
## Useful in case of large number of topics or consumer groups.
# concurrent_connections = 20
## Optional, gather info only about specific topics.
## Default is gather all
#topics = ["topicA"]
## Filter out clusters by providing list of glob patterns.
## Default is no filtering.
# clusters = []
## Concurrent connections limit (per server), default is 4.
#max_concurrent_connections = 10
## Filter out consumer groups by providing list of glob patterns.
## Default is no filtering.
# groups = []
## Internal working queue adjustments (per measurement, per server), default is 4.
#worker_queue_length = 5
## Filter out topics by providing list of glob patterns.
## Default is no filtering.
# topics = []
## Credentials for basic HTTP authentication.
#username = ""
#password = ""
# username = ""
# password = ""
## Optional SSL config
#ssl_ca = "/etc/telegraf/ca.pem"
#ssl_cert = "/etc/telegraf/cert.pem"
#ssl_key = "/etc/telegraf/key.pem"
## Use SSL but skip chain & host verification
#insecure_skip_verify = false
# ssl_ca = "/etc/telegraf/ca.pem"
# ssl_cert = "/etc/telegraf/cert.pem"
# ssl_key = "/etc/telegraf/key.pem"
# insecure_skip_verify = false
```

Due to the nature of Burrow API (REST), each topic or consumer metric
collection requires an HTTP request, so, in order to keep things running
smooth, consider two parameters:
### Partition Status mappings

1. `max_concurrent_connection` - limit maximum number of concurrent HTTP
requests (per server).
2. `worker_queue_length` - number of concurrent workers processing
each measurement (per measurement, per server).
* `OK` = 1
* `NOT_FOUND` = 2
* `WARN` = 3
* `ERR` = 4
* `STOP` = 5
* `STALL` = 6

Just keep in mind, each worker in queue requires an HTTP connection,
so keep `max_concurrent_connection` and `worker_queue_length` balanced
in ratio 2:1.
> unknown value will be mapped to 0
### Partition Status mappings
### Fields

* OK = 1
* NOT_FOUND = 2
* WARN = 3
* ERR = 4
* STOP = 5
* STALL = 6
* `burrow_group` (one event per each consumer group)
- status (string, see Partition Status mappings)
- status_code (int, `1..6`, see Partition status mappings)
- parition_count (int, `number of partitions`)
- total_lag (int64, `totallag`)
- lag (int64, `maxlag.current_lag || 0`)

### Measurements & Fields:
* `burrow_partition` (one event per each topic partition)
- status (string, see Partition Status mappings)
- status_code (int, `1..6`, see Partition status mappings)
- lag (int64, `current_lag || 0`)
- offset (int64, `end.timestamp`)
- timestamp (int64, `end.timestamp`)

- burrow_topic (one event for each topic offset)
* `burrow_topic` (one event per topic offset)
- offset (int64)

- burrow_consumer
- start.offset (int64)
- start.lag (int64)
- start.timestamp (int64)
- end.offset (int64)
- end.lag (int64)
- end.timestamp (int64)
- status (1..6, see Partition status mappings)

### Tags

- burrow_topic
- cluster
- topic
- partition
* `burrow_group`
- cluster (string)
- group (string)

* `burrow_partition`
- cluster (string)
- group (string)
- topic (string)
- partition (int)

- burrow_consumer
- cluster
- group
- topic
- partition
* `burrow_topic`
- cluster (string)
- topic (string)
- partition (int)
Loading

0 comments on commit de39ff9

Please sign in to comment.