-
Notifications
You must be signed in to change notification settings - Fork 1
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
Promtail-friendly one line logs #37
Merged
Merged
Conversation
This file contains 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
log prefixes datetime in standard format and loglevel run evals a command, saves its stderr, and if the return code means error, prints that stderr through log, to the script stdout
It works, but we don't use it still from tasks. We have to decide how to combine many promtail jobs that we could need from a webapp, e.g.: backups + app logs + system logs. We leave this config here for the record.
Moved to a github gist https://gist.github.com/raneq/91226431be7f6be94c99cb2e59ba9bf8 Created a new issue at monitoring role coopdevs/monitoring-role#4
sauloperez
requested changes
Jan 7, 2020
CHANGELOG.md
Outdated
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
## [Unreleased] | |||
|
|||
- Print promtail-friendly logs. See #37 |
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'd like to have the link to the PR as well. In the vast majority of cases we'll be reading the Changelog from our computers and having the link will come in handy.
danypr92
approved these changes
Jan 7, 2020
sauloperez
approved these changes
Jan 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Print log entries as single lines, also in error case. This implies wrapping the execution of commands in case they fail, and printing their output flattened (\n escaped) in that case.
3 examples:
Fail Output Example #
1
Fail Output Example #
2
Success Output
I also create a template config file for promtail that I have checked it works. However, it's not backups-role purpose to install and configure promtail, so we don't do anything with that config file. I leave it there more as reference. We could move it to a wiki page or /docs dir.