Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Add region in the Debuggee labels for GCF envionrment #950

Closed
Louis-Ye opened this issue Apr 29, 2021 · 0 comments · Fixed by #951
Closed

Add region in the Debuggee labels for GCF envionrment #950

Louis-Ye opened this issue Apr 29, 2021 · 0 comments · Fixed by #951
Labels
api: clouddebugger Issues related to the googleapis/cloud-debug-nodejs API. triage me I really want to be triaged.

Comments

@Louis-Ye
Copy link
Contributor

Louis-Ye commented Apr 29, 2021

Background

Cloud Functions (GCF) deployments exist within the context of a cloud region. And a GCF instance can only be uniquely identified by function name + version + region. Currently the Debuggee labels contain the function name and version, but lack region, so it is not possible to identify a 1-to-1 mapping between a Debuggee and a GCF instance.

This feature request is to add the region into the Debuggee labels. It is part of the effort for better integration between Cloud Debugger and Cloud Functions.

Implementation note

Currently the function name + version are read from the environment variables, but the region is not available in newer GCF runtime. So the region needs to be pulled from GCP metadata service.

@product-auto-label product-auto-label bot added the api: clouddebugger Issues related to the googleapis/cloud-debug-nodejs API. label Apr 29, 2021
@Louis-Ye Louis-Ye changed the title Add region in the Debuggee label for GCF envionrment Add region in the Debuggee labels for GCF envionrment Apr 29, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 30, 2021
Louis-Ye added a commit to Louis-Ye/cloud-debug-nodejs that referenced this issue Apr 30, 2021
* Read GCF region from either the environment or GCP metadata service
* Add the region into Debuggee labels
* Add the corresponding tests

Fixes googleapis#950
Louis-Ye added a commit to Louis-Ye/cloud-debug-nodejs that referenced this issue Apr 30, 2021
* Read GCF region from either the environment or GCP metadata service
* Add the region into Debuggee labels
* Add the corresponding tests

Fixes googleapis#950
mctavish pushed a commit that referenced this issue May 4, 2021
* feat: Add region in Debuggee labels in GCF env

* Read GCF region from either the environment or GCP metadata service
* Add the region into Debuggee labels
* Add the corresponding tests

Fixes #950

* fix: add tests for more coverage

* fix: change getRegion method to return undefined upon not available
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: clouddebugger Issues related to the googleapis/cloud-debug-nodejs API. triage me I really want to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants