Skip to content

Conversation

@wankai123
Copy link
Member

now, support the following format:

  "2026-01-20T03:27:18Z",
  "2026-01-20T03:27:18.0Z",
  "2026-01-20T03:27:18.000Z",
  "2026-01-20T03:27:18.123Z",
  "2026-01-20T11:27:18+08:00",
  "2026-01-20T11:27:18.0+08:00",
  "2026-01-20T11:27:18.123+08:00",
  "2026-01-20T11:27:18+0800",
  "2026-01-20T11:27:18.0+0800",
  "2026-01-20T11:27:18.123+0800",
  "2026-01-19T19:27:18-08:00",
  "2026-01-19T19:27:18.0-08:00",
  "2026-01-19T19:27:18.123-08:00",
  "2026-01-19T19:27:18-0800",
  "2026-01-19T19:27:18.0-0800",
  "2026-01-19T19:27:18.123-0800",
  "2026-01-20T03:27:18"

@wankai123 wankai123 added this to the 10.4.0 milestone Jan 20, 2026
@wankai123 wankai123 requested review from Copilot and wu-sheng January 20, 2026 08:39
@wankai123 wankai123 added bug Something isn't working and you are sure it's a bug! backend OAP backend related. labels Jan 20, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes time parsing issues in the PromQL service when using RFC3339 time format for querying. The implementation replaces Joda Time's ISODateTimeFormat with Java's DateTimeFormatter to support various RFC3339 timestamp formats including different millisecond precision levels and timezone offset formats.

Changes:

  • Created a custom RFC3339_FORMATTER using DateTimeFormatterBuilder to handle multiple RFC3339 timestamp variants
  • Updated formatTimestamp2Millis method to use the new formatter with OffsetDateTime instead of Joda Time
  • Added comprehensive test coverage for 17 different RFC3339 timestamp format variations

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
oap-server/server-query-plugin/promql-plugin/src/main/java/org/apache/skywalking/oap/query/promql/handler/PromQLApiHandler.java Implements RFC3339_FORMATTER and updates timestamp parsing logic to use Java time APIs
oap-server/server-query-plugin/promql-plugin/src/test/java/org/apache/skywalking/promql/handler/PromQLApiHandlerTest.java Adds test cases for various RFC3339 timestamp formats
docs/en/changes/changes.md Documents the fix in the changelog

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wu-sheng wu-sheng merged commit 82c070d into apache:master Jan 20, 2026
177 of 178 checks passed
@wankai123 wankai123 deleted the promql-rfc3399 branch January 20, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. bug Something isn't working and you are sure it's a bug!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] RFC3339 w/ msec fails in PromQL

2 participants