stillalex commented on code in PR #1854:
URL: https://github.com/apache/solr/pull/1854#discussion_r1301569725


##########
solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java:
##########
@@ -147,6 +152,13 @@ public HttpResponse execute(HttpRequest request, 
HttpClientConnection conn, Http
     }
   }
 
+  private static final TextMapSetter<HttpRequest> TRACE_INJECTOR = (r, k, v) 
-> r.setHeader(k, v);
+
+  private static void injectContextIntoRequest(HttpRequest request) {
+    TextMapPropagator textMapPropagator = TraceUtils.getTextMapPropagator();
+    textMapPropagator.inject(Context.current(), request, TRACE_INJECTOR);
+  }
+

Review Comment:
   > Is declaring TRACE_INJECTOR useful for a performance perspective? It kinda 
makes me sad to not see a trivial lambda used as such.
   
   yeah it's coming from their javadocs (both TextMapSetter and TextMapGetter)
   ```
    * <p>{@code Setter} is stateless and allows to be saved as a constant to 
avoid runtime allocations.
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to