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

logging.detectedResource does not return "cloud_run_revision" on Cloud Run #1127

Closed
averikitsch opened this issue Jul 29, 2021 · 3 comments · Fixed by #1145
Closed

logging.detectedResource does not return "cloud_run_revision" on Cloud Run #1127

averikitsch opened this issue Jul 29, 2021 · 3 comments · Fixed by #1145
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging API. lang: nodejs Issues specific to JavaScript or TypeScript. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@averikitsch
Copy link

averikitsch commented Jul 29, 2021

Environment details

  • OS: Container (base node:12-slim)
  • Node.js version: 12
  • npm version: 7.18.1
  • @google-cloud/logging version: 9.5.4

Steps to reproduce

  1. Create service w/ code snippet (see full service here):
  const {Logging} = require('@google-cloud/logging');
  const logging = new Logging();
  await logging.setProjectId();
  await logging.setDetectedResource();
  console.log(logging.projectId);
  console.log(logging.detectedResource); // { type: 'global' }
  1. Deploy to Cloud Run:
gcloud beta run deploy logging-test --source .
  1. Inspect logs:
console.log(logging.detectedResource); 
// outputs { type: 'global' }
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging API. label Jul 29, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jul 30, 2021
@minherz minherz added lang: nodejs Issues specific to JavaScript or TypeScript. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Aug 1, 2021
@ramicohen303
Copy link

I encountered the same issue. Any ETA on a fix for this?

@minherz
Copy link
Contributor

minherz commented Aug 29, 2021

I will have a look into it during this week (week 35).

@daniel-sanche
Copy link
Contributor

I will also look into the environment tests soon, since they are passing and they should be catching this

@averikitsch averikitsch changed the title Cloud Run resource type not detected logging.detectedResource does not return "cloud_run_revision" on Cloud Run Sep 1, 2021
minherz added a commit that referenced this issue Sep 1, 2021
Uses dedicated GCPEnv enumerator (CLOUD_RUN).
Removes code that used COMPUTE_ENGINE enum with extra tests.
Updates relevant unit tests.

Fixes #1127
minherz added a commit that referenced this issue Sep 2, 2021
Uses dedicated GCPEnv enumerator (CLOUD_RUN).
Removes code that used COMPUTE_ENGINE enum with extra tests.
Updates relevant unit tests.

Fixes #1127
daniel-sanche pushed a commit that referenced this issue Sep 2, 2021
Uses dedicated GCPEnv enumerator (CLOUD_RUN).
Removes code that used COMPUTE_ENGINE enum with extra tests.
Updates relevant unit tests.

Fixes #1127
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/nodejs-logging API. lang: nodejs Issues specific to JavaScript or TypeScript. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants