opentelemetry-instrumentation-neo4j
TypeScript icon, indicating that this package has built-in type declarations

0.41.0 • Public • Published

OpenTelemetry Neo4j Instrumentation for Node.js

NPM version

This module provides automatic instrumentation for neo4j-javascript-driver.

Supports versions >=4.0.0 <5.0.0 of neo4j-driver

Installation

npm install --save opentelemetry-instrumentation-neo4j

Usage

For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { Neo4jInstrumentation } = require('opentelemetry-instrumentation-neo4j');

registerInstrumentations({
  tracerProvider,
  instrumentations: [
    new Neo4jInstrumentation({
      // see under for available configuration
    })
  ]
});

Neo4j Instrumentation Options

Neo4j instrumentation has few options available to choose from. You can set the following:

Options Type Description
responseHook Neo4jResponseCustomAttributesFunction Hook called before response is returned, which allows to add custom attributes to span.
ignoreOrphanedSpans boolean Set to true if you only want to trace operation which has parent spans
moduleVersionAttributeName string If passed, a span attribute will be added to all spans with key of the provided moduleVersionAttributeName and value of the patched module version

This extension (and many others) was developed by Aspecto with ❤️

Package Sidebar

Install

npm i opentelemetry-instrumentation-neo4j

Weekly Downloads

2,286

Version

0.41.0

License

Apache-2.0

Unpacked Size

97.6 kB

Total Files

27

Last publish

Collaborators

  • nirsky
  • aspecto-release-bot