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

Let Cloud Run Job use StructuredLogHandler instead of ClougLoggingHandler #890

Open
xSAVIKx opened this issue May 1, 2024 · 0 comments · Fixed by #898
Open

Let Cloud Run Job use StructuredLogHandler instead of ClougLoggingHandler #890

xSAVIKx opened this issue May 1, 2024 · 0 comments · Fixed by #898
Assignees
Labels
api: logging Issues related to the googleapis/python-logging API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@xSAVIKx
Copy link

xSAVIKx commented May 1, 2024

Is your feature request related to a problem? Please describe.
When using Client.get_default_handler CloudLoggingHandler is being used automatically for Cloud Run jobs resource. And while #877 fixes the missing labels we're still gonna be using background transport when simplier stdout is doing just fine.

Describe the solution you'd like
If we modify this check

elif monitored_resource.type == _RUN_RESOURCE_TYPE:
and allow _RUN_RESOURCE_TYPE OR _CLOUD_RUN_JOB_RESOURCE_TYPE resource type then a structured log handler is gonna be used automatically which should be a better default.

Describe alternatives you've considered
Meanwhile I am using handler = StructuredLogHandler(project_id=client.project) instead of handler = client.get_default_handler() where client is client = CloudLoggingClient()

@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label May 1, 2024
@triplequark triplequark added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Aug 5, 2024
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/python-logging API. 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