-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Improving Elasticsearch response logs #119062
Comments
Pinging @elastic/kibana-core (Team:Core) |
Moving in a good direction, I think! Thx! I'd need to look at some cloud ES proxy logs (between Kibana -> ES), but I believe it's difficult to correlate entries in that log, and the Kibana log, and it would be nice to be able to do that. I think we try to correlate by time right now. Would be easier if ES proxy logs included the query string params, but perhaps that's a big ask. Would
We "extend" ECS in the event log with a top-level |
Kibana will attach tracing fields to the log records in ECS-JSON format from
Yeah, we do it as well. As you can see in the case of |
Log correlation with cloud proxy logs would be fantastic. I'm not aware of any initiatives towards that, however. I guess @elastic/cloud-observability would know more. |
I agree that would be great, but I'm not aware of any planned work for that. The actual changes to the proxies themselves would be done by another team, and cloud observability would ensure that we properly parse and ingest the updated logs. |
In the infrastructures where it matters, there are other ways to achieve this (APM, proxy logs). Closing. |
Problem
Whenever the Elasicsearch client receives a response, Kibana emits logs in the following format:
layout.type: 'json'
layout.type: 'pattern'
As you can see, it's hard to use these logs when investigation any performance-related problems because the logs do not contain information about how long the request lasted, nor about the size of the response received.
Compare with
http.server.response
logs:layout.type: 'json'
layout.type: 'pattern'
Solution
Response time
Unforatuntely,
elasticsearch-js
client doesn't seem to measure how long the response took. I'm erring on the side of adding this logic to theelasticsearch-js
client since it manages the underlying connections. If @delvedor agrees, I will open an issue.Log format
layout.type: 'pattern'
The current format of the logs with
pattern
layout is influenced by DevTools format to make thestatusCode \n method path \n query
request params pasteable into Kibana DevTools.To ensure backward compatibility, we can add response time and response length to the very first line next to
statusCode
, which is not part of DevTools either. So the result will look like this:layout.type: 'pattern'
JSON format is a bit more complicated. Elasticsearch response logs do not confirm ECS HTTP nor
responseTime
is defined in ECS HTTP. We can start with keeping the response metadata inmessage
field.layout.type: 'json'
cc @pmuellr @kobelb to the question of improving the format of the logs to investigate Kibana performance problems.
The text was updated successfully, but these errors were encountered: