2020-01-24 07:33:13 +08:00
|
|
|
# Kibana Input Plugin
|
2018-08-25 05:58:41 +08:00
|
|
|
|
2020-01-24 07:33:13 +08:00
|
|
|
The `kibana` plugin queries the [Kibana][] API to obtain the service status.
|
2018-08-25 05:58:41 +08:00
|
|
|
|
2020-01-24 07:33:13 +08:00
|
|
|
- Telegraf minimum version: 1.8
|
|
|
|
|
- Kibana minimum tested version: 6.0
|
|
|
|
|
|
|
|
|
|
[Kibana]: https://www.elastic.co/
|
2018-08-25 05:58:41 +08:00
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
|
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md
|
|
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
## Configuration
|
2018-08-25 05:58:41 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2022-04-08 06:01:21 +08:00
|
|
|
# Read status information from one or more Kibana servers
|
2018-08-25 05:58:41 +08:00
|
|
|
[[inputs.kibana]]
|
2020-01-24 07:33:13 +08:00
|
|
|
## Specify a list of one or more Kibana servers
|
2018-08-25 05:58:41 +08:00
|
|
|
servers = ["http://localhost:5601"]
|
|
|
|
|
|
|
|
|
|
## Timeout for HTTP requests
|
|
|
|
|
timeout = "5s"
|
|
|
|
|
|
|
|
|
|
## HTTP Basic Auth credentials
|
|
|
|
|
# username = "username"
|
|
|
|
|
# password = "pa$$word"
|
|
|
|
|
|
|
|
|
|
## Optional TLS Config
|
|
|
|
|
# tls_ca = "/etc/telegraf/ca.pem"
|
|
|
|
|
# tls_cert = "/etc/telegraf/cert.pem"
|
|
|
|
|
# tls_key = "/etc/telegraf/key.pem"
|
|
|
|
|
## Use TLS but skip chain & host verification
|
|
|
|
|
# insecure_skip_verify = false
|
|
|
|
|
```
|
|
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
## Metrics
|
2018-08-25 05:58:41 +08:00
|
|
|
|
|
|
|
|
- kibana
|
2020-01-24 07:33:13 +08:00
|
|
|
- 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)
|
2021-12-15 04:25:45 +08:00
|
|
|
- heap_size_limit (integer)
|
2020-01-24 07:33:13 +08:00
|
|
|
- uptime_ms (integer)
|
|
|
|
|
- response_time_avg_ms (float)
|
|
|
|
|
- response_time_max_ms (integer)
|
|
|
|
|
- concurrent_connections (integer)
|
|
|
|
|
- requests_per_sec (float)
|
2018-08-25 05:58:41 +08:00
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
## Example Output
|
2020-01-24 07:33:13 +08:00
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
```shell
|
2020-01-24 04:08:16 +08:00
|
|
|
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
|
|
|
|
|
```
|
2021-01-07 06:23:40 +08:00
|
|
|
|
|
|
|
|
## Run example environment
|
|
|
|
|
|
|
|
|
|
Requires the following tools:
|
|
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
- [Docker](https://docs.docker.com/get-docker/)
|
|
|
|
|
- [Docker Compose](https://docs.docker.com/compose/install/)
|
2021-01-07 06:23:40 +08:00
|
|
|
|
2022-06-08 05:37:08 +08:00
|
|
|
From the root of this project execute the following script:
|
|
|
|
|
`./plugins/inputs/kibana/test_environment/run_test_env.sh`
|
2021-01-07 06:23:40 +08:00
|
|
|
|
2022-06-08 05:37:08 +08:00
|
|
|
This will build the latest Telegraf and then start up Kibana and Elasticsearch,
|
|
|
|
|
Telegraf will begin monitoring Kibana's status and write its results to the file
|
|
|
|
|
`/tmp/metrics.out` in the Telegraf container.
|
2021-01-07 06:23:40 +08:00
|
|
|
|
2022-06-08 05:37:08 +08:00
|
|
|
Then you can attach to the telegraf container to inspect the file
|
|
|
|
|
`/tmp/metrics.out` to see if the status is being reported.
|
2021-01-07 06:23:40 +08:00
|
|
|
|
2022-06-08 05:37:08 +08:00
|
|
|
The Visual Studio Code [Remote - Containers][remote] extension provides an easy
|
|
|
|
|
user interface to attach to the running container.
|
|
|
|
|
|
|
|
|
|
[remote]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
|