pinpoint-apm/pinpoint · warning · UnsupportedOperationException

UNSUPPORTED_OPERATION

Error message

UNSUPPORTED_OPERATION

What it means

DisableSpanRecorder is the no-op span recorder for disabled traces; attachFrameObject() always throws UnsupportedOperationException because no span is recorded and no per-span frame state can be stored. Hitting it means a caller attempted to attach state to a span that is intentionally not being recorded.

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/recorder/DisableSpanRecorder.java:272

        return getShared().setUriTemplate(uriTemplateFilter.filter(uriTemplate), force);
    }

    @Override
    public boolean recordUriHttpMethod(String httpMethod) {
        return getShared().setHttpMethods(httpMethod);
    }

    @Override
    public void recordParentServiceName(String parentServiceName) {
    }

    private Shared getShared() {
        return traceRoot.getShared();
    }

    @Override
    public Object attachFrameObject(Object frameObject) {
        throw new UnsupportedOperationException(UNSUPPORTED_OPERATION);
    }

    @Override
    public Object getFrameObject() {
        throw new UnsupportedOperationException(UNSUPPORTED_OPERATION);
    }

    @Override
    public Object detachFrameObject() {
        throw new UnsupportedOperationException(UNSUPPORTED_OPERATION);
    }
}

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Check whether the recorder is a DisableSpanRecorder before attaching frame objects
  2. Store frame state in an application-level context instead of the span recorder when tracing is disabled
  3. Ensure interceptors short-circuit their work when the trace is disabled
  4. Use SpanRecorder APIs that are safe on disabled traces (the no-op ones)

Example fix

// before
recorder.attachFrameObject(myState);
// after
if (!(recorder instanceof DisableSpanRecorder)) {
    recorder.attachFrameObject(myState);
}
Defensive patterns

Strategy: type-guard

Type guard

boolean supportsFrameObjects(SpanRecorder r) {
    return !(r instanceof DisableSpanRecorder);
}

Try / catch

try {
    recorder.attachFrameObject(state);
} catch (UnsupportedOperationException e) {
    logger.debug("Disabled span recorder; state not stored");
}

Prevention

When it happens

Trigger: Calling attachFrameObject(frameObject) on a DisableSpanRecorder — e.g. an interceptor that stores request-scoped state in the span recorder while the current trace is disabled.

Common situations: Plugins or instrumentation code written for normal traces being executed when profiling is disabled for the request (e.g. sampling turned off); missing checks for DisableTrace/DisableSpanRecorder before frame-object use.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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