Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Prometheus parser and Kubernetes input plugin #691

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions plugins/inputs/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
_ "github.com/influxdata/telegraf/plugins/inputs/influxdb"
_ "github.com/influxdata/telegraf/plugins/inputs/jolokia"
_ "github.com/influxdata/telegraf/plugins/inputs/kafka_consumer"
_ "github.com/influxdata/telegraf/plugins/inputs/kubernetes"
_ "github.com/influxdata/telegraf/plugins/inputs/leofs"
_ "github.com/influxdata/telegraf/plugins/inputs/lustre2"
_ "github.com/influxdata/telegraf/plugins/inputs/mailchimp"
Expand Down
83 changes: 83 additions & 0 deletions plugins/inputs/kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Kubernetes Input Plugin

The Kubernetes plugin can gather metrics from Kubernetes services
- APIServer
- Scheduler
- Controller Manager
- Kubelet

### Configuration:

```toml
# Get metrics from Kubernetes services
[[inputs.kubernetes.apiserver]]
url = "http://mtl-nvcbladea-15.nuance.com:8080"
endpoint = "/metrics"
timeout = 5.0
# includes only metrics which match one of the
# following regexp
includes = ["apiserver_.*"]

[[inputs.kubernetes.scheduler]]
url = "http://mtl-nvcbladea-15.nuance.com:10251"
endpoint = "/metrics"
timeout = 1.0
# DO NOT include metrics which match one of the
# following regexp
excludes = ["scheduler_.*"]

[[inputs.kubernetes.controllermanager]]
url = "http://mtl-nvcbladea-15.nuance.com:10252"

[[inputs.kubernetes.kubelet]]
url = "http://mtl-nvcbladea-15.nuance.com:4194"
# You should increase metric_buffer_limit
# Because of number of kubelet metrics
# otherwise you can limit metrics with
# the following 'excludes' argument
excludes = ["container_.*"]
```

### Measurements & Fields:

This input plugin get measurements and fields from Kubernetes services.
If new metrics appear on K8S services, this plugin will grab it without
modification.

- http_request_duration_microseconds"
- 0.5
- 0.9
- 0.99
- count
- sum
- .......
- .......
- .......
- .......
- .......
- .......

### Tags:

This input plugin get metrics tags from Kubernetes services.
If new tags appear on K8S services, this plugin will grab it without
modification.

- kubeservice
- serverURL
- handler
- .......
- .......
- .......

### Example Output:

```
$ ./telegraf -config telegraf.conf -input-filter example -test
process_cpu_seconds_total,kubeservice=kubelet,serverURL=http://mtl-blade19-02.nuance.com:4194/metrics counter=452366.52 1455436043283475033
ssh_tunnel_open_fail_count,kubeservice=kubelet,serverURL=http://mtl-blade19-02.nuance.com:4194/metrics counter=0 1455436043284057879
get_token_count,kubeservice=kubelet,serverURL=http://mtl-blade19-02.nuance.com:4194/metrics counter=0 1455436043285030409
http_requests_total,code=200,handler=prometheus,kubeservice=kubelet,method=get,serverURL=http://mtl-blade19-02.nuance.com:4194/metrics counter=116 1455436043285364118
kubelet_generate_pod_status_latency_microseconds,kubeservice=kubelet,serverURL=http://mtl-blade19-02.nuance.com:4194/metrics 0.5=94441,0.9=186928,0.99=236698,count=0,sum=128409528225 1455436043285715318
process_max_fds,kubeservice=kubelet,serverURL=http://mtl-blade19-02.nuance.com:4194/metrics gauge=1000000 1455436043286061204
```
Loading