pinpoint-apm/pinpoint · error · UnsupportedOperationException

slot type:${slot}

Error message

slot type:${slot}

What it means

DefaultActiveTraceHistogram maintains counters per histogram slot (FAST, NORMAL, SLOW, VERY_SLOW). increment() switches on the slot and has no case for other codes; any unrecognized slot value falls into a default branch that throws UnsupportedOperationException("slot type:" + slot). This means the ActiveTrace histogram was fed a code outside the configured HistogramSchema's expected slots.

Source

Thrown at agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/active/DefaultActiveTraceHistogram.java:62

    public void increment(HistogramSlot slot) {
        Objects.requireNonNull(slot, "slot");

        final SlotType slotType = slot.getSlotType();
        switch (slotType) {
            case FAST:
                this.fastCount++;
                return;
            case NORMAL:
                this.normalCount++;
                return;
            case SLOW:
                this.slowCount++;
                return;
            case VERY_SLOW:
                this.verySlowCount++;
                return;
            default:
                throw new UnsupportedOperationException("slot type:" + slot);
        }
    }

    @Override
    public HistogramSchema getHistogramSchema() {
        return histogramSchema;
    }

    @Override
    public int getFastCount() {
        return fastCount;
    }

    @Override
    public int getNormalCount() {
        return normalCount;
    }

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Pass slot codes obtained from histogramSchema's slot list (getHistogramSchema().findHistogramSlot(code)) rather than raw codes.
  2. Verify the HistogramSchema used to construct DefaultActiveTraceHistogram matches the one producing the slot codes (same schema instance/type).
  3. Log the offending slot value and map it to a valid slot before incrementing; skip unmapped codes defensively.
  4. Check agent plugin configs for custom slot codes unsupported by the default schema.
  5. If a custom schema is needed, extend the histogram implementation to handle its slots instead of relying on the default.

Example fix

// before
histogram.increment(rawCode); // may throw for unknown slot
// after
HistogramSlot slot = schema.findHistogramSlot(rawCode);
if (slot != null) {
    histogram.increment(slot.getSlotCode());
}
Defensive patterns

Strategy: validation

Validate before calling

HistogramSlot slot = schema.findHistogramSlot(code);
if (slot != null && schema.containsSlot(slot.getSlotCode())) {
    histogram.increment(slot.getSlotCode());
}

Type guard

boolean isValidSlot(HistogramSchema schema, short code) {
    return schema.findHistogramSlot(code) != null;
}

Try / catch

try {
    histogram.increment(slot);
} catch (UnsupportedOperationException e) {
    logger.warn("Unknown histogram slot: {}", slot, e);
}

Prevention

When it happens

Trigger: Calling increment(slot) — directly or via getActiveTraceHistogram()/getCounter() — with a short slot code that is not one of the schema's slot codes, e.g. a code from a different HistogramSchema mixed into the same histogram, or an uninitialized/default (0) slot code.

Common situations: Custom slot/annotation configuration whose schema differs from the one the histogram was built with; plugin code passing raw 'code' values instead of the schema's canonical slot codes; version changes where schema slot codes shifted between agent components.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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