-
Notifications
You must be signed in to change notification settings - Fork 3.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
HBASE-27762 Include EventType and ProcedureV2 pid in logging via MDC #5145
Conversation
With this change, on the region server, we get log messages like,
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
8534d42
to
e065f93
Compare
This comment was marked as outdated.
This comment was marked as outdated.
@@ -96,6 +97,10 @@ public EventHandler prepare() throws Exception { | |||
public void run() { | |||
Span span = TraceUtil.getGlobalTracer().spanBuilder(getClass().getSimpleName()) | |||
.setParent(Context.current().with(parent)).startSpan(); | |||
// assume that this is the top of an execution on a new or reused thread, that we're safe to | |||
// blast any existing MDC state. | |||
MDC.clear(); |
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.
We only call clear at the beginning? Is it possible to clear MDC at the end of a execution?
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.
Sure, seems no harm in that. You'd like to see it clear on both beginning and end?
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.
I prefer we do something like
MDC.put("blabla", "blabla");
try {
...
} finally {
MDC.clear();
}
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
e065f93
to
ce60ae8
Compare
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Test failure is https://issues.apache.org/jira/browse/HBASE-27720 . |
…pache#5145) Signed-off-by: Duo Zhang <[email protected]>
…pache#5145) Signed-off-by: Duo Zhang <[email protected]>
…pache#5145) Signed-off-by: Duo Zhang <[email protected]>
…pache#5145) Signed-off-by: Duo Zhang <[email protected]>
…pache#5145) Signed-off-by: Duo Zhang <[email protected]>
…pache#5145) Signed-off-by: Duo Zhang <[email protected]>
…pache#5145) Signed-off-by: Duo Zhang <[email protected]>
…5145) Signed-off-by: Duo Zhang <[email protected]>
…5145) Signed-off-by: Duo Zhang <[email protected]>
…5145) Signed-off-by: Duo Zhang <[email protected]>
…pache#5145) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit 1d3d900) Change-Id: Id2271f761dc7e858068d42f46e55a40eda4c5e36
No description provided.