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


##########
solr/core/src/test/org/apache/solr/util/tracing/TestSimplePropagatorDistributedTracing.java:
##########
@@ -114,6 +115,26 @@ public void test() throws IOException, SolrServerException 
{
     }
   }
 
+  @Test
+  public void testApacheClient() throws Exception {
+    // call api that uses apache client impl

Review Comment:
   where is the Apache Client used?  Keep in mind that over time we'll get rid 
of that client so it'll be mysterious looking at this test later.



##########
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.



##########
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:
   Worthy of it's own JIRA issue IMO.
   Also, I suggest putting the word "trace" into this method name instead of 
"Context" which is overly general.



-- 
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