ApplicationInsights-PHP
ApplicationInsights-PHP copied to clipboard
Start time doesn't support ms.
This makes is pretty much useless when comparing telemetry events.
The ISO string returned from this utility is only accurate to the second. https://github.com/microsoft/ApplicationInsights-PHP/blob/95407ee7978a729f9bad5e2469ff07aadfe6bbd3/ApplicationInsights/Channel/Telemetry_Channel.php#L161
And all start times should use microtime(); https://github.com/microsoft/ApplicationInsights-PHP/blob/95407ee7978a729f9bad5e2469ff07aadfe6bbd3/ApplicationInsights/Channel/Telemetry_Channel.php#L158
Actual Behavior
Start times are truncated at seconds.
Expected Behavior
All times should be accurate to at least milliseconds.
Workaround
We've had to implement a workaround right before flushing. We store the start_time in microseconds, then rewrite the start time right before flushing.
I will try to put together a PR with the fixes.
This will require some breaking changes as all start times will now need to be in milliseconds.
This shouldn't break any code as passing in a time() will just ignore the milliseconds.