Update kibana docs

This commit is contained in:
Daniel Nelson 2020-01-23 15:33:13 -08:00
parent bc3429ed48
commit bbe2d12e7e
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
4 changed files with 32 additions and 38 deletions

View File

@ -1,6 +1,6 @@
# Example Input Plugin
The example plugin gathers metrics about example things. This description
The `example` plugin gathers metrics about example things. This description
explains at a high level what the plugin does and provides links to where
additional information can be found.
@ -41,6 +41,10 @@ mapped to the output.
- tag3
- fields:
- field3 (integer, bytes)
- field4 (integer, green=1 yellow=2 red=3)
- field5 (string)
- field6 (float)
- field7 (boolean)
### Sample Queries

View File

@ -1,15 +1,17 @@
# Kibana input plugin
# Kibana Input Plugin
The [kibana](https://www.elastic.co/) plugin queries Kibana status API to
obtain the health status of Kibana and some useful metrics.
The `kibana` plugin queries the [Kibana][] API to obtain the service status.
This plugin has been tested and works on Kibana 6.x versions.
- Telegraf minimum version: 1.8
- Kibana minimum tested version: 6.0
[Kibana]: https://www.elastic.co/
### Configuration
```toml
[[inputs.kibana]]
## specify a list of one or more Kibana servers
## Specify a list of one or more Kibana servers
servers = ["http://localhost:5601"]
## Timeout for HTTP requests
@ -27,38 +29,27 @@ This plugin has been tested and works on Kibana 6.x versions.
# insecure_skip_verify = false
```
### Status mappings
When reporting health (green/yellow/red), additional field `status_code`
is reported. Field contains mapping from status:string to status_code:int
with following rules:
- `green` - 1
- `yellow` - 2
- `red` - 3
- `unknown` - 0
### Measurements & Fields
### Metrics
- kibana
- status_code: integer (1, 2, 3, 0)
- heap_total_bytes: integer
- heap_max_bytes: integer
- heap_used_bytes: integer
- uptime_ms: integer
- response_time_avg_ms: float
- response_time_max_ms: integer
- concurrent_connections: integer
- requests_per_sec: float
### Tags
- tags:
- name (Kibana reported name)
- source (Kibana server hostname or IP)
- status (Kibana health: green, yellow, red)
- version (Kibana version)
- fields:
- status_code (integer, green=1 yellow=2 red=3 unknown=0)
- heap_total_bytes (integer)
- heap_max_bytes (integer; deprecated in 1.13.3: use `heap_total_bytes` field)
- heap_used_bytes (integer)
- uptime_ms (integer)
- response_time_avg_ms (float)
- response_time_max_ms (integer)
- concurrent_connections (integer)
- requests_per_sec (float)
### Example Output
```
kibana,host=myhost,name=my-kibana,source=localhost:5601,status=green,version=6.5.4 concurrent_connections=8i,heap_max_bytes=447778816i,heap_total_bytes=447778816i,heap_used_bytes=380603352i,requests_per_sec=1,response_time_avg_ms=57.6,response_time_max_ms=220i,status_code=1i,uptime_ms=6717489805i 1534864502000000000
```

View File

@ -79,7 +79,7 @@ type heap struct {
}
const sampleConfig = `
## specify a list of one or more Kibana servers
## Specify a list of one or more Kibana servers
servers = ["http://localhost:5601"]
## Timeout for HTTP requests

View File

@ -63,7 +63,7 @@ func checkKibanaStatusResult(version string, t *testing.T, acc *testutil.Accumul
func TestGather(t *testing.T) {
ks := newKibanahWithClient()
ks.Servers = []string{"http://example.com:5601"}
// Unit test for Kibana version < 6.5
// Unit test for Kibana version < 6.4
ks.client.Transport = newTransportMock(http.StatusOK, kibanaStatusResponse6_3)
var acc1 testutil.Accumulator
if err := acc1.GatherError(ks.Gather); err != nil {
@ -71,14 +71,13 @@ func TestGather(t *testing.T) {
}
checkKibanaStatusResult(defaultTags6_3()["version"], t, &acc1)
//Unit test for Kibana version >= 6.5
//Unit test for Kibana version >= 6.4
ks.client.Transport = newTransportMock(http.StatusOK, kibanaStatusResponse6_5)
var acc2 testutil.Accumulator
if err := acc2.GatherError(ks.Gather); err != nil {
t.Fatal(err)
}
checkKibanaStatusResult(defaultTags6_5()["version"], t, &acc2)
}
func newKibanahWithClient() *Kibana {