-
Notifications
You must be signed in to change notification settings - Fork 0
Add loki logpush via promtail #13
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bd77ba0
Add loki logpush via promtail
konradkonrad 0739ae0
Make executable
konradkonrad ea7d774
Fix variable expansion
konradkonrad 4c00dc1
Fix script path
konradkonrad c0e9b80
Fix config labels
konradkonrad 5be8127
Fix logfile path
konradkonrad e282e19
Forward more environment
konradkonrad 45a886a
Expand env in promtail config
konradkonrad d36955a
Propagate env through supervisor
konradkonrad d3b2ba9
Adjust to supervisord fmt string syntax
konradkonrad 5ae7044
Fix promtail env expansion
konradkonrad 3cbd627
Bundle stdout/stderr in logpush
konradkonrad fba8736
Conditionally start promtail
konradkonrad 0688cbd
Avoid unitialized environment variables
konradkonrad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| server: | ||
| http_listen_port: 9080 | ||
| grpc_listen_port: 0 | ||
|
|
||
| positions: | ||
| filename: /tmp/positions.yaml | ||
|
|
||
| client: | ||
| url: https://logs.metrics.shutter.network/insert/loki/api/v1/push | ||
| basic_auth: | ||
| username: ${PUSHGATEWAY_USERNAME} | ||
| password: ${PUSHGATEWAY_PASSWORD} | ||
|
|
||
| scrape_configs: | ||
| - job_name: configure | ||
| pipeline_stages: | ||
| - docker: | ||
| static_configs: | ||
| - targets: | ||
| - localhost | ||
| labels: | ||
| job: configure | ||
| host: ${KEYPER_NAME} | ||
| __path__: /tmp/configure.log | ||
|
|
||
| - job_name: keyper | ||
| pipeline_stages: | ||
| - docker: | ||
| static_configs: | ||
| - targets: | ||
| - localhost | ||
| labels: | ||
| job: keyper | ||
| host: ${KEYPER_NAME} | ||
| __path__: /tmp/keyper.log | ||
|
|
||
| - job_name: chain | ||
| pipeline_stages: | ||
| - docker: | ||
| static_configs: | ||
| - targets: | ||
| - localhost | ||
| labels: | ||
| job: chain | ||
| host: ${KEYPER_NAME} | ||
| __path__: /tmp/chain.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
|
|
||
|
|
||
| if [[ SHUTTER_PUSH_LOGS_ENABLED=true ]]; | ||
| then | ||
| configure.sh |& rotatelogs -n 1 -e -c /tmp/configure.log 5M | ||
| else | ||
| configure.sh | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/bash | ||
|
|
||
| run_promtail() { | ||
| if [[ $SHUTTER_PUSH_LOGS_ENABLED=true ]]; | ||
| then | ||
| promtail -config.expand-env=true -log-config-reverse-order -print-config-stderr -config.file /etc/promtail_config.yaml | ||
| else | ||
| tail -f /dev/null | ||
| fi | ||
| } | ||
|
|
||
| run_promtail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a comment but decided to leave it like this.