-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Write deprecation logs to an index #46106
Comments
Pinging @elastic/es-core-infra |
Pinging @elastic/es-core-features |
This is a really cool idea. We were looking into this together with @ycombinator and @nik9000 to possibly start a filebeat that would consume ES logs and upload them back to an index. |
We discussed this in a couple of team meetings. Two approaches were discussed with the first being that we would rely on a bundled filebeat to ingest the deprecation logs and the other would include building this functionality into the DeprecationLogger itself. There is ongoing discussion about packaging filebeat and metricbeat with elasticsearch (#49399) but they would be disabled by default. Given the desire to have them be disabled and not add a new process by default, this would mean this functionality would explicitly require the user to do work. Whereas if we added this to the deprecation logger, we could enable it more easily. Given this, the discussion favored the process internal solution. There was additional discussion regarding:
|
While I was the one that suggested that we could use |
Pinging @elastic/es-ui |
Even batching I worry could exhaust resources in any case that a deprecation occurs per document in a query, as is typical when deprecations occur within scripting. I'm supportive of the idea of logging more if we move to an index, but I wanted to point out we still have edge cases we need to consider where logging the details of every warning is not practical. |
I don’t think we should deprecation log anything per document. Per request, that’s okay though, and I think alleviates a lot of pressure here. |
Could we use something like |
|
I've been playing around with the current deprecation logger. Since the logger is called all over the place, it seems unfeasible to introduce anything that would require changes to the call sites. Instead, I threw together a The main issue I had was security - the I also make the indexer listen to the cluster state so that when the cluster was ready, it could ensure an index template exists, then the indexer writes to a daily index. The indexer stops listening once it knows the template exists. So the questions I have are:
|
@pugnascotia that sounds good to me. I was hoping to reuse deprecation logger logic for compatible API warnings. So there will be even more usages. With regards to ECS, I am meant to tackle this here #47105 |
@pgomulka here's the branch: 4ff5e03...pugnascotia:index-deprecation-logs |
We can take this idea even further, and use this deprecation index as common collection point for deprecation logs across the Stack, and then expose in Kibana all the deprecated functionality in any Stack products that a user is using, helping give a full view across the Stack of changes a user might need to make when preparing to upgrade. We will need to hash out the details of this idea, which @pugnascotia will take charge on. 🙏 |
I had a good chat with @jakelandis about this, and we realised that although there are parallels with the existing monitoring code, given that we're ripping all that out and relying on stack features, we should do the same here. We can ship an index template that creates the deprecation index as a data stream with some suitable ILM settings. |
@pgomulka would you mind take a quick look at a new implementation for writing deprecation logs? See: |
Part of elastic#46106. Simplify the implementation of deprecation logging by relying of log4j more completely, and implementing additional behaviour through custom appenders and filters.
Part of #46106. Simplify the implementation of deprecation logging by relying of log4j more completely, and implementing additional behaviour through custom appenders and filters.
Backport of elastic#61474. Part of elastic#46106. Simplify the implementation of deprecation logging by relying of log4j more completely, and implementing additional behaviour through custom appenders and filters.
Closes #46106. Implement a new log4j appender for deprecation logging, in order to write logs to a dedicated data stream. This is controlled by a new setting, `cluster.deprecation_indexing.enabled`.
Backport of elastic#61484. Closes elastic#46106. Implement a new log4j appender for deprecation logging, in order to write logs to a dedicated data stream. This is controlled by a new setting, `cluster.deprecation_indexing.enabled`.
The Kibana Upgrade Assistant helps users prepare to the next major version of Elasticsearch. The upgrade assistant works by introspecting various aspects of a cluster and its usage to surface deprecated functionality that is in use, and also to prepare indices that require re-indexing. The deprecations that are surfaced in the migration assistant are those that can be ascertained by introspecting the current state of the cluster. It can not however, catch on-going uses of deprecated functionality (e.g., APIs) that can not be ascertained by introspecting the current state of the cluster. The upgrade assistant would be even more useful for our users if we could assist users in understanding their use of such deprecated functionality.
Today we do surface such deprecated functionality via the deprecation logs. The upgrade assistant does not have an easy way to get its hands on the deprecation logs.
The crux of this issue then is aimed at making it possible for the upgrade assistant to collect the deprecation logs from each running node. One way to do this is to write the deprecation logs to an index that the upgrade assistant could then read, along side the deprecations that it can already obtain.
It is likely that we want to consider the deprecation indices as system indices, and also manage them via ILM if ILM is available (e.g., use of a deprecated API no more recent than N months ago isn't relevant, it's likely that the user already migrated away from that API).
The text was updated successfully, but these errors were encountered: