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

Rest API: Add an X-Opaque-Id header, to be returned in the response if exists in the request #1202

Closed
kimchy opened this issue Aug 3, 2011 · 8 comments

Comments

@kimchy
Copy link
Member

kimchy commented Aug 3, 2011

The X-Opaque-Id header, when provided on the request header, will be returned as a header in the response. This allows to track possibly track calls, or implement more efficient concurrent clients.

@kimchy kimchy closed this as completed in 9503126 Aug 3, 2011
@tallpsmith
Copy link

Hey, this would be sensational to use this ID as part of slf4j(log4j, logback) MDC concept (http://www.slf4j.org/manual.html#mdc).

If all logs in Elasticsearch were tagged with this id coming from the client then one has fantastic log correlation across the cluster.

@tallpsmith
Copy link

that implies that all intra-cluster-node communication passes this header on as part of the requests too.

@kimchy
Copy link
Member Author

kimchy commented Aug 4, 2011

that implies that all intra-cluster-node communication passes this header on as part of the requests too.

Yep, and thats harder :)

@tallpsmith
Copy link

ahhh... come on.... "It's wafer thin.. "? :)

This would be great for Google Dapper like retrospective analysis!

@tallpsmith
Copy link

BTW, is there anyway to set this header in the Java api when making a search request? I'd like to be able to set this header with our unique requestId on our app side, and then have the elasticsearch-jetty plugin log this (see sonian/elasticsearch-jetty#16).

that way the logs on ES would have the requestID being passed across.

@kimchy
Copy link
Member Author

kimchy commented Mar 1, 2012

@tallpsmith No, there isn't...

@tallpsmith
Copy link

if you had a pointer of an approximate location in the ES Code that could be tweaked to add this feature, I might get a pull request ready, but only if you think it's feasible to do (and you'd be happy to accept the idea)?

@kimchy
Copy link
Member Author

kimchy commented Mar 2, 2012

@tallpsmith it makes sense, but adding it is a bit of a big task. The transport level APIs do not have the concept of metadata passing when executing an operation (or headers). So it needs to be added (in the most non intrusive manner as possible) and then used through the system. Requires some thinking on how best to do it...

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
jev001 pushed a commit to jev001/elasticsearch that referenced this issue Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants