[ 
https://issues.apache.org/jira/browse/TINKERPOP-2480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17637446#comment-17637446
 ] 

ASF GitHub Bot commented on TINKERPOP-2480:
-------------------------------------------

cole-bq commented on code in PR #1838:
URL: https://github.com/apache/tinkerpop/pull/1838#discussion_r1029789851


##########
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/UserAgent.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.driver.util;
+
+import org.apache.tinkerpop.gremlin.util.Gremlin;
+import javax.naming.NamingException;
+
+public class UserAgent {

Review Comment:
   Thanks for all of your feedback Divij, could I ask for some more elaboration 
of your expectations regarding decoupling the driver and server code for the 
user agent? Keeping things decoupled was something I kept in mind while 
implementing my changes and I'm not sure what further changes you are looking 
for in that regard. As it stands all the code which generates and sends the 
user agent exists in gremlin-driver (which will be re-implemented in each GLV 
in a future PR). All the code which extracts the user agent, logs it for 
debugging, and adds it to the server metrics is wrapped into 
`WsUserAgentHandler` in gremlin-server. The only use of driver code from the 
server currently (excluding tests) is that the server uses the driver's 
constant for the "User-Agent" header name. This constant could easily be 
duplicated in the server to avoid referencing driver code from the server.





> User agent for Gremlin drivers
> ------------------------------
>
>                 Key: TINKERPOP-2480
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2480
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: driver, server
>    Affects Versions: 3.4.8
>            Reporter: Divij Vaidya
>            Priority: Minor
>
> Currently, a server does not distinguish amongst the different types of 
> clients connecting to it. This issue is to add a new feature to add user 
> agent field in the HTTP and WebSocket request header which could be used to 
> identify the specific client from which the request was made.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to