Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unable to bypass detect_resource/retrieve_metadata_server in 3.0.0 #475

Copy link
Copy link
Closed
@t0m

Description

@t0m
Issue body actions

Hi, I'm having an issue with the additional detect_resource call that was added in 3.0.0. When I'm running on my dev machine, any traffic out to metadata.google.internal is black-holed, and hangs until urllib times out (1-2 mins). In 2.x, I was able to get around this behavior by either supplying the resource to setup_logging as a kwarg (which eliminated the need to call detect_resource), or by instantiating the CloudLoggingHandler manually.

In 3.0.0 it seems it is no longer possible to bypass the call to detect_resource, because the transport class is instantiating a logger without passing down anything except for name:

Which will always result in a call to detect_resource:

if not resource:
# infer the correct monitored resource from the local environment
resource = detect_resource(client.project)

This is probably an edge case, but I figured I'd mention it because regardless of the hanging request, it is kind of weird that it calls detect_resource when I've already passed in a resource.

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/python-logging API.Issues related to the googleapis/python-logging API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.