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

Incorrect value for location in GKE for regional GKE clusters. #827

Closed
gkevinzheng opened this issue Dec 11, 2023 · 0 comments · Fixed by #830
Closed

Incorrect value for location in GKE for regional GKE clusters. #827

gkevinzheng opened this issue Dec 11, 2023 · 0 comments · Fixed by #830
Assignees
Labels
api: logging Issues related to the googleapis/python-logging API. priority: p3 Desirable enhancement or fix. May not be included in next release.

Comments

@gkevinzheng
Copy link
Contributor

See googleapis/google-cloud-go#9083

In google/cloud/logging_v2/handlers/_monitored_resources.py, we use the value of zone for the value of the location label in GKE:

zone = retrieve_metadata_server(_ZONE_ID)
cluster_name = retrieve_metadata_server(_GKE_CLUSTER_NAME)
project = retrieve_metadata_server(_PROJECT_NAME)
resource = Resource(
type="k8s_container",
labels={
"project_id": project if project else "",
"location": zone if zone else "",
"cluster_name": cluster_name if cluster_name else "",
},
)
return resource

This is incorrect for regional GKE clusters, because the value of location should be the region where it is deployed, and is inconsistent with the value of location for other logging statements.

@gkevinzheng gkevinzheng self-assigned this Dec 11, 2023
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label Dec 11, 2023
@gkevinzheng gkevinzheng added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Jan 9, 2024
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 googleapis/python-logging API. priority: p3 Desirable enhancement or fix. May not be included in next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant