Add loki logpush via promtail#13
Conversation
|
This is unfortunately still not ready -- env expansion in promtail configuration is still not working (on dappnode). This leads to authorization errors: |
This aims to recreate the functionality from shutter-network/shutter-keyper-deployment#10 usable with the DAppnodePackage. Because we can not install the docker loki plugin, and everything is running in one container through supervisord, we need to resort to promtail and some extra log redirections to keep the docker logging working.
|
This is ready now! |
ulope
left a comment
There was a problem hiding this comment.
Apart from the question about rotation, LGTM.
| autostart = true | ||
| startretries = 9999 ; A large number enough to cover node updates | ||
| autorestart = true |
There was a problem hiding this comment.
Env var interpolation should allow to make autostart and autorestart conditional on the SHUTTER_PUSH_METRICS_ENABLED variable
| $SHUTTER_BIN chain --config "$SHUTTER_CHAIN_CONFIG_FILE" | ||
| if [[ SHUTTER_PUSH_LOGS_ENABLED=true ]]; | ||
| then | ||
| $SHUTTER_BIN chain --config "$SHUTTER_CHAIN_CONFIG_FILE" |& rotatelogs -n 1 -e -c /tmp/chain.log 5M |
There was a problem hiding this comment.
Does the "rotation" with only one file work correctly with promtail without causing log lines to be missed?
Reading the promtail logs on logrotation suggests it might not.
There was a problem hiding this comment.
I saw that documentation, but I could not fully figure out, whether it applies in this case. My assessment was that using a single file would actually work as intended, but now that I re-read your link I am not sure anymore.
Do you have another suggestion how to achieve what we need?:
- redirect output to file AND stdout (to keep docker logging working)
- keep the logfile from growing indefinitely
There was a problem hiding this comment.
I've added a comment but decided to leave it like this.
This aims to recreate the functionality from
shutter-network/shutter-keyper-deployment#10 usable with the DAppnodePackage.
Because we can not install the docker loki plugin, and everything is running in one container through supervisord, we need to resort to promtail and some extra log redirections to keep the docker logging working.
Fixes #10