-
Notifications
You must be signed in to change notification settings - Fork 580
feat(gcp-detector): add Cloud Run support with faas.* and cloud.platform #2818
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
base: main
Are you sure you want to change the base?
Conversation
* feat(gcp-detector): add Cloud Run support with faas.name, faas.version, and faas.instance Signed-off-by: Kasper Borg Nissen <[email protected]> * chore(lint): remove newlines Signed-off-by: Kasper Borg Nissen <[email protected]> * chore(comment): write comment on moving the assertions * test(gcp-detector): fix Cloud Run tests --------- Signed-off-by: Kasper Borg Nissen <[email protected]>
#2) Signed-off-by: Kasper Borg Nissen <[email protected]>
I am looking forward to seeing this merged :-) |
I am no longer working in this area, @aabmass could you please take a look, and also update component owners? |
@aabmass could you have a look at this one? I could volunteer to review it but I think you feedback would be better |
Hey, apologies for the confusion. We have already implemented this in I would actually like to make the resource detector here in contrib just re-expose the one from I previously discussed this with the maintainers and it wasn't contentious but haven't found the time to do it. To recap, the reason to use it as a library vs copying the code is that we have a bunch of integration tests that would be really difficult to move to this repo. |
Which problem is this PR solving?
The resource detector for gcp did not previously support Cloud Run–specific resource attributes, although these are supported in other SDKs (e.g. Go, Java). This PR adds support for setting the
faas.*
along withcloud.platform
resource attributes when running in a Cloud Run environment.Short description of the changes
faas.name
fromK_SERVICE
environment variable.faas.version
fromK_REVISION
environment variablefaas.instance
from GCP metadata server (/instance/id
) reusing the existing method.cloud.platform
using the semantic conventions static variables.For more information, see the container runtime contract: https://cloud.google.com/run/docs/container-contract#env-vars.
This is my first PR 🙏
I've added another PR for the extension of the
assertCloudResource
helper withcloud.platform
. For now just manually asserting in the test case.