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), |
|
) |
The instrumentation code for the
perform_requestfunction in the Elasticsearch Transport class throws an exception when keyword arguments are used formethodand/orurl. The reason for this is that python throws aValueErrorexception when trying to unpackargswhen there are none. The proposed fix should be to first check thekwargsformethod/urland then try to unpackargsbut add the catching of the potential exception:ValueError.opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py
Lines 201 to 208 in f4f3042