Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s logs dump/assertion #1565

Closed
pepoviola opened this issue Nov 30, 2023 · 0 comments · Fixed by #1749
Closed

k8s logs dump/assertion #1565

pepoviola opened this issue Nov 30, 2023 · 0 comments · Fixed by #1749
Assignees
Labels
bug Something isn't working

Comments

@pepoviola
Copy link
Collaborator

In the k8s provider we rely on the kubectl logs cmd for both log line assertion and dumping the logs and most of the time this works as expected, but k8s internally read the pod log file from the host (vms in our case) and this file is managed by the log rotation settings so could be the case that the cmd kubectl logs... doesn't return the full log of the pod since the command only read the current file. This can cause false errors in logs assertions (e.g https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4420770)

❌ bob: count of log lines containing "Block history download is complete" is 1 within 60 second…
✅ bob: reports block height is at least 12136 within 90 seconds

(but the log line is present https://grafana.teleport.parity.io/goto/rFFuUAHSg?orgId=1 )

And also cause issues with the log dumps that we store as artifacts in gitlab, since we rely in the same command and we receive the partial log and not the full one.

After consider a couple of options, like store the process log locally or use an external log collator (e.g loki) to assert/dump, we decide to change the log reader fn to read the log line directly from the host. For doing this we should change the pod manifest to mount the path where the host store the logs from pods (same way that promtail does) and add the logic to read the logs of the pod not only in the current file but also in the rotated files.
We should also introduce a new key in the settings section to allow users to customize the path where the logs are stored in the host and we mount in the pods.

cc: @michalkucharczyk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant