-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Provide substitution for elasticsearch.logQueries in the new logging config #57546
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
I am surprised we kept the |
No they're both the same at this point and can be used interchangeably. We decided in #49870 to just not remove this until we introduce the new Elasticsearch client. |
Been digging into this a bit and there's a few things that warrant some discussion. First, the goal of this task is to have a config that allows a user to enable elasticsearch query logging, but is disabled by default (on 7.x branch). Since this feature already exists in the current Where I'm struggling is to find a way to support both logging:
loggers:
- context: elasticsearch.queries
level: info Options(1) The "obvious" way to me it could be done is to remove the checks in Core for (2) The best alternative I can find is to leverage the (3) An alternative would be to determine whether or not we're using the (4) An easier alternative is to do nothing in 7.x at all and leave the existing code as-is. We can then make this change in master/8.0 only to remove At this point, I lean towards (2) but would be ok with (4) as well. Both (1) and (3) seem to add more complexity we'd just have to remove later in 8.0. @restrry @lukeelmers @TinaHeiligers thoughts? |
All queries already logged with kibana/src/core/server/elasticsearch/client/configure_client.ts Lines 73 to 79 in 170a295
the legacy client:
Is that the same as removing this condition ?
If so, I'm okay to remove the |
This seems fine to me. TBH I always wondered why I needed to set both to get what I want when debugging.
Seems ok. These are not even uncatched errors, so the
We are starting to reach a point in time where we should decide on precise guidelines about how to should choose master/7.x divergence (4) versus compromise (2) in such scenarios imho. If I had to choose, I'll go with (4). But I'm totally fine with (2) which seems like the best option if we don't want to introduce divergence. |
My concern with (4) is not divergence but lack of real-world testing before the |
Is there a particular reason why we need to log the "new" If we logged at a The main downside to this approach is duplicate log entries, however as @restrry points out this would serve to encourage folks to start using the new config. FWIW, this is basically the same approach we took (so far) in response logs and ops logs. So if we were to do anything differently here, we may want to reconsider our approach in those PRs too. |
We will be logging at the
Main difference is that for res/ops logs, the legacy implementation was directly using the legacy logging system, and the new implementation is using the new logging system (and that these are two distinct implementations / code outputting the logs). That's not the case for the ES (and legacy ES) clients, that are already using the new logging system (which redirects to the legacy appender atm). We don't have the duplicated logs issues here, but we need to support the legacy/deprecated way to enable ES query logging. |
Thanks all for the responses! Here's my replies + summary: In response to @restrry:
👍
Yes, that's essentially it. Initially I was thinking we would also need to dynamically set the logging context level config based on In response to @lukeelmers:
No, the idea with (2) was that we would always be logging these LogRecords at the logging:
loggers:
- context: elasticsearch.query
level: debug But as I mentioned above, I don't think we need to do this at all since you previously had to set In response to @pgayvallet:
Yep that's exactly right. We won't have any duplicated logs in this case, but since the log messages are being produced on the new logging system, we just want to make sure we don't break the old configuration method. So in conclusion, this solution now is to:
The only caveat with this option is that starting in 7.12, turning on |
Ah, thanks for clarifying. That was the key point I was overlooking. In that case Josh's solution proposed above makes sense to me 👍 |
nothing even comes close to |
With the new logging config, we can deprecate
logging.logQueries
and provide logging configuration that can be used instead. The current setup forlogQueries
outputs logs for bothdata
andadmin
clients. While in the new platform both loggers are created withelasticsearch
as a parent context, therefore users have to declare config rules for both contexts separately.I'd suggest introducing a common context for both loggers to simplify setup:
elasticsearch.client.{client_name}
it also would help us when we expose a single elasticsearch client #49870UPDATED 04.08: there is no separate
admin
client anymore.The text was updated successfully, but these errors were encountered: