question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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

  1. Start Neo4j
  2. Start some connections to the database
  3. Connect to the database using cypher-shell
  4. 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:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
technigecommented, Mar 16, 2020

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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found