# Elasticsearch Latency Metrics

**URL:** https://discuss.elastic.co/t/elasticsearch-latency-metrics/68796
**Category:** Elasticsearch
**Created:** [December 13, 2016, 12:32am UTC](https://discuss.elastic.co/t/elasticsearch-latency-metrics/68796 "2016-12-13T00:32:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)
#### Post date: [December 13, 2016, 12:32am UTC](https://discuss.elastic.co/t/elasticsearch-latency-metrics/68796/1 "2016-12-13T00:32:30Z")

</div>

We are trying to set up monitoring for Elasticsearch using statsd (not using Kibana). We also enabled slow logs:

```
curl -XPUT 'localhost:9200/_template/template_1?pretty' -d'
    {
      "template": "*",
      "settings": {
          "index.indexing.slowlog.level" : "info",
          "index.indexing.slowlog.source" : "1000",
          "index.indexing.slowlog.threshold.index.debug" : "0ms",
          "index.indexing.slowlog.threshold.index.info" : "0ms",
          "index.indexing.slowlog.threshold.index.trace" : "0ms",
          "index.indexing.slowlog.threshold.index.warn" : "0ms",
          "index.search.slowlog.threshold.fetch.debug" : "0ms",
          "index.search.slowlog.threshold.fetch.info" : "0ms",
          "index.search.slowlog.threshold.fetch.trace" : "0ms",
          "index.search.slowlog.threshold.fetch.warn" : "0ms",
          "index.search.slowlog.threshold.query.debug" : "0ms",
          "index.search.slowlog.threshold.query.info" : "0ms",
          "index.search.slowlog.threshold.query.trace" : "0ms",
          "index.search.slowlog.threshold.query.warn" : "0ms"
      } 
}

```

Following are some of the metrics I see logged by statsd and slow logs

## Statsd:

indexing\_index\_time\_in\_millis value  
search\_query\_time\_in\_millis value

## slow logs:

**Search Log:**

```
[2016-12-13T00:11:28,171][WARN][index.search.slowlog.fetch] [elasticsearch-data1-host] [testfieldset][0] took[364.2micros], took_millis[0], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[{
  "ext" : { }
}],

```

**Index Log:**

`[2016-12-12T22:41:19,850][WARN][index.indexing.slowlog.index] [elasticsearch-data1-host] [2906a5de043548ca9ffe93b0/IFHyGrjoQzq9XW0O1T9ajQ] took[780.3micros], took_millis[0], type[records], id[AVj1Mohnpy7Iwavve0Dw], routing[]`

Questions:

1. I was wondering if these metrics from slow log and statsd are same? i.e. is index.indexing.slowlog.index =\> took\_millis same as indexing\_index\_time\_in\_millis and is index.search.slowlog.fetch =\> took\_millis same as search\_query\_time\_in\_millis?
2. Assuming answer to 1 is yes, do we have to enable slow logs for elasticsearch to log indexing\_index\_time\_in\_millis & search\_query\_time\_in\_millis that are later collected by statsd?

Please let me know. Thank you.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 10, 2017, 12:32am UTC](https://discuss.elastic.co/t/elasticsearch-latency-metrics/68796/2 "2017-01-10T00:32:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
