[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16405009#comment-16405009 ] Dinesh Joshi commented on CASSANDRA-14275: -- Thanks, [~iamaleksey]! > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.0 > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16404686#comment-16404686 ] Aleksey Yeschenko commented on CASSANDRA-14275: --- That's almost it, thanks. You shouldn't have {{Optional}} as a field, though - the proper way is to create them in getters, with {{Optional.ofNullable()}}. And I'd move that conditional logic to {{StartupMessage}} itself, to keep {{ClientState}} dumb. Made these small adjustments myself [here|https://github.com/iamaleksey/cassandra/commit/0df1039f0c5f5260534974891c33711bf956c34a] so that we can save one trivial round-trip. Will commit as soon as CI is green. > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16397876#comment-16397876 ] Dinesh Joshi commented on CASSANDRA-14275: -- Hi [~iamaleksey], I have resolved all issues in your feedback. Regarding #4 - My original thought was that driver info (name, version, etc.) should ideally be set at the same time. I split this into two methods now. Now calling {{setDriverVersion}} without first calling {{setDriverName}} causes a silent failure. I am not sure how you'd like to handle this situation? I can throw a {{ProtocolException}} but I'm not sure. I'll defer the decision to you. Here's how the output looks with clients that supply the information - {noformat} 16:44 $ ./bin/nodetool clientstats --all Address SSL Version User Keyspace Requests Driver-Name Driver-Version /127.0.0.1:51029 false 4 anonymous 12 DataStax Java Driver 3.4.1-SNAPSHOT /127.0.0.1:51030 false 4 anonymous 2DataStax Java Driver 3.4.1-SNAPSHOT Total connected clients: 2 User Connections anonymous 2 {noformat} Some clients may not support sending driver information - {noformat} 16:47 $ ./bin/nodetool clientstats --all Address SSL Version User Keyspace Requests Driver-Name Driver-Version /127.0.0.1:51029 false 4 anonymous 14 DataStax Java Driver 3.4.1-SNAPSHOT /127.0.0.1:51460 false 4 anonymous 13 undefined undefined /127.0.0.1:51030 false 4 anonymous 4DataStax Java Driver 3.4.1-SNAPSHOT /127.0.0.1:51461 false 4 anonymous 2undefined undefined Total connected clients: 4 User Connections anonymous 4 {noformat} > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16390725#comment-16390725 ] Dinesh Joshi commented on CASSANDRA-14275: -- [~iamaleksey] - thanks for the review. I will incorporate your feedback and update it with a squashed commit. > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16386477#comment-16386477 ] Aleksey Yeschenko commented on CASSANDRA-14275: --- Minor stuff: for better parse-ability, should alter the way you output {{clientstats}} output. Rename 'Driver Name' into 'Driver-Name' and 'Driver Version' into 'Driver-Version', and instead of empty strings, use {{"null"}} or {{"undefined"}} for name and version. Reason is that {{TableBuilder}} uses spaces as separator. > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16386419#comment-16386419 ] Aleksey Yeschenko commented on CASSANDRA-14275: --- Hey o. It's an ok start, but we can make it better: 1. {{ClientState()}} constructor doesn't need {{this.driverName = null;}} or {{this.driverVersion = null;}} assignments. You were probably just mimicking the other assignments in it, but you shouldn't have. They are there because {{isInternal}} and {{remoteAddress}} fields are {{final}}. {{driverName}} and {{driverVersion}} aren't, and will be set to null anyway. 2. Likewise, in {{ClientState(InetSocketAddress remoteAddress)}} constructor, {{this.driverName = null;}} assignment is not needed. 3. {{ClientState forExternalCalls(SocketAddress remoteAddress, String driverName, String driverVersion)}} method is not used by anything, and neither do we need {{ClientState(InetSocketAddress remoteAddress, String driverName, String driverVersion)}} constructor. You might be tempted to create them just because we might need them one day, but we try to generally avoid that. So I'd get rid of them both. 4. {{setDriverInfo(String driverName, String driverVersion)}} should probably be split into two methods, one for driver name and another for driver version. See below for reason why. 5. You shouldn't put the {{STARTUP}} handling code into {{Message}} class. What you did belongs to {{StartupMessage.execute()}} method. 6. {{"DRIVER_NAME"}} and {{"DRIVER_VERSION"}} should be constantized once in {{StartupMessage}}, like the rest of the options. 7. It should be possible to only set the driver name, but we shouldn't set driver version if name is not set. 8. I would prefer if you made {{getDriverVersion()}} and {{getDriverName()}} methods in {{ClientState}} return an {{Optional}} on read instead of using empty strings on write. This is all for now, though I might have more in the second round. If you don't mind, can you squash all the existing comments into one, and address review feedback in separate commits on top of the squashed one? Cheers (: > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16381387#comment-16381387 ] Jeff Jirsa commented on CASSANDRA-14275: [~iamaleksey] interested in reviewing? Or [~ifesdjeen] ? > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16381298#comment-16381298 ] Dinesh Joshi commented on CASSANDRA-14275: -- Updated the code based on the feedback from driver folks. {noformat} 16:11 $ bin/nodetool clientstats --all Address SSL Version User Keyspace Requests Driver Name Driver Version /127.0.0.1:61820 false 4 anonymous 12 DataStaxJavaDriver 3.4.1-SNAPSHOT /127.0.0.1:61827 false 4 anonymous 2DataStaxJavaDriver 3.4.1-SNAPSHOT Total connected clients: 2 User Connections anonymous 2{noformat} > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Commented] (CASSANDRA-14275) Cassandra Driver should send identification information to Server
[ https://issues.apache.org/jira/browse/CASSANDRA-14275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16379474#comment-16379474 ] Dinesh Joshi commented on CASSANDRA-14275: -- Heres a PoC - # https://github.com/apache/cassandra/compare/trunk...dineshjoshi:add-client-string # https://github.com/datastax/java-driver/compare/3.x...dineshjoshi:enhance-java-driver-to-send-metadata This allows me to get stats like this - {noformat} bin/nodetool clientstats --all Address SSL Version User Keyspace Requests Driver /127.0.0.1:59305 false 4 anonymous 12 datastaxjavadriver-cql3.0.0-v3.0 /127.0.0.1:59306 false 4 anonymous 2 datastaxjavadriver-cql3.0.0-v3.0 Total connected clients: 2 User Connections anonymous 2 {noformat} > Cassandra Driver should send identification information to Server > - > > Key: CASSANDRA-14275 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14275 > Project: Cassandra > Issue Type: New Feature > Components: Core >Reporter: Dinesh Joshi >Assignee: Dinesh Joshi >Priority: Major > Fix For: 2.1.x, 2.2.x, 3.0.x, 3.11.x, 4.x > > > Currently there doesn't seem to be any way to readily identify the driver > that clients are using to connect to Cassandra. Add the capability of > identifying the driver through metadata information much like how HTTP > Clients identify themselves through User-Agent HTTP header. This is useful > for debugging in large deployments where clients tend to use different > drivers, wrappers and language bindings to connect to Cassandra. This can > help surface issues as well as help detect clients which are using older or > unsupported drivers. > The identification information should be a string that unambiguously > identifies the driver. It should include information such as the name of the > driver, it's version, CQL version, Platform (Linux, macOS, Windows, etc.) and > architecture (x86, x86_64). > We should surface this information in `nodetool clientstats` command. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org