neo4j / neo4j-javascript-driver

Neo4j Bolt driver for JavaScript
https://neo4j.com/docs/javascript-manual/current/
Apache License 2.0
860 stars 147 forks source link

Introduce API Metrics/Telemetry #1142

Closed bigmontz closed 1 year ago

bigmontz commented 1 year ago

Neo4j would like to be able to track more information about driver apis usage, so that smarter decisions can be made on improving drivers and their stack.

The collection of metrics must be respectful of users. Thus, the collected metrics are:

  1. impossible to be tied back the customer or user
  2. transparent to the users that inspect
  3. restrained to required metrics

The metric collection is disabled by default in Neo4j. It can be enabled in the server by setting server.bolt.telemetry.enabled to true.

However, the metric collection is enabled by default in the drivers. It can be disabled in the driver by configuring the driver with telemetryDisabled to true. Default: false.

Metrics are only collected when enabled both in server and driver instances.

Disabling metrics on driver:

const driver = neo4j.driver(
    'neo4j://localhost:7687', neo4j.auth.basic('neo4j', 'password'), { telemetryDisabled: true })