Skip to content

Switch to UTC time for Redis data store #473

@bolshakov

Description

@bolshakov

Stoplight currently uses local time for Redis key generation and time bucketing. This causes issues during daylight saving time transitions:

  • When clocks fall back 1 hour, Stoplight reads statistics from the previous hour, causing incorrect error rate calculations and potentially inappropriate circuit breaker state changes
  • When clocks spring forward 1 houh, there's a gap in statistics, which may cause circuits to incorrectly open due to missing data
  • Services deployed in different timezones may have inconsistent behavior

Proposed Solution

Use UTC time consistently for all Redis operations:

  • Time bucket key generation
  • Timestamp storage in ZSETs
  • TTL calculations
  • All time-based logic

Impact on Users

  • Metric continuity will be broken during upgrade from v5.x to v6.0.0
  • During the upgrade window (roughly the duration of the configured window_size), circuits may have incomplete data
  • This is a one-time issue; after the upgrade window passes, behavior will be normal

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions