You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling to find a way to change datetime format when logs are exported with OpenTelemetry.Exporter.OpenTelemetryProtocol.
what i found so far is that all types besides numbers, strings, chars are converted to string using InvariantCulture and i didn't find any way to override this logic, like providing custom IFormatProvider or type specific serializer which would convert datetime to unixTs
I log some stuff like this using default ILogger
_logger.LogInformation("Good signal found side:{side} signalTs:{signalT} ",side,dt);
And in Loki dt is exported as MM/dd/yyyy HH:mm:ss which is not granular enough for me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm struggling to find a way to change datetime format when logs are exported with OpenTelemetry.Exporter.OpenTelemetryProtocol.
what i found so far is that all types besides numbers, strings, chars are converted to string using InvariantCulture and i didn't find any way to override this logic, like providing custom IFormatProvider or type specific serializer which would convert datetime to unixTs
I log some stuff like this using default ILogger
And in Loki dt is exported as
MM/dd/yyyy HH:mm:ss
which is not granular enough for me.Any suggestions will be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions