Open Samyak2 opened 1 year ago
Thanks for opening this issue. A team member should give feedback soon. In the meantime, feel free to check out the contributing guidelines.
The issue is not clear to me. Are you creating a record with an ISO timestamp? The timestamp on the log record needs to be epoch nanos.
Bug description
Valid ISO 8601 timestamps in the
timestamp
attribute are sometimes not recognized correctly. The UI shows "Invalid Date" for timestamp.Example timestamp:
2023-01-27T11:20:17.619927Z
.These timestamps are generated by structlog's timestamper when these parameters are used:
The timestamp appears to be a valid ISO 8601 timestamp. For example, this jsfiddle in this answer says that the timestamp is valid. The ISO 8601 spec also seems to recognize this format.
Although, python's standard library does not recognize it (which ironic considering it originated from a python library):
I believe that it is
structlog
which is wrong. It usesdatetime.utcnow()
and explicitly adds aZ
to add the timestamp. Instead, it should usedatetime.now(timezone.utc)
. I will open a bug instructlog
for this, but I think SigNoz should support timestamps given by older version of structlog too.Expected behavior
The timestamp should be parsed and shown correctly in the UI.
How to reproduce
structlog
to ship logs to Signoz with theTimestamper
processor added. Note: steps for this are unclear and need to be added.Version information
Additional context
Slack discussion: https://signoz-community.slack.com/archives/C01HWQ1R0BC/p1674827471752029?thread_ts=1674825561.347139&cid=C01HWQ1R0BC