I am overall using Loki pretty successful in my nodejs app with Winston.
However, only when I am using it in cron job pods which has short container life, I get only the first message in Grafana and the rest is missing.
I’m just guessing here because I haven’t used Winston, but are you sure Winston is writing all the logs before the pod exits? Have you tried the gracefulShutdown option as specified here?
Sounds like you should be asking the Winston folks about this behaviour, because Winston is not (to my knowledge) a supported Loki client.
Hey @dannykopping
Yes, I have tried to use gracefulShutdown but no help. The last message before process exit is lost most of the time and looks like Winston is not having a chance to flush the buffer.
Also running into this issue with a scraper run as a cron job.
I am awaiting all calls properly and the application works as intended. The logging from winston to console works just fine, however the LokiTransport seems to miss all but the two first messages.