# Is there any way of tracking request id?

**URL:** <https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832>\
**Category:** Elasticsearch\
**Created:** [November 19, 2014, 10:58am UTC](https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832 "2014-11-19T10:58:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![krzysztof\_dawid\_mako](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krzysztof_dawid_mako/32/1091_2.png) [@krzysztof\_dawid\_mako](https://discuss.elastic.co/u/krzysztof_dawid_mako)\
**Post date:** [November 19, 2014, 10:58am UTC](https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832/1 "2014-11-19T10:58:59Z")

</div>

Dear community,

I am looking for a feature which allows to attach requestId to the commands  
that my app is passing to the elasticsearch. It is because of our client  
requirements regarding ability to track user requests through all system  
components. After quick look into java api I do not see any possibility to  
put additional field with requestId to the query builder. Can you confirm  
that? What do you suggest to do then? Would it be easier to write  
elasticsearch plugin adding this feature or should we just do some dirty  
hacks like modifying query to contain request id but in the way that it  
will not affect returned hits.

Best regards,  
Krzysztof

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 19, 2014, 11:53am UTC](https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832/2 "2014-11-19T11:53:01Z")

</div>

I think you should solve that on application level.  
Though could this help? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-named-queries-and-filters.html#_named_queries)

Still, you have to record that somewhere.

Not sure I helped... ☹

David

> Le 19 nov. 2014 à 11:58, [krzysztof.dawid.makowski@gmail.com](mailto:krzysztof.dawid.makowski@gmail.com) a écrit :
> 
> Dear community,
> 
> I am looking for a feature which allows to attach requestId to the commands that my app is passing to the elasticsearch. It is because of our client requirements regarding ability to track user requests through all system components. After quick look into java api I do not see any possibility to put additional field with requestId to the query builder. Can you confirm that? What do you suggest to do then? Would it be easier to write elasticsearch plugin adding this feature or should we just do some dirty hacks like modifying query to contain request id but in the way that it will not affect returned hits.
> 
> ## Best regards, Krzysztof
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/D41A5CEF-9CB2-4DC8-AF3B-A87F813CC2E3%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/D41A5CEF-9CB2-4DC8-AF3B-A87F813CC2E3%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![krzysztof\_dawid\_mako](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krzysztof_dawid_mako/32/1091_2.png) [@krzysztof\_dawid\_mako](https://discuss.elastic.co/u/krzysztof_dawid_mako)\
**Post date:** [November 19, 2014, 1:02pm UTC](https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832/3 "2014-11-19T13:02:03Z")

</div>

Hmm

Thanks for the answer but it unfortunately did not help me. What I would  
like to achieve is ability to group logs from various system components.

Assuming that we have a system containing 3 components:

A - HTTP frontend  
B - My App  
C - Elasticsearch

and communication chain is as follows:

CLIENT -\> A (generation of unique request id happens here) -\> B (with given  
request id) -\> C (with given request id)

Now if there is an exception or warning logged in one of those systems it  
will be in the context of the generated unique request id. So assuming that  
we have centralized logging infrastructure it is very easy now to track the  
root causes and side effects of problems that occur in the system.

On Wednesday, November 19, 2014 12:53:28 PM UTC+1, David Pilato wrote:

> I think you should solve that on application level.  
> Though could this help?  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-named-queries-and-filters.html#_named_queries)
> 
> Still, you have to record that somewhere.
> 
> Not sure I helped... ☹
> 
> David
> 
> Le 19 nov. 2014 à 11:58, [krzysztof.da...@gmail.com](mailto:krzysztof.da...@gmail.com) \<javascript:\> a écrit :
> 
> Dear community,
> 
> I am looking for a feature which allows to attach requestId to the  
> commands that my app is passing to the elasticsearch. It is because of our  
> client requirements regarding ability to track user requests through all  
> system components. After quick look into java api I do not see any  
> possibility to put additional field with requestId to the query builder.  
> Can you confirm that? What do you suggest to do then? Would it be easier to  
> write elasticsearch plugin adding this feature or should we just do some  
> dirty hacks like modifying query to contain request id but in the way that  
> it will not affect returned hits.
> 
> Best regards,  
> Krzysztof
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/02474d21-19eb-4420-9971-0ad48c2cb864%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/02474d21-19eb-4420-9971-0ad48c2cb864%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [November 22, 2014, 4:52pm UTC](https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832/4 "2014-11-22T16:52:05Z")

</div>

Hi Krysztof,

I'm not 100% sure if this will help, but we are adding tracing and error  
capture to SPM [http://sematext.com/spm/](http://sematext.com/spm/). I _think_ that may do what you  
are after. In the mean time you could try setting up something like Zipkin.

## Otis

Monitoring \* Alerting \* Anomaly Detection \* Centralized Log Management  
Solr & Elasticsearch Support \* [http://sematext.com/](http://sematext.com/)

On Wednesday, November 19, 2014 8:02:03 AM UTC-5, [krzysztof.da...@gmail.com](mailto:krzysztof.da...@gmail.com)  
wrote:

> Hmm
> 
> Thanks for the answer but it unfortunately did not help me. What I would  
> like to achieve is ability to group logs from various system components.
> 
> Assuming that we have a system containing 3 components:
> 
> A - HTTP frontend  
> B - My App  
> C - Elasticsearch
> 
> and communication chain is as follows:
> 
> CLIENT -\> A (generation of unique request id happens here) -\> B (with  
> given request id) -\> C (with given request id)
> 
> Now if there is an exception or warning logged in one of those systems it  
> will be in the context of the generated unique request id. So assuming that  
> we have centralized logging infrastructure it is very easy now to track the  
> root causes and side effects of problems that occur in the system.
> 
> On Wednesday, November 19, 2014 12:53:28 PM UTC+1, David Pilato wrote:
> 
> > I think you should solve that on application level.  
> > Though could this help?  
> > [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-named-queries-and-filters.html#_named_queries)
> > 
> > Still, you have to record that somewhere.
> > 
> > Not sure I helped... ☹
> > 
> > David
> > 
> > Le 19 nov. 2014 à 11:58, [krzysztof.da...@gmail.com](mailto:krzysztof.da...@gmail.com) a écrit :
> > 
> > Dear community,
> > 
> > I am looking for a feature which allows to attach requestId to the  
> > commands that my app is passing to the elasticsearch. It is because of our  
> > client requirements regarding ability to track user requests through all  
> > system components. After quick look into java api I do not see any  
> > possibility to put additional field with requestId to the query builder.  
> > Can you confirm that? What do you suggest to do then? Would it be easier to  
> > write elasticsearch plugin adding this feature or should we just do some  
> > dirty hacks like modifying query to contain request id but in the way that  
> > it will not affect returned hits.
> > 
> > Best regards,  
> > Krzysztof
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8b04393d-900d-4283-aae2-c8e5c616ff92%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8b04393d-900d-4283-aae2-c8e5c616ff92%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 22, 2014, 10:04pm UTC](https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832/5 "2014-11-22T22:04:25Z")

</div>

One possibility is to use search templates

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

The template names could be used as request ids.

But, if I understand your scenario, the real question is about how to  
identify clients (e.g. by the node and socket connection they use, or more  
precise, the netty channel ID), and compose a client ID with the request  
IDs the client submits throughout the request life cycle. Currently, there  
is no internal mechanism how Elasticsearch could associate clients with  
their requests ("all search requests are equal").

Jörg

On Wed, Nov 19, 2014 at 11:58 AM, [krzysztof.dawid.makowski@gmail.com](mailto:krzysztof.dawid.makowski@gmail.com)  
wrote:

> Dear community,
> 
> I am looking for a feature which allows to attach requestId to the  
> commands that my app is passing to the elasticsearch. It is because of our  
> client requirements regarding ability to track user requests through all  
> system components. After quick look into java api I do not see any  
> possibility to put additional field with requestId to the query builder.  
> Can you confirm that? What do you suggest to do then? Would it be easier to  
> write elasticsearch plugin adding this feature or should we just do some  
> dirty hacks like modifying query to contain request id but in the way that  
> it will not affect returned hits.
> 
> Best regards,  
> Krzysztof
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/7d73dabc-a274-4488-bf03-709d41c37ccd%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHr7uffbcc2YHXCGKn-xpai\_%3DPKuVxGx%3D9iVW3CmJz7Jw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHr7uffbcc2YHXCGKn-xpai_%3DPKuVxGx%3D9iVW3CmJz7Jw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:48am UTC](https://discuss.elastic.co/t/is-there-any-way-of-tracking-request-id/20832/6 "2017-07-06T00:48:15Z")

</div>


