rino-kadijk commented on code in PR #9471:
URL: https://github.com/apache/pinot/pull/9471#discussion_r997218327


##########
pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/controller/PinotControllerTransport.java:
##########
@@ -64,21 +66,26 @@ public PinotControllerTransport(Map<String, String> 
headers, String scheme,
     builder.setReadTimeout(connectionTimeouts.getReadTimeoutMs())
             .setConnectTimeout(connectionTimeouts.getConnectTimeoutMs())
             .setHandshakeTimeout(connectionTimeouts.getHandshakeTimeoutMs())
-            .setUserAgent(getUserAgentVersionFromClassPath())
+            .setUserAgent(getUserAgentVersionFromClassPath(appId))
             
.setEnabledProtocols(tlsProtocols.getEnabledProtocols().toArray(new String[0]));
 
     _httpClient = Dsl.asyncHttpClient(builder.build());
   }
 
-  private String getUserAgentVersionFromClassPath() {
+  private String getUserAgentVersionFromClassPath(@Nullable String appId) {
     Properties userAgentProperties = new Properties();
     try {
       userAgentProperties.load(PinotControllerTransport.class.getClassLoader()
               .getResourceAsStream("version.properties"));
     } catch (IOException e) {
       LOGGER.warn("Unable to set user agent version");
     }
-    return userAgentProperties.getProperty("ua", "unknown");
+    String userAgentFromProperties = userAgentProperties.getProperty("ua", 
"unknown");
+    if (StringUtils.isNotEmpty(appId)) {
+      return appId.substring(0, 
Math.min(org.apache.pinot.client.utils.ConnectionUtils.APP_ID_MAX_CHARS,

Review Comment:
   [WARNING] 
src/main/java/org/apache/pinot/client/controller/PinotControllerTransport.java:[45,60]
 (imports) AvoidStaticImport: Using a static member import should be avoided - 
org.apache.pinot.client.utils.ConnectionUtils.APP_ID_MAX_CHARS.
   



-- 
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: commits-unsubscr...@pinot.apache.org

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


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

Reply via email to