Skip to content

Commit da32568

Browse files
committed
test out further post processing handling
1 parent 1b5207c commit da32568

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

inferred-spans/src/main/java/io/opentelemetry/contrib/inferredspans/internal/SamplingProfiler.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
* stack trace}.
102102
*/
103103
public class SamplingProfiler implements Runnable {
104-
// fake comment to bump for more test runs
104+
105105
private static final String LIB_DIR_PROPERTY_NAME = "one.profiler.extractPath";
106106

107107
private static final Logger logger = Logger.getLogger(SamplingProfiler.class.getName());
@@ -319,6 +319,9 @@ public boolean onActivation(Span activeSpan, @Nullable Span previouslyActive) {
319319
if (previouslyActive == null) {
320320
profiler.addThread(Thread.currentThread());
321321
}
322+
if (!config.isPostProcessingEnabled()) {
323+
return true;
324+
}
322325
boolean success =
323326
eventBuffer.tryPublishEvent(activationEventTranslator, activeSpan, previouslyActive);
324327
if (!success) {
@@ -345,6 +348,9 @@ public boolean onDeactivation(Span deactivatedSpan, @Nullable Span previouslyAct
345348
if (previouslyActive == null) {
346349
profiler.removeThread(Thread.currentThread());
347350
}
351+
if (!config.isPostProcessingEnabled()) {
352+
return true;
353+
}
348354
boolean success =
349355
eventBuffer.tryPublishEvent(
350356
deactivationEventTranslator, deactivatedSpan, previouslyActive);

0 commit comments

Comments
 (0)