-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-29334 Associate log entries with Active JTrace info #18556
HPCC-29334 Associate log entries with Active JTrace info #18556
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-29334 Jirabot Action Result: |
Sample log output: 15:07:56.295080 3788 UNK UNK Loading /home/ubuntu/GIT/HPCC-Platform/build/Debug/libs/libesphttp.so |
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.
Looks good. One question about the implementation.
Sounds good. Did the question get published? |
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'm not sure where the comment went, I must have failed to add.
system/jlib/jlog.hpp
Outdated
void setTraceID(const char * theTraceID) { traceID.set(theTraceID);}; | ||
void setSpanID(const char * theSpanID) { spanID.set(theSpanID);}; | ||
private: | ||
StringAttr traceID = "UNK"; |
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.
Did you consider storing an Owned in this class? It would avoid the string clones
system/jlib/jlog.hpp
Outdated
MSGFIELD_all = 0xFFFFFF | ||
} LogMsgField; | ||
|
||
#ifdef _WIN32 | ||
#define MSGFIELD_STANDARD LogMsgField(MSGFIELD_timeDate | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_prefix | MSGFIELD_audience) | ||
#define MSGFIELD_LEGACY LogMsgField(MSGFIELD_timeDate | MSGFIELD_milliTime | MSGFIELD_msgID | MSGFIELD_process | MSGFIELD_thread | MSGFIELD_code | MSGFIELD_quote | MSGFIELD_prefix) | ||
#else | ||
|
||
//should trace/span be included in the standard fields? As-is, stderr output will not include trace/span |
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.
This comment no longer applies
1855920
to
f00f933
Compare
Appologies.... Looking back I see that my comment was truncated by github, so it wasn't clear. What I meant to say was What I was suggesting was something like this:
, where queryTraceid() and querySpanId() were added as members of ISpan. |
Yeah, I figured as much, but w/out the queryTrace/Span, it didn't make sense. I don't know if you recall, but I originally had those 2 methods in the ispan interface and was asked to remove in a code review. |
Yes please. You were obviously more forward looking than me! |
f00f933
to
6fe65db
Compare
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.
Looks good. Please squash and remove the logging left in.
@@ -791,6 +791,16 @@ class CSpan : public CInterfaceOf<ISpan> | |||
recordError(SpanError(msg.str(), e->errorCode(), spanFailed, escapedScope)); | |||
}; | |||
|
|||
virtual const char * queryTraceId() const override |
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.
One things I noticed. The trace id could only be stored in the server span, and all other spans could call parent->querySpan(). Definitely NOT something to do in this PR.
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.
Agreed.
testing/unittests/jlibtests.cpp
Outdated
@@ -442,7 +463,7 @@ class JlibTraceTest : public CppUnit::TestFixture | |||
{ | |||
Owned<IProperties> emptyMockHTTPHeaders = createProperties(); | |||
OwnedSpanScope serverSpan = queryTraceManager().createServerSpan("propegatedServerSpan", emptyMockHTTPHeaders); | |||
|
|||
ERRLOG("Random"); |
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.
Have these been left in by accident?
46b7604
to
192720f
Compare
Squashed. |
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.
Approved to merge, but I will hold off merging until I have recommendation about the linked issue.
@ghalliday chose to make the trace log columns optional, and provided sample configuration. |
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.
@rpastrana looks good. Please squash.
Is the plan to add support elsewhere, and then change the defaults once that support is in place?
Yes, it's the safest approach because we would lose ALA LogAccess if we forced this prematurely. I'd rather have the end users explicitly add the columns via configuration (for now) |
- Add support for JLog Trace and Span columns - Update logging README with new cols - Avoids uncaught exceptions - Adds trace/span fields to unittests log output - Adds various active span unittests - Ends span before reverting active threaded span so jlog output includes trace/span columns - Adds ISpan query Trace/Span ID methods - Jlog tracks linked Ispan - Makes trace/span Id log columns optional - Updates README, provides sample Signed-off-by: Rodrigo Pastrana <[email protected]>
cc2fa54
to
0d3a29c
Compare
@ghalliday squashed |
Type of change:
Checklist:
Smoketest:
Testing: