diff --git a/instrumentation/elasticsearch/elasticsearch-rest-7.0/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/v7_0/RestClientWrapper.java b/instrumentation/elasticsearch/elasticsearch-rest-7.0/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/v7_0/RestClientWrapper.java index e605bde1959c..9c5d39be5ea5 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-7.0/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/v7_0/RestClientWrapper.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-7.0/library/src/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/v7_0/RestClientWrapper.java @@ -74,6 +74,7 @@ private static Class createProxyClass() { response = (Response) method.invoke(target, args); } catch (Throwable exception) { throwable = exception; + throw throwable; } finally { instrumenter.end(context, otelRequest, response, throwable); } @@ -102,6 +103,7 @@ private static Class createProxyClass() { return method.invoke(target, args); } catch (Throwable exception) { throwable = exception; + throw throwable; } finally { if (throwable != null) { instrumenter.end(context, otelRequest, null, throwable);