-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add full APM/DBM mode for Oracle #8090
Changes from 10 commits
fe6ca2f
6a0e5ae
ef32413
b07cca4
4d0fab8
20c710b
5bd91c4
860bb75
f7636a4
907ad6b
082bc46
612ae6d
f8907b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,11 +88,18 @@ public static AgentScope onEnter( | |
final AgentSpan span; | ||
final boolean isSqlServer = DECORATE.isSqlServer(dbInfo); | ||
|
||
if (isSqlServer && INJECT_COMMENT && injectTraceContext) { | ||
// The span ID is pre-determined so that we can reference it when setting the context | ||
final long spanID = DECORATE.setContextInfo(connection, dbInfo); | ||
// we then force that pre-determined span ID for the span covering the actual query | ||
span = AgentTracer.get().buildSpan(DATABASE_QUERY).withSpanId(spanID).start(); | ||
if (INJECT_COMMENT && injectTraceContext) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: What about having only one if (INJECT_COMMENT && injectTraceContext && (isSqlServer || isOracle)) {
if (isSqlServer) {
// DECORATE + build/start
} else if (isOracle) {
// start + DECORATE
}
} else {
startSpan()
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. Is it OK to merge the PR as it is, and do the change when we remove the instrumentation span for SQL Server? The line 96 ( |
||
if (isSqlServer) { | ||
// The span ID is pre-determined so that we can reference it when setting the context | ||
final long spanID = DECORATE.setContextInfo(connection, dbInfo); | ||
// we then force that pre-determined span ID for the span covering the actual query | ||
span = AgentTracer.get().buildSpan(DATABASE_QUERY).withSpanId(spanID).start(); | ||
} else if (DECORATE.isOracle(dbInfo)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: it's weird that we have a decorate method for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed now |
||
span = startSpan(DATABASE_QUERY); | ||
DECORATE.setAction(span, connection); | ||
} else { | ||
span = startSpan(DATABASE_QUERY); | ||
} | ||
} else { | ||
span = startSpan(DATABASE_QUERY); | ||
} | ||
|
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.
nit: maybe extract
"_DD_"
to a constant, likeOracleActionPrefix
or something ?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.
changed