发布

  • [OPIK-2856] [BE] Split Get spans Tests (#3933)

    frostbyte_neo 发布于 2025-11-04 16:20:22 +00:00

    • [NA] [BE] Upgrade MySQL container from Testcontainers

    • Fix imports order

    • [OPIK-2856] [BE] Implement UUIDv7 time-based filtering for traces

    • Add InstantToUUIDMapper to convert Instant timestamps to UUIDv7 bounds
    • Add InstantParamConverter to parse ISO-8601 and epoch millisecond time parameters
    • Update TracesResource to accept from_time and to_time parameters on /traces and /traces/stats endpoints
    • Update TraceDAO to apply UUID-based time filtering using BETWEEN clause on id column
    • Update TraceSearchCriteria to include uuidFromTime and uuidToTime fields
    • Add comprehensive integration tests for time filtering with boundary conditions
    • All tests passing: 10/10 time filtering tests + validation tests
    • [OPIK-2856] Address PR review comments: improve exception handling and type safety
    • Fix InstantParamConverter to catch specific DateTimeParseException instead of generic Exception
    • Add debug logging when falling back to epoch milliseconds parsing
    • Refactor anonymous ParamConverter class to named InstantConverter inner class for clarity
    • Suppress unchecked cast with @SuppressWarnings annotation
    • Fix MySQLContainerUtils return type to use MySQLContainer for type safety
    • [OPIK-2856] Fix InstantToUUIDMapperTest to match implementation
    • Update tests to reflect that toUpperBound uses next millisecond (+1ms) for inclusive BETWEEN queries
    • Remove outdated assertions expecting same timestamp in both bounds
    • Verify upper bound is lexicographically greater than lower bound
    • All 13 tests now passing
    • Remove setup duplicated code

    • Revision 2: Address PR review comments - LOW priority fixes

    • #7: Add INSTANCE singleton pattern for InstantConverter
    • #8: Use StringUtils.isEmpty() for null-safe empty check
    • Note: #2 and #3 already addressed in previous commit
    • Revision 3: Use IdGenerator.getTimeOrderedEpoch() for UUID bounds
    • Simplified InstantToUUIDMapper to use IdGenerator.getTimeOrderedEpoch() instead of convertOtelIdToUUIDv7
    • Per UUIDv7 RFC, sub-millisecond 12 bits are optional with millisecond granularity
    • Start/end interval semantics with ±1ms ensures correct BETWEEN query results
    • This approach has been battle-tested for months without issues per reviewer recommendation
    • Converted InstantToUUIDMapper to @Singleton service for proper DI integration
    • Updated TracesResource to inject InstantToUUIDMapper dependency
    • Updated tests to properly mock IdGenerator dependency
    • Fix tests

    • [OPIK-2856] [BE] Split Get spans Tests

    • Fix format

    下载附件