Skip to content

Commit

Permalink
[pinpoint-apm#9595] Fixe precision of uri-metric of the vertx plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Feb 23, 2023
1 parent 71abc73 commit 8a71158
Showing 1 changed file with 11 additions and 16 deletions.
Expand Up @@ -127,10 +127,10 @@ public void before(Object target, Object[] args) {

entryScope(trace);
this.httpHeaderFilter.filter(request);

if (!trace.canSampled()) {
return;
}
// for URI-metric
// if (!trace.canSampled()) {
// return;
// }

final SpanEventRecorder recorder = trace.traceBlockBegin();
recorder.recordServiceType(VertxConstants.VERTX_HTTP_SERVER_INTERNAL);
Expand All @@ -144,9 +144,7 @@ public void before(Object target, Object[] args) {
}

} catch (Throwable t) {
if (logger.isWarnEnabled()) {
logger.warn("BEFORE. Caused:{}", t.getMessage(), t);
}
logger.warn("BEFORE. Caused:{}", t.getMessage(), t);
}
}

Expand Down Expand Up @@ -214,10 +212,11 @@ public void after(Object target, Object[] args, Object result, Throwable throwab
this.httpStatusCodeRecorder.record(trace.getSpanRecorder(), response.getStatusCode());
}

if (!trace.canSampled()) {
deleteTrace(trace);
return;
}
// for URI-metric
// if (!trace.canSampled()) {
// deleteTrace(trace);
// return;
// }

try {
final SpanEventRecorder recorder = trace.currentSpanEventRecorder();
Expand All @@ -228,9 +227,7 @@ public void after(Object target, Object[] args, Object result, Throwable throwab
parameterRecorder.record(recorder, request, throwable);
}
} catch (Throwable t) {
if (logger.isWarnEnabled()) {
logger.warn("AFTER. Caused:{}", t.getMessage(), t);
}
logger.warn("AFTER. Caused:{}", t.getMessage(), t);
} finally {
trace.traceBlockEnd();
deleteTrace(trace);
Expand Down Expand Up @@ -273,7 +270,6 @@ private void deleteTrace(final Trace trace) {
}



private boolean initScope(final Trace trace) {
// add user scope.
final TraceScope oldScope = trace.addScope(SCOPE_NAME);
Expand Down Expand Up @@ -314,5 +310,4 @@ private boolean isEndScope(final Trace trace) {
}



}

0 comments on commit 8a71158

Please sign in to comment.