{"record":{"id":"94bb8f906fabad95","repo":"prestodb/presto","slug":"prometheus-unknown-error-94bb8f","errorCode":"PROMETHEUS_UNKNOWN_ERROR","errorMessage":"unable to deserialize timestamp: ${e.getMessage()}","messagePattern":"unable to deserialize timestamp: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusTimestampDeserializer.java","lineNumber":45,"sourceCode":"public class PrometheusTimestampDeserializer\n        extends JsonDeserializer<Instant>\n{\n    static Instant decimalEpochTimestampToSQLTimestamp(String timestamp)\n    {\n        long promTimestampMillis = (long) (Double.parseDouble(timestamp) * 1000);\n        return ofEpochMilli(promTimestampMillis);\n    }\n\n    @Override\n    public Instant deserialize(JsonParser jsonParser, DeserializationContext context)\n            throws IOException\n    {\n        String timestamp = jsonParser.getText().trim();\n        try {\n            return decimalEpochTimestampToSQLTimestamp(timestamp);\n        }\n        catch (NumberFormatException e) {\n            throw new PrestoException(PROMETHEUS_UNKNOWN_ERROR, \"unable to deserialize timestamp: \" + e.getMessage());\n        }\n    }\n}\n","sourceCodeStart":27,"sourceCodeEnd":49,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusTimestampDeserializer.java#L27-L49","documentation":"Catch in PrometheusTimestampDeserializer.deserialize: the JSON timestamp string is not a parseable decimal epoch value (NumberFormatException) or the parse overflows, so it cannot be converted to an Instant. Fires when Prometheus (or an intermediary) returns timestamps in an unexpected format.","triggerScenarios":"Thrown at presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusTimestampDeserializer.java:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the Prometheus server returns RFC3339/decimal-epoch timestamps as expected","Skip or log the malformed sample instead of failing the whole response","Check for non-numeric placeholder values in the response"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}