Skip to content
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

fix(logging): Use instance/attributes/cluster-location for location on GKE #9094

Merged
merged 6 commits into from Dec 11, 2023

Conversation

gkevinzheng
Copy link
Contributor

@gkevinzheng gkevinzheng commented Dec 7, 2023

Use instance/attributes/cluster-location for location on GKE to set the value of location to the cluster location as opposed to just the zone, to bring it in line with what other logging libraries do: see https://github.com/googleapis/google-cloud-cpp/blob/4ba2cc4d1d0cfdd70dec6d1affb26423d0e9dac1/google/cloud/opentelemetry/internal/resource_detector_impl.cc#L103C51-L103C67 and https://github.com/googleapis/google-cloud-cpp/blob/850564f330ac6e918d6d40ac1ab17a200282a196/google/cloud/opentelemetry/internal/monitored_resource.cc#L88 for C++, and for what is tagged under location in other GKE logging statements.

See also https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity#instance_metadata

Fixes #9083 #9070

@gkevinzheng gkevinzheng requested review from a team as code owners December 7, 2023 19:07
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: logging Issues related to the Cloud Logging API. labels Dec 7, 2023
@gkevinzheng gkevinzheng marked this pull request as draft December 7, 2023 19:17
@gkevinzheng gkevinzheng marked this pull request as ready for review December 7, 2023 19:25
@arekkusu
Copy link

arekkusu commented Dec 8, 2023

Thanks. Once this is merged, I imagine it will be mentioned in the next release change log.

For users writing k8s_container log using this library this fix might have some impact such as existing log filters (for example used within alert policy...) no longer working as before. This is if they actually rely (filter on) the "location" label. Unfortunately there is simply no way around this.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Dec 11, 2023
@gkevinzheng gkevinzheng added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Dec 11, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 11, 2023
@gkevinzheng gkevinzheng merged commit c85b9d4 into googleapis:main Dec 11, 2023
9 checks passed
@gkevinzheng gkevinzheng deleted the k8s-location branch December 11, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. size: m Pull request size is medium.
Projects
None yet
5 participants