googleapis / googleapis/google-cloud-go
logging: document requirement for CONTAINER_NAME envVar
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 1.6k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 109
Description
**Is your feature request related to a problem? Please describe.**
With the new [resource detection](https://cloud.google.com/blog/products/devops-sre/more-support-for-structured-logs-in-new-version-of-go-logging-library) in 1.5.0 it is not apparent that there is still a need to [manually](https://github.com/googleapis/google-cloud-go/blob/main/logging/resource.go#L182) set the `CONTAINER_NAME` envVar to have the `container_name` field be set correctly in the logging UI.
**Describe the solution you'd like**
Document requirements for which fields are automatically detected vs which fields need to be set manually and how to set them for common use cases such as appengine, k8s, GCP, etc.
**Describe alternatives you've considered**
I previously manually set a `monitoredres.MonitoredResource` for `k8s_container` and filled out the fields myself, but switching to the autodetection feels cleaner.
**Additional context**
This is a super minor issue, just something I ran into when implementing 1.5.0 and using the new, improved resource auto-detection.
Contributor guide
Assessment
This issue has not been assessed yet.