The container output is 30 seconds behind the contents of the file causing problems when viewing the container output through Azure Log Analytics, as Log Analytics gets an inaccurate "Time-Generated" timestamp, making ordering in Log Analytics wrong, therefore making viewing the logs and troubleshooting confusing and very difficult.
Description
The container output is 30 seconds behind the contents of the file causing problems when viewing the container output through Azure Log Analytics, as Log Analytics gets an inaccurate "Time-Generated" timestamp, making ordering in Log Analytics wrong, therefore making viewing the logs and troubleshooting confusing and very difficult.
Change/ Fix
Reduce waitable time from 30 seconds
Testing
Deploy the new binary after change
Run this query in log analytics:
ContainerLog | where ContainerID in ('58b89a9a51a97a77cb9e0bcf5326ce326bcfc422cf96655fc5fced1374f2e73f') | extend LoglineEntry = parse_json(LogEntry) | extend LogEntryDetails = parse_json(LoglineEntry.LogEntry) | extend LogSource = LoglineEntry.Source | extend InFileDate = case(LogSource contains "File", todatetime(substring(LogEntryDetails.Logline, 0, 19)), LogEntryDetails.Time) | project LogSource, TimeGenerated, InFileDate, TimeDifference = toint(datetime_diff('second',TimeGenerated, InFileDate)), LogEntryDetails, LogEntry | where InFileDate != "" and LogSource contains "File" | distinct TimeGenerated, InFileDate;
Testing Results: Log analytics timestamp shows no delay