Open mrxinu opened 5 years ago
Hi Steven,
that 'Z' suffix means the datetime is in UTC. Not being in UTC, no suffix (local server time).
The fact, whether DateTime is UTC/not UTC is defined in Orion SWIS schema (<property name="TimeStamp" type="datetime" dateTimeKind="Utc" />
for AlertHistory, nothing for ESI).
For me, that is kind of expected behavior. Kind of, because I'd expect everything to be in UTC, but that is different problem, that is not easy to tackle.
Hi @nothrow! Thanks for the quick reply. I don't know specifically why Go's json.Unmarshal
pukes on the version without the Z
but I'll look into it. In the meantime, if the lack of Z
is supposed to indicate local time, why would it be missing when the data from SNI_AlertIncidents
is in UTC?
That is apparently bug in the product, we omitted marking the field as UTC in SWIS schema. I filled that bug in. Sorry for the inconvenience.
Ad reasons for choking json.Unmarshal
-> I believe it follows RFC3339, which defines timezone information as mandatory, whereas SWIS (C# serializer) does not follow the RFC precisely.
Keeping this issue open till CORE-12185 is fixed.
The internal issue is now OADP-1291.
Did this ever get resolved? :)
Just spent a solid hour unpicking the same issue trying to integrate Grafana with Solarwinds, Is this fixed in a certain issue we should be upgrading to?
Despite both fields being of type
DateTime
in the underlying tables, the format of the strings produced when querying with the API differ. The former has aZ
suffix and the latter does not.Querying the
Orion.AlertHistory
entity:Querying the
Orion.ESI.AlertIncident
entity:For reference, here are the SQL table definitions for each:
Orion.AlertHistory
Orion.ESI.AlertIncident