dsmiley commented on a change in pull request #115:
URL: https://github.com/apache/solr/pull/115#discussion_r633891625



##########
File path: solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
##########
@@ -603,6 +608,44 @@ public Action call() throws IOException {
 
   }
 
+  /** Get the span for this request.  Not null. */
+  protected Span getSpan() {
+    // Span was put into the request by SolrDispatchFilter
+    return (Span) 
Objects.requireNonNull(req.getAttribute(Span.class.getName()));
+  }
+
+  // called after init().
+  protected void populateTracingSpan(Span span) {
+    // Set db.instance
+    String coreOrColName = HttpSolrCall.this.origCorename;
+    if (coreOrColName == null && getCore() != null) {
+      coreOrColName = getCore().getName();
+    }
+    if (coreOrColName != null) {
+      span.setTag(Tags.DB_INSTANCE, coreOrColName);
+    }
+
+    // Set operation name.
+    String path = getPath();
+    if (coreOrColName != null) {
+      // prefix path by core or collection name
+      if (getCore() != null && getCore().getName().equals(coreOrColName)) {
+        path = "/{core}" + path;
+      } else {
+        path = "/{collection}" + path;
+      }
+    }
+    String verb =
+        getQueryParams()
+            .get(CoreAdminParams.ACTION, req.getMethod())
+            .toLowerCase(Locale.ROOT);
+    span.setOperationName(verb + ":" + path);

Review comment:
       Impossible.  See the "get" that takes 2 args.  The 2nd param there is 
the default, which is the "method" (HTTP) of the request, which can't be null.




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

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