pinpoint-apm/pinpoint · warning · UnsupportedOperationException

UNSUPPORTED_OPERATION

Error message

UNSUPPORTED_OPERATION

What it means

DisableChildTrace represents child traces of unsampled (disabled) traces; since no real trace exists, TraceId-dependent operations are not supported and getTraceId() throws UnsupportedOperationException('UNSUPPORTED_OPERATION').

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DisableChildTrace.java:115

    }

    private LocalTraceRoot getTraceRoot() {
        return this.traceRoot;
    }

    @Override
    public long getId() {
        return getTraceRoot().getLocalTransactionId();
    }

    @Override
    public long getStartTime() {
        return traceRoot.getTraceStartTime();
    }

    @Override
    public TraceId getTraceId() {
        throw new UnsupportedOperationException(UNSUPPORTED_OPERATION);
    }

    @Override
    public boolean canSampled() {
        return false;
    }

    @Override
    public boolean isRoot() {
        return false;
    }

    @Override
    public boolean isAsync() {
        return true;
    }

    @Override

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Check canSampled()/trace type before calling getTraceId()
  2. Use traceRoot or the parent's TraceId where available instead
  3. Handle UnsupportedOperationException gracefully in plugin code
  4. Only record data on sampled traces

Example fix

// before
long id = trace.getTraceId().getTransactionSequence(); // throws on DisableChildTrace
// after
if (trace.canSampled()) {
    long id = trace.getTraceId().getTransactionSequence();
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (!trace.canSampled()) {
    // skip TraceId access
}

Type guard

boolean hasTraceId(Trace t) {
    return t.canSampled() && !(t instanceof DisableChildTrace);
}

Try / catch

try {
    TraceId id = trace.getTraceId();
} catch (UnsupportedOperationException e) {
    // unsampled/disabled trace: skip TraceId-dependent logic
}

Prevention

When it happens

Trigger: Calling getTraceId() on a DisableChildTrace instance — e.g. plugin code or logging that requests the trace id from a child of a sampling-disabled trace.

Common situations: Custom plugins assuming every Trace object exposes a TraceId; logging frameworks reading traceId during unsampled requests; code paths that skip canSampled() checks before accessing trace metadata.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/bfe8ed515d1723c6. Report an issue: GitHub.