fix: Do not auto format time in JsonLogger

In Dedicated tenants Opensearch is having trouble with misformatted time values for User Experience SLI logs. Here's the incident issue: https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/incident-management/-/issues/2448.

In a previous attempt, I've introduced code to automatically format time values in the JsonLogger, but it had a hidden bug where the input was the wrong one, leading to no impact in the payload being logged.

The issue then surface as an incident in Dedicated tenants, because Opensearch was enforcing end_time as a date, but could not parse 2026-01-20 10:02:47 UTC as a valid date, and then it stores as a string, breaking the index pattern. Which I promptly tried to mitigate with a hotfix. However, working on the Rails MR I noticed the frozen hash issue, stepping back from that solution and trying to ignore frozen hashes.

After all this trouble, I believe trying to handle auto-formatting in JsonLogger was a mistake. Perhaps after we standardize logging fields and their expected types, we can move towards enforcing and handling them automatically in situations like that. For now, might be simpler and safer to delegate the responsibility to the caller.

Obs.: Rails is running on Labkit v1.0.1.

Edited by Hercules Merscher

Merge request reports

Loading
Loading