Logging with google-cloud-logging-logback on K8S: resources.labels are empty
See original GitHub issueI’m trying the used structured logging with google-cloud-logging-logback
on Kubernetes.
Most of the resource labels are empty, except project_id
and zone
:
resource: {
labels: {
cluster_name: ""
container_name: ""
instance_id: ""
namespace_id: ""
pod_id: ""
project_id: "<project ID>"
zone: "<zone>"
}
type: "container"
}
I guess the reason for this is that only project_id
and zone
are configured for resource of type container
:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Setting Up Cloud Logging for Java | Google Cloud
The Logback appender and the java.util.logging handler provide automatic resource type detection of your App Engine, Compute Engine, and Google Kubernetes ...
Read more >Logging Architecture | Kubernetes
Application logs can help you understand what is happening inside your application. The logs are particularly useful for debugging problems ...
Read more >Kubectl Logs | Kubectl Cheat Sheet | Sumo Logic
Logs in Kubernetes can give you insight into resources such as nodes, ... When you use “kubectl run”, it will automatically apply a...
Read more >The Guide to Kubernetes Labels - - Kubecost blog
Labeling Best Practices; What You Should NOT Do With Kubernetes Labels. Tagging MethodsPermalink. To help organize cluster resources, Kubernetes ...
Read more >Viewing logs for a specific resource - OpenShift Documentation
Resource logs do not access the OpenShift Logging log store. Viewing resource logs. You can view the log for various resources in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jabubake @saturnism I just tried using stdout with json, and it looks to work well. Thx for the info!
In case anyone is interested in the solution I took: I added this library: https://github.com/logstash/logstash-logback-encoder
I configured logback that way:
This may evolve in the future, but fulfills the first use-cases. The field
severity
is correctly parsed by the stackdriver agent.+1 I’m running into the same and opened a separate issue #3109 because the docs are incomplete. Having the log level in Stackdriver is essential if you want to make log-based metrics based on the ‘severity’ field.