Skip to content

Uncaught exception in Elasticsearch Instrumentation #2542

Description

@mau-alex-ruiz

The instrumentation code for the perform_request function in the Elasticsearch Transport class throws an exception when keyword arguments are used for method and/or url. The reason for this is that python throws a ValueError exception when trying to unpack args when there are none. The proposed fix should be to first check the kwargs for method/url and then try to unpack args but add the catching of the potential exception: ValueError.

try:
method, url, *_ = args
except IndexError:
logger.warning(
"expected perform_request to receive two positional arguments. "
"Got %d",
len(args),
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions