{"record":{"id":"0bb6a7047c476aa5","repo":"pinpoint-apm/pinpoint","slug":"slot-type-slot","errorCode":null,"errorMessage":"slot type:${slot}","messagePattern":"slot type:(.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/active/DefaultActiveTraceHistogram.java","lineNumber":62,"sourceCode":"    public void increment(HistogramSlot slot) {\n        Objects.requireNonNull(slot, \"slot\");\n\n        final SlotType slotType = slot.getSlotType();\n        switch (slotType) {\n            case FAST:\n                this.fastCount++;\n                return;\n            case NORMAL:\n                this.normalCount++;\n                return;\n            case SLOW:\n                this.slowCount++;\n                return;\n            case VERY_SLOW:\n                this.verySlowCount++;\n                return;\n            default:\n                throw new UnsupportedOperationException(\"slot type:\" + slot);\n        }\n    }\n\n    @Override\n    public HistogramSchema getHistogramSchema() {\n        return histogramSchema;\n    }\n\n    @Override\n    public int getFastCount() {\n        return fastCount;\n    }\n\n    @Override\n    public int getNormalCount() {\n        return normalCount;\n    }\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/active/DefaultActiveTraceHistogram.java#L44-L80","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass slot codes obtained from histogramSchema's slot list (getHistogramSchema().findHistogramSlot(code)) rather than raw codes.","Verify the HistogramSchema used to construct DefaultActiveTraceHistogram matches the one producing the slot codes (same schema instance/type).","Log the offending slot value and map it to a valid slot before incrementing; skip unmapped codes defensively.","Check agent plugin configs for custom slot codes unsupported by the default schema.","If a custom schema is needed, extend the histogram implementation to handle its slots instead of relying on the default."],"exampleFix":"// before\nhistogram.increment(rawCode); // may throw for unknown slot\n// after\nHistogramSlot slot = schema.findHistogramSlot(rawCode);\nif (slot != null) {\n    histogram.increment(slot.getSlotCode());\n}","handlingStrategy":"validation","validationCode":"HistogramSlot slot = schema.findHistogramSlot(code);\nif (slot != null && schema.containsSlot(slot.getSlotCode())) {\n    histogram.increment(slot.getSlotCode());\n}","typeGuard":"boolean isValidSlot(HistogramSchema schema, short code) {\n    return schema.findHistogramSlot(code) != null;\n}","tryCatchPattern":"try {\n    histogram.increment(slot);\n} catch (UnsupportedOperationException e) {\n    logger.warn(\"Unknown histogram slot: {}\", slot, e);\n}","preventionTips":["Derive slot codes from the histogram's own HistogramSchema, never hardcode","Use one shared schema instance across producer and histogram","Map unknown codes through findHistogramSlot and skip nulls","Cover custom slot configs in unit tests","Log offending slot values instead of letting them crash telemetry collection"],"tags":["java","pinpoint","monitoring","histogram","unsupported-operation"],"backgroundTag":"invalid-enum-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}