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

feat: add debug log when creating client #2265

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

ohmayr
Copy link
Contributor

@ohmayr ohmayr commented Nov 27, 2024

No description provided.

@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Nov 27, 2024
@@ -243,6 +251,9 @@ class {{ service.async_client_name }}:

)

if CLIENT_LOGGING_SUPPORTED:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should have an extra line at each logging site to check the logging enablement. Rather, I suggest something like what I propose in prototype R-0 in in go/cloudsdk-python-logging-performant, to abstract away any checking we may want to do while providing an interface (only used by us, not our users) that is parallel to the standard loggers.

@parthea parthea self-assigned this Nov 28, 2024
@@ -243,6 +251,9 @@ class {{ service.async_client_name }}:

)

if CLIENT_LOGGING_SUPPORTED:
_LOGGER.debug(" {{ service.async_client_name }} client is successfully constructed.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ruby logs include information about which credentials will be used with the client which should be included here as well.

I, [2024-09-30T16:52:15.809067 #1917313]  INFO -- google-cloud-secret_manager-v1: Created client for google.cloud.secretmanager.v1.SecretManagerService -- {"clientId":3220,"system":"google-cloud-secret_manager-v1","serviceName":"google.cloud.secretmanager.v1.SecretManagerService","credentialsId":3260,"credentialsType":"Google::Auth::ServiceAccountCredentials","credentialsScope":["https://www.googleapis.com/auth/cloud-platform"],"useSelfSignedJWT":false,"universeDomain":"googleapis.com"}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the ruby debug log in #2265 (comment), we're missing the serviceName

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added logging for serviceName via a715854 but it only appears when using structured logging

{"timestamp": "2024-11-28 19:30:07,202", "severity": "DEBUG", "name": "google.showcase_v1beta1.services.echo.client", "message": "Created client `google.showcase_v1beta1.EchoClient`.", "serviceName": "google.showcase.v1beta1.Echo"}
DEBUG:google.showcase_v1beta1.services.echo.client:Created client `google.showcase_v1beta1.EchoClient`.

@parthea parthea changed the title feat: add support for debug logging feat: add debug log when creating client Nov 28, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants