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: automatic project detection in logging.NewClient() #7321

Closed
tang-fh opened this issue Jan 27, 2023 · 0 comments · Fixed by #9006
Closed

logging: automatic project detection in logging.NewClient() #7321

tang-fh opened this issue Jan 27, 2023 · 0 comments · Fixed by #9006
Assignees
Labels
api: logging Issues related to the Cloud Logging API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tang-fh
Copy link
Contributor

tang-fh commented Jan 27, 2023

Is your feature request related to a problem? Please describe.
When calling logging.NewClient(), the caller has to specify the parent which is assumed to be a project ID if its type is not explicit.

When running in GCE, GCR, GCF or GAE Standard, the obvious default choice for parent would be the same project in which the code runs. At the same time, in those environments, the project ID can be inferred from the environment (see logging/resource.go).

Describe the solution you'd like
Allow

client, err: = logging.NewClient(ctx, "")

which will set the parent to the project ID in which the code is running.

Describe alternatives you've considered
Callers of the logging library implement their own automatic project ID detection.

Additional context
N/A

@tang-fh tang-fh added the triage me I really want to be triaged. label Jan 27, 2023
@product-auto-label product-auto-label bot added the api: logging Issues related to the Cloud Logging API. label Jan 27, 2023
@losalex losalex added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jan 27, 2023
@gkevinzheng gkevinzheng self-assigned this Nov 2, 2023
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. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants