Skip to content

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

Merged
gkevinzheng merged 6 commits intogoogleapis:mainfrom
gkevinzheng:k8s-location
Dec 11, 2023
Merged

fix(logging): Use instance/attributes/cluster-location for location on GKE#9094
gkevinzheng merged 6 commits intogoogleapis:mainfrom
gkevinzheng:k8s-location

Conversation

@gkevinzheng
Copy link
Copy Markdown
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 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
@gkevinzheng gkevinzheng requested a review from minherz December 7, 2023 20:40
@arekkusu
Copy link
Copy Markdown

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
@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