pinpoint-apm/pinpoint · error · IllegalStateException
Micrometer is not enabled
Error message
Micrometer is not enabled
What it means
DefaultMicrometerMonitor's constructor requires that Micrometer support is explicitly enabled in the profiler configuration. When profiler.micrometer.enable is false (the default), constructing the monitor throws IllegalStateException. This fails fast so the caller falls back to the non-micrometer monitor implementation instead of silently collecting nothing.
Source
Thrown at agent-module/profiler-micrometer/src/main/java/com/navercorp/pinpoint/profiler/micrometer/DefaultMicrometerMonitor.java:47
* MicrometerMonitor
*
*/
public class DefaultMicrometerMonitor implements MicrometerMonitor {
private final Logger logger = LogManager.getLogger(this.getClass());
private final AgentOtlpMeterRegistry registry;
@Inject
public DefaultMicrometerMonitor(@Named("pinpoint.applicationName") String applicationName,
@Named("pinpoint.agentId") String agentId,
MicrometerConfig config) {
Objects.requireNonNull(applicationName, "applicationName");
Objects.requireNonNull(agentId, "agentId");
Objects.requireNonNull(config, "config");
if (!config.isEnable()) {
throw new IllegalStateException("Micrometer is not enabled");
}
OtlpConfig otlpConfig = AgentOtlpConfig.getOtlpConfig(
config.getUrl(),
config.getStep(),
config.getBatchSize(),
"default",
applicationName,
agentId);
this.registry = new AgentOtlpMeterRegistry(otlpConfig);
}
@Override
public void start() {
logger.info("MicrometerMonitor started");
}
View on GitHub (pinned to 744c3d3075)
Solutions
- Set profiler.micrometer.enable=true in the agent configuration before using DefaultMicrometerMonitor
- Use the profiler's monitor selection/factory logic instead of instantiating DefaultMicrometerMonitor directly
- Verify the loaded config file actually contains the micrometer enable property and it is not overridden elsewhere
- If micrometer is not needed, switch to the default monitor implementation
Example fix
// before
Monitor monitor = new DefaultMicrometerMonitor(appName, agentId, config);
// after
if (micrometerConfig.isEnable()) {
monitor = new DefaultMicrometerMonitor(appName, agentId, config);
} else {
monitor = new EmptyMonitor();
}
// plus in pinpoint.config: profiler.micrometer.enable=true Defensive patterns
Strategy: validation
Validate before calling
if (!profilerConfig.readBoolean("profiler.micrometer.enable", false)) {
// use the default monitor instead of DefaultMicrometerMonitor
} Try / catch
try {
monitor = new DefaultMicrometerMonitor(appName, agentId, micrometerConfig);
} catch (IllegalStateException e) {
logger.warn("micrometer disabled, falling back to default monitor");
monitor = new EmptyMonitor();
} Prevention
- Set profiler.micrometer.enable=true before enabling any micrometer metrics path
- Instantiate monitors via the profiler factory/selection logic, not directly
- Check for config overrides (env vars, external config) that flip the flag off
- Read the enable flag through the same MicrometerConfig object passed to the constructor
When it happens
Trigger: Constructing DefaultMicrometerMonitor while profiler.micrometer.enable=false in pinpont.config / pinpoint.properties; wiring the micrometer monitor unconditionally in custom profiler setup.
Common situations: Enabling micrometer-related metrics code paths without flipping the config flag; copying sample code that instantiates DefaultMicrometerMonitor directly; upgrade where monitor selection logic changed.
Related errors
- Disable activeThreadDump option. 'config.enable.activeThread
- Failed to register CustomMetric({}). message:not allowed met
- Unknown AgentType:
- Failed to detect pinpoint profile. Please add -Dpinpoint.act
- unsupported profile or profile alias:
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/7fe16ee8f4ff6f73.
Report an issue: GitHub.