-
Notifications
You must be signed in to change notification settings - Fork 845
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
Include cluster name in log line. #4387
Conversation
It'd also be helpful in other contexts, especially if the the cluster name is exposed to resources in the standard metadata fashion as say That would allow me to write reusable pipelines that interacted with resources in a standard way (assuming the resource allows metadata variable access. I could have a |
The test |
The change itself is innocuous but I want to ask if there's another way to do it since I've been thinking a lot about our logging UX recently. Our logs right now are verbose, hard to read, and hard for contributors to understand and add their own (there are unusual patterns like I'm thinking our logging should instead focus on being human-friendly, while providing clarity to an operator and tinkerer as to how Concourse works, with a stronger focus on the 'happy path' so that tinkerers can verify their expectations against the logs. To that end, I've been thinking about switching from So, the reason I'm asking here is because this is adding a bit more information to all of the logs, and I'm actually leaning towards trimming the information down to the bare necessities. Is there some way to accomplish this without annotating every log line? For example, could this be done at the Thanks! |
@vito We running ATCs on K8S and exporting logs to LogInsight, where LogInsight is a VMware production, not sure if you are familiar with that. To us, JSON formatted logs are quite suitable for LogInsight, easy to query, group, statistic log events. Though LogInsight accepts arbitrary format logs as well, JSON format is much preferred. So even if Concourse is moving to other logging package, we'd like to preserve the ability to output JSON formatted logs. Current each log line has a With If you don't want to burden users who don't care about cluster name in log lines, maybe we add a command line option to switch the feature? |
@evanchaoli Got it, that makes sense. Making it configurable feels like a good middle ground. We can leave it off by default but enable users to flip it on if they have their logs going to a common sink and can't automatically 'bucket' them based on the source.
When we switch to logger = logger.WithData(lager.Data{
"cluster": clusterName,
}) This will add a "cluster-name" field to all logs emitted with the logger. Thanks! |
…name in log line. Say cluster name is "dev", them sample log lines are as below: (notice "cluster" field in logs) web_1 | {"timestamp":"2019-09-11T00:53:59.706488300Z","level":"info","source":"atc","message":"atc.cmd.finish","data":{"cluster":"dev","duration":378200,"session":"1"}} web_1 | {"timestamp":"2019-09-11T00:53:59.707583200Z","level":"info","source":"tsa","message":"tsa.listening","data":{"cluster":"dev"}} Signed-off-by: Chao Li <chaol@vmware.com>
@vito I have added a new cli option
|
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.
👍 thanks!
When multiple Concourse clusters send logs to a single log server, this will be super helpful to decide where a log line comes from.
Say cluster name is "dev", them sample log lines are as below: (notice "source" field in logs)
Signed-off-by: Chao Li chaol@vmware.com