[Feature Request] Provide a way to specify the useragent or at least a prefix
See original GitHub issue- Neo4j version: 3.5/4.0
- Driver version: master (and older)
newInstance calls createConnectionPool which calls ConnectionSettings(...)
with no way to influence it.
There is a ConnectionSettings( AuthToken authToken, String userAgent, int connectTimeoutMillis ), but it isn’t called. And the useragent is final
- Expected behavior
- Actual behavior
Steps to reproduce
- Start Neo4j
- Start some connections to the database
- Connect to the database using cypher-shell
- run:
CALL dbms.listConnections() YIELD connectionId, connectTime, connector, username, userAgent, clientAddress;
Actual behavior
Note that all the useragents are neo4j-java/1.7.5...
or neo4j-java/dev
.
Expected behavior
Ideally, the useragent might be neo4j-java/dev cypher-shell/{version}
or similar for the cyphershell connection, and the other ones should be able to identify themselves beyond “hi, I’m a driver”.
Once an API is available in the driver, the clients (e.g. cypher-shell) can be updated to use it…
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
User-Agent - HTTP - MDN Web Docs - Mozilla
The User-Agent request header is a characteristic string that lets servers and network peers identify the application, operating system, ...
Read more >User-Agent Client Hints are a new ... - Chrome Developers
User-Agent Client Hints expand the range of properties with the Sec-CH-UA prefix that can be specified via the Accept-CH server response header.
Read more >HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used...
Read more >AWS global condition context keys
Global condition keys are condition keys with an aws: prefix. ... credentials of an IAM principal to make at least one other request...
Read more >How Google Interprets the robots.txt Specification
You can group together rules that apply to multiple user agents by repeating user-agent lines for each crawler. For example: user-agent: a disallow:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jsoref https://neo4j.com/docs/api/java-driver/4.1/org/neo4j/driver/Config.ConfigBuilder.html#withUserAgent-java.lang.String-
Hi @jsoref
The user-agent metadata is currently intended only for internal and informal use by the driver. As @zhenlineo mentions, this is not something we have ever surfaced for use by higher-level software or applications. It’s primary intended purpose is diagnostics.
I agree that the documentation in 12.5.1 is ambiguous, and this should make it clear that it is the driver version being reported, instead of simply saying “the software.” We will look to get that corrected.
In terms of introducing a way for higher-level software to be able to modify or extend the user agent, I have added the item to our roadmap for future discussion, so this may appear in a future release, depending on the outcome of that discussion.