-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Do not throttle deprecated field logs #70009
Do not throttle deprecated field logs #70009
Conversation
The commit elastic#55115 removed the possibility to directly force deprecation log to be emitted. This means that usage of deprecated fields was throtthled and only one deprecation was logged. The key was common for all fields = "deprecated_field". This commit appends a used deprecated field name to prevent that throthling.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
@@ -111,7 +113,7 @@ public void testDeprecatedMessageWithoutXOpaqueId() throws IOException { | |||
public void testCompatibleLog() throws Exception { | |||
withThreadContext(threadContext -> { | |||
threadContext.putHeader(Task.X_OPAQUE_ID, "someId"); | |||
final DeprecationLogger testLogger = DeprecationLogger.getLogger("test"); | |||
final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the config we used in that test associated deprecation.test
with deprecation logger. And it is fine for DeprecationLogger in general as there is logic to handle it I am not really sure where we use it though https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java#L64
It was enough for this test to just use DeprecationLogger.getLogger("test").
However ParsedField (and all other usages) are using DeprecationLogger with the class name. So the logger name would be something like org.elasticsearch....
So I thought I will change the name of the deprecation logger in that test.
In fact it is what we have in production log4j2.properties as well.
The commit elastic#55115 removed the possibility to directly force deprecation log to be emitted. This means that usage of deprecated fields was throttled and only one deprecation was logged. The key was common for all fields = "deprecated_field". This commit appends a used deprecated field name to prevent that throttled.
The commit #55115 removed the possibility to directly force deprecation log to be emitted. This means that usage of deprecated fields was throttled and only one deprecation was logged. The key was common for all fields = "deprecated_field". This commit appends a used deprecated field name to prevent that throttled.
The commit #55115 removed the possibility to directly force deprecation
log to be emitted. This means that usage of deprecated fields was
throttled and only one deprecation was logged. The key was common for
all fields = "deprecated_field".
This commit appends a used deprecated field name to prevent that
throttled.
gradle check
?