{"record":{"id":"11e053a7ba54a17d","repo":"apache/druid","slug":"failed-to-parse-metric-dimensions-and-types","errorCode":null,"errorMessage":"Failed to parse metric dimensions and types","messagePattern":"Failed to parse metric dimensions and types","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardConverter.java","lineNumber":88,"sourceCode":"      for (String dim : metricSpec.getDimensions()) {\n        if (userDims.containsKey(dim)) {\n          filteredDimensions.put(dim, userDims.get(dim).toString());\n        }\n      }\n      return metricSpec;\n    } else {\n      // No mapping found for given metric, return null\n      return null;\n    }\n  }\n\n  private Map<String, DropwizardMetricSpec> readMap(ObjectMapper mapper, String dimensionMapPath)\n  {\n    try (final InputStream is = openDimensionMapFile(dimensionMapPath)) {\n      return mapper.readerFor(new TypeReference<Map<String, DropwizardMetricSpec>>() {}).readValue(is);\n    }\n    catch (IOException e) {\n      throw new ISE(e, \"Failed to parse metric dimensions and types\");\n    }\n  }\n\n  private InputStream openDimensionMapFile(@Nullable String dimensionMapPath) throws IOException\n  {\n    if (Strings.isNullOrEmpty(dimensionMapPath)) {\n      log.info(\"Using default metric dimension and types\");\n      return this.getClass().getClassLoader().getResourceAsStream(\"defaultMetricDimensions.json\");\n    } else {\n      log.info(\"Using metric dimensions at types at [%s]\", dimensionMapPath);\n      return new FileInputStream(dimensionMapPath);\n    }\n  }\n}\n","sourceCodeStart":70,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardConverter.java#L70-L103","documentation":"Sentinel-style failure in DropwizardConverter.readMap(): the dimension/type mapping file referenced by dimensionMapPath could not be opened or deserialized into Map<String, DropwizardMetricSpec> (bad path, unreadable file, or invalid JSON structure). The converter cannot map incoming metric names to dropwizard names/types/dimensions without this file, so it aborts with this message and the underlying cause attached.","triggerScenarios":"Thrown at extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardConverter.java:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check dimensionMapPath points to an existing, readable file with valid JSON matching Map<String, DropwizardMetricSpec>.","Validate the mapping file's syntax and required fields (dimensions, type)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}