# ES有request时间99分位监控吗?

**URL:** <https://discuss.elastic.co/t/es-request-99/302700>\
**Category:** 中文提问与讨论\
**Created:** [April 19, 2022, 9:48am UTC](https://discuss.elastic.co/t/es-request-99/302700 "2022-04-19T09:48:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaojiabao1991](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaojiabao1991/32/104427_2.png) [@gaojiabao1991](https://discuss.elastic.co/u/gaojiabao1991)\
**Post date:** [April 19, 2022, 9:48am UTC](https://discuss.elastic.co/t/es-request-99/302700/1 "2022-04-19T09:48:23Z")

</div>

Hello大家好, 我是最近刚开始接触ES, 之前用过Lucene和Solr, 最近在把公司的Solr替换为ES.  
我们现在的监控是用prometheus社区提供的elasticsearch-exporter将ES的admin/metrics接口提供的系统运行信息记录到prometheus里. 然后我发现貌似ES的admin/metrics接口并没有提供查询的99分位时间信息.  
之所以问这个问题是因为我知道Solr是有这个指标的.

在Solr的文档里有以下描述:

```auto
p99_ms: Request processing time in milliseconds for the request 
which belongs to the 99th Percentile. E.g., if 100 requests are 
received, then the 99th fastest request time will be reported 
in this statistic.

```

[https://solr.apache.org/guide/8\_11/performance-statistics-reference.html](https://solr.apache.org/guide/8_11/performance-statistics-reference.html)

Solr的这个p99应该是core级别的(也就是对应的一个完整lucene索引), 用ES的术语来说, 就是每个shard(primary and replica respectively).

如果确认ES自身没有提供这个指标的话我感觉那就只有三种思路能解决了:

1. 自己想办法通过插件方式让ES支持统计99分位, 然后自己改exporter, 这个不知道是否能实现.
2. 从外部调用系统去统计, 比如加个网关.
3. 另外做个日志系统, 把所有的ES日志收集下来, 把response里的took time记录下来, 然后自己做统计.  
哪种思路靠谱一些? 更适合ES?

这个问题之前我发在英语的版块里过, 可能因为我表达的不清晰, 没得到回复, 所以来中文版块再重新问下.英文版块提问的连接:

> [@Does ES have the 99th percentile time of request?](https://discuss.elastic.co/t/does-es-have-the-99th-percentile-time-of-request/302557):
>
> Hello everyone, I'm new to ES, and I'm recently replacing our company's Solr with ES. Our current monitoring is to use the Elasticsearch-exporter provided by the prometheus community to record the system operation information into prometheus. And then use grafana to draw some charts. I think Elasticsearch-exporter reads system operation information from admin/metrics interface of ES. Then I found that it seems that the admin/metrics interface of ES does not provide the 99th percentile time in…

---

<div class="post-metadata">

**Author:** ![martinliu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martinliu/32/40279_2.png) [@martinliu](https://discuss.elastic.co/u/martinliu)\
**Post date:** [May 12, 2022, 2:58am UTC](https://discuss.elastic.co/t/es-request-99/302700/2 "2022-05-12T02:58:40Z")

</div>

是否可以尝试：开启 ES 的自监控，自监控的数据会存在 ES 的索引里，然后如果你需要做某个指标的 p99 的运算的话，就可以从 es 里面直接做了，然后从 es 的查询里直接取走数据 ，而不需要使用Elasticsearch-exporter。

---

<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:** [June 9, 2022, 2:59am UTC](https://discuss.elastic.co/t/es-request-99/302700/3 "2022-06-09T02:59:36Z")

</div>

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