# Etcd input plugin

**URL:** <https://community.influxdata.com/t/etcd-input-plugin/1432>\
**Category:** Telegraf\
**Created:** [June 26, 2017, 9:55pm UTC](https://community.influxdata.com/t/etcd-input-plugin/1432 "2017-06-26T21:55:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srinivas\_Kotaru](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@Srinivas\_Kotaru](https://community.influxdata.com/u/Srinivas_Kotaru)\
**Post date:** [June 26, 2017, 9:55pm UTC](https://community.influxdata.com/t/etcd-input-plugin/1432/1 "2017-06-26T21:55:26Z")

</div>

Hi

We are using Kubernetes based platform. etcd is very key component in the Kubernetes cluster. I would like to collect metrics about etcd health, read, write speeds, latency, throughput etc information. Is there any best way to collect this information using telegraf ?

Srinivas Kotaru

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 26, 2017, 10:44pm UTC](https://community.influxdata.com/t/etcd-input-plugin/1432/2 "2017-06-26T22:44:29Z")

</div>

@Srinivas_Kotaru The way I’ve done it in the past is to use the [Prometheus plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus) to export the metrics in that format. You can also use [Kapacitor’s service discovery and scraping](https://www.influxdata.com/resources/kapacitor-service-discovery-pull-and-kubernetes/) to do this exact same thing.

If you are running TICK in kubernetes I would suggest you check out [`tick-charts`](https://github.com/influxdata/tick-charts)!

Hope that helps,

Jack

---

<div class="post-metadata">

**Author:** ![Srinivas\_Kotaru](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@Srinivas\_Kotaru](https://community.influxdata.com/u/Srinivas_Kotaru)\
**Post date:** [June 27, 2017, 2:31am UTC](https://community.influxdata.com/t/etcd-input-plugin/1432/3 "2017-06-27T02:31:26Z")

</div>

@jackzampolin Thanks as usual.

Can we pull Kube API server metrics instead of running Prometheus server? I mean every Kuburnet exposed metrics under /metrics URL.

Srinivas Kotaru

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 27, 2017, 3:35pm UTC](https://community.influxdata.com/t/etcd-input-plugin/1432/4 "2017-06-27T15:35:35Z")

</div>

@Srinivas_Kotaru Yup! But for kubelet metrics `telegraf` has a plugin that pulls those. The [`telegraf-ds`](https://github.com/influxdata/tick-charts/tree/master/telegraf-ds) is configured with that plugin by default.

---

<div class="post-metadata">

**Author:** ![adrianlzt](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/adrianlzt/32/1655_2.png) [@adrianlzt](https://community.influxdata.com/u/adrianlzt)\
**Post date:** [July 14, 2017, 12:48pm UTC](https://community.influxdata.com/t/etcd-input-plugin/1432/5 "2017-07-14T12:48:44Z")

</div>

Readiing the [FAQ](https://github.com/coreos/etcd/blob/master/Documentation/faq.md#what-does-the-etcd-warning-apply-entries-took-too-long-mean) of etcd they recommend monitoring the p99 of `backend_commit_duration_seconds` and `wal_fsync_duration_seconds`.

The data exported using the metrics endpoint is like:

```auto
etcd_disk_wal_fsync_duration_seconds_bucket{le="0.001"} 3.522449e+06
etcd_disk_wal_fsync_duration_seconds_bucket{le="0.002"} 1.0488103e+07
etcd_disk_wal_fsync_duration_seconds_bucket{le="0.004"} 1.3733184e+07

```

Have created a graph for that values? How?  
Thanks!

---

<div class="post-metadata">

**Author:** ![adrianlzt](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/adrianlzt/32/1655_2.png) [@adrianlzt](https://community.influxdata.com/u/adrianlzt)\
**Post date:** [July 14, 2017, 1:02pm UTC](https://community.influxdata.com/t/etcd-input-plugin/1432/6 "2017-07-14T13:02:42Z")

</div>

My approximation is to draw three lines with queries:

```auto
SELECT mean("0.016")/mean("count") FROM "etcd_disk_backend_commit_duration_seconds" WHERE $timeFilter GROUP BY time($__interval) fill(null)
SELECT mean("0.032")/mean("count") FROM "etcd_disk_backend_commit_duration_seconds" WHERE $timeFilter GROUP BY time($__interval) fill(null)

```

And draw a threshold line at 0.99.  
According to etcd docs, if disk is fast enough, 32ms line should be above 99% threshold line.  
Similar for wal\_fsync\_duration\_seconds.

 ![](https://discoursecommunity.s3-us-west-1.amazonaws.com/original/1X/b7619c80b4c1870185d108b9791189bf313a928f.png)
