Constructor
new InstrumentationDescriptor(params)
Name | Type | Description |
---|---|---|
params | InstrumentationDescriptorParams |
Members
TYPE_DATASTORE :string
Database module, such as the MongoDB or MySQL drivers.
- string
TYPE_GENERIC :string
Utility/generic module.
- string
TYPE_MESSAGE :string
Messaging module, such as AMQP.
- string
TYPE_PROMISE :string
Promise module, such as Bluebird.
- string
TYPE_TRACKING :string
Used to load supportability metrics on installed versions of packages that the Node.js agent does not instrument (e.g. OTEL instrumentation or top logging libraries).
- string
TYPE_WEB_FRAMEWORK :string
Web server framework module, such as Express or Fastify.
- string
absolutePath
The absolute path to the module to instrument. This should only be set when the module being instrumented does not reside in a node_modules
directory; for example, when someone is instrumenting a module of their own through the public API.
The moduleName
property still needs to be set to the simple name, i.e. the string passed to require
, for instrumentation tracking purposes.
Note: this value takes precedence over moduleName
.
instrumentationId
Identifier for the instrumentation. Used by the internal instrumentation tracker to distinguish between different instrumentations targeting the same module.
module :string
The name of the module being instrumented, i.e. the string used to require the module. This must map to a directory in lib/instrumentations
which contains an nr-hooks.js
file.
This takes precedence over moduleName
.
- string
moduleName :string
The name of the module being instrumented, i.e. the string used to require the module. This must map to a JavaScript file of the same name in the lib/instrumentations
directory.
- string
onError :InstrumentationOnError
Hook to invoke when the onRequire
hook throws an error.
onRequire :InstrumentationOnRequire
Hook to invoke when the module is required. This is the actual implementation of the instrumentation.
resolvedName :string
The fully resolved path to the module, e.g. /opt/app/node_modules/foo
. If the module is a core module, the special value .
should be used.
- string
shimName :string
Used when instrumenting a module to determine if a module has already been wrapped by a specific shim instance. It is used in conjunction with the shim.id
value.
- string
type :string|null
The type of the module being instrumented. See the static TYPE_
fields.
- string |
null