Reputation: 113
I'm encountering an intermittent "invalid metric type" error in my Spring Boot application when integrating with Mixpanel. The error appears in my logs as follows:
time="2024-11-03T23:00:58.328155210Z" level=error msg="invalid metric type for 0263554c5365dd6303716d90826da57990b4dcc0f37dbc8a7263402ced2ac063" error="<nil>"
The error does not happen consistently, only sometimes. Here are a few details about my setup:
Environment: Spring Boot application with a MixPanelService to handle tracking.
Concurrency: Each time a tracking event is triggered, a new instance of MixPanelService is created.
Tracking Module Setup:
public enum TrackingModuleEnum {
MIXPANEL(MixPanelService.class);
private final Class moduleClass;
private TrackingModuleEnum(Class moduleClass) {
this.moduleClass = moduleClass;
}
public ITrackingModule getModuleService(String moduleInfo) {
try {
ITrackingModule module = (ITrackingModule) this.moduleClass.newInstance();
module.initialize(moduleInfo);
return module;
} catch (InstantiationException | IllegalAccessException e) {
log.error(e.getMessage());
}
return null;
}
}
MixPanelService: Handles methods like trackDailyEvent and trackWeeklyEvents, which are called frequently.
Troubleshooting Steps Taken:
Questions:
Any guidance or suggestions on additional troubleshooting steps would be greatly appreciated! Thanks!
Upvotes: 0
Views: 12