Methods
createShimFromType(params) → {Shim}
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params | object | input params Properties
|
- Source
shim instance
- Type:
- Shim
Type Definitions
CallbackBindFunction(shim, func, name, segment, args)
Performs segment binding on a callback function. Useful when identifying a callback is more complex than a simple argument offset.
Name | Type | Description |
---|---|---|
shim | Shim | The shim this function was passed to. |
func | function | The function being recorded. |
name | string | The name of the function. |
segment | TraceSegment | The segment that the callback should be bound to. |
args | Array.<*> | The arguments being passed into the function. |
- Source
ClassWrapSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
es6 | boolean | <optional> | |
pre | function | <optional> | |
post | function | <optional> |
- Mixes In
- Source
ConstructorHookFunction(shim, Base, name, args)
Pre/post constructor execution hook for wrapping classes.
Name | Type | Description |
---|---|---|
shim | Shim | The shim performing the wrapping/binding. |
Base | function | The class that was wrapped. |
name | string | The name of the |
args | Array.<*> | The arguments to the class constructor. |
- Source
- See
- ClassWrapSpec.pre
DatastoreParametersParams
- object
Name | Type | Description |
---|---|---|
host | string | The host of the database server being interacted with. If provided, along with |
port_path_or_id | number | | The port number or path to domain socket used to connect to the database server. |
database_name | string | The name of the database being queried or operated on. |
collection | string | The name of the collection or table being queried or operated on. |
InContextCallback(segment)
A function that will be invoked in the context of the current segment. Instrumentations that need to perform operations during the invocation of a method that has been instrumented can provide an InContextCallback
function to accomplish their needs. The callback is invoked in the same async context as the instrumented function, i.e. concurrent to the execution of the instrumented function, and within the same segment.
Name | Type | Description |
---|---|---|
segment | TraceSegment | The current segment. |
- Source
InstrumentationDescriptorParams
- object
Name | Type | Description |
---|---|---|
absolutePath | string | |
module | string | |
moduleName | string | |
shimName | string | |
onError | InstrumentationOnError | |
onRequire | InstrumentationOnRequire | |
resolvedName | string | |
type | string |
InstrumentationOnError(error)
Name | Type | Description |
---|---|---|
error | Error | | The error thrown by |
InstrumentationOnRequire(shim, resolvedNodule, moduleName)
Name | Type | Description |
---|---|---|
shim | Shim | The shim instance to use for the instrumentation. |
resolvedNodule | object | The module being instrumented as returned by Node's |
moduleName | string | The simple name of the module, i.e. the value passed to the |
MessageBrokerHeadersFn(inject) → {Array.<object>}
Name | Type | Description |
---|---|---|
inject | function | A function with the signature |
- Source
An array of objects, wherein each object will be updated with distributed trace headers.
- Type:
- Array.<object>
MessageConsumerWrapperFunction(shim, consumer, name, queue) → {function}
Function that is used to wrap message consumer functions. Used alongside the MessageShim#recordSubscribedConsume API method.
Name | Type | Description |
---|---|---|
shim | MessageShim | The shim this function was handed to. |
consumer | function | The message consumer to wrap. |
name | string | The name of the consumer method. |
queue | string | The name of the queue this consumer is being subscribed to. |
The consumer method, possibly wrapped.
- Type:
- function
MessageFunction(shim, func, name, args) → {specs.MessageSpec}
Used for determining information about a message either being produced or consumed.
Name | Type | Description |
---|---|---|
shim | MessageShim | The shim this function was handed to. |
func | function | The produce method or message consumer. |
name | string | The name of the producer or consumer. |
args | Array.<*> | The arguments being passed into the produce method or consumer. |
The specification for the message being produced or consumed.
- Type:
- specs.
MessageSpec
MessageHandlerFunction(shim, func, name, args) → {specs.MessageSpec}
A function that is used to extract properties from a consumed message. This method is handed the results of a consume call. If the consume used a callback, then this method will receive the arguments to the callback. If the consume used a promise, then this method will receive the resolved value.
Name | Type | Description |
---|---|---|
shim | MessageShim | The shim this function was handed to. |
func | function | The produce method or message consumer. |
name | string | The name of the producer or consumer. |
args | Array | | Either the arguments for the consumer callback function or the result of the resolved consume promise, depending on the mode of the instrumented method. |
The extracted properties of the consumed message.
- Type:
- specs.
MessageSpec
MessageSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
destinationName | number | | <optional> | |
destinationType | string | | <optional> | |
headers | Object.<string, string> | | <optional> | |
messageHeaders | MessageBrokerHeadersFn | | <optional> | |
messageHandler | MessageHandlerFunction | | <optional> | |
queue | number | | <optional> | |
routingKey | string | | <optional> |
- Mixes In
- Source
MessageSubscribeSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
consumer | number | | <optional> |
- Mixes In
MiddlewareMounterSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
route | RouteParserFunction | | <optional> | |
wrapper | MiddlewareWrapperFunction | <optional> |
- Mixes In
MiddlewareSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
appendPath | boolean | <optional> | |
next | number | | <optional> | |
params | RouteParameterFunction | | <optional> | |
req | number | | <optional> | |
res | number | <optional> | |
route | number | | <optional> | |
type | string | <optional> |
- Mixes In
MiddlewareTypeNames
- Object.<string, string>
MiddlewareWrapperFunction(shim, middleware, fnName, routeopt)
Called for each middleware passed to a mounting method. Should perform the wrapping of the middleware.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
shim | WebFrameworkShim | The shim used for instrumentation. | ||
middleware | function | The middleware function to wrap. | ||
fnName | string | The name of the middleware function. | ||
route | string | <optional> | null | The route the middleware is mounted on if one was found. |
OperationSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
parameters | DatastoreParameters | | <optional> | |
record | boolean | <optional> |
- Mixes In
QueryFunction(shim, func, name, args) → {string}
Retrieves the query argument from an array of arguments.
Name | Type | Description |
---|---|---|
shim | Shim | The shim this function was passed to. |
func | function | The function being recorded. |
name | string | The name of the function. |
args | Array.<*> | The arguments being passed into the function. |
- Source
The query string from the arguments list.
- Type:
- string
QueryParserFunction(query) → {ParsedQueryData}
Used to parse queries to extract the basic information about it.
Name | Type | Description |
---|---|---|
query | string | The query to be parsed. |
An object containing the basic information about the query.
- Type:
- ParsedQueryData
QuerySpecFunction(shim, func, name, args) → {QuerySpec}
Used for determining information about a query when it can not be simply found in the arguments.
Name | Type | Description |
---|---|---|
shim | Shim | The shim this function was passed to. |
func | function | The function being recorded. |
name | string | The name of the function. |
args | Array.<*> | The arguments being passed into the function. |
The spec for how this query should be recorded.
- Type:
- QuerySpec
QuerySpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
query | number | | <optional> |
- Mixes In
- Source
QueueMessageParametersParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
correlation_id | string | <optional> | |
reply_to | string | <optional> | |
routing_key | string | <optional> |
RecorderFunction(shim, func, name, args) → {string|RecorderSpec}
A function which is called to compose a segment for recording.
Name | Type | Description |
---|---|---|
shim | Shim | The shim this function was passed to. |
func | function | The function being recorded. |
name | string | The name of the function. |
args | Array.<*> | The arguments being passed into the function. |
- Source
The desired properties for the new segment.
- Type:
- string |
RecorderSpec
RecorderSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
after | SpecAfterFunction | <optional> | |
callback | number | | <optional> | |
callbackRequired | boolean | <optional> | |
promise | boolean | <optional> | |
rowCallback | number | | <optional> | |
stream | boolean | | <optional> |
- Mixes In
RenderSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
view | number | <optional> |
- Mixes In
- Source
RouteNextFunction(shim, fn, fnName, args) → {object}
Used to wrap functions that users can call to continue to the next middleware.
Name | Type | Description |
---|---|---|
shim | WebFrameworkShim | The shim used for instrumentation. |
fn | function | The middleware function. |
fnName | string | The name of the middleware function. |
args | Array | The arguments to the middleware function. |
The request object.
- Type:
- object
RouteParameterFunction(shim, fn, fnName, args) → {object}
Extracts the route parameters from the arguments to the middleware function.
Name | Type | Description |
---|---|---|
shim | WebFrameworkShim | The shim used for instrumentation. |
fn | function | The middleware function. |
fnName | string | The name of the middleware function. |
args | Array | The arguments to the middleware function. |
A map of route parameter names to values.
- Type:
- object
RouteParserFunction(shim, fn, fnName, route) → {string|RegExp}
Called whenever new middleware are mounted using the instrumented framework, this method should pull out a representation of the mounted path.
Name | Type | Description |
---|---|---|
shim | WebFrameworkShim | The shim in use for this instrumentation. |
fn | function | The function which received this route string/RegExp. |
fnName | string | The name of the function to which this route was given. |
route | string | | The route that was given to the function. |
The mount point from the given route.
- Type:
- string |
RegExp
RouteRequestFunction(shim, fn, fnName, args) → {object}
Extracts the request object from the arguments to the middleware function.
Name | Type | Description |
---|---|---|
shim | WebFrameworkShim | The shim used for instrumentation. |
fn | function | The middleware function. |
fnName | string | The name of the middleware function. |
args | Array | The arguments to the middleware function. |
The request object.
- Type:
- object
SegmentFunction(shim, func, name, args) → {string|SegmentSpec}
A function which is called to compose a segment.
Name | Type | Description |
---|---|---|
shim | Shim | The shim this function was passed to. |
func | function | The function the segment is created for. |
name | string | The name of the function. |
args | Array.<*> | The arguments being passed into the function. |
- Source
The desired properties for the new segment.
- Type:
- string |
SegmentSpec
SegmentSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
inContext | InContextCallback | <optional> | |
internal | boolean | <optional> | |
name | string | <optional> | |
opaque | boolean | <optional> | |
parameters | Object.<string, *> | <optional> | |
parent | TraceSegment | <optional> | |
recorder | MetricFunction | <optional> |
- Source
SpecAfterFunction(params)
A callback invoked after an instrumented function has completed its work. The instrumented function must have been invoked synchronously.
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params | Object | params to function Properties
|
TransactionSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
nest | boolean | <optional> | |
type | string | <optional> |
- Mixes In
WrapFunction(shim, original, name) → {*}
A function which performs the actual wrapping logic.
If the return value of this function is not original
then the return value will be marked as a wrapper.
Name | Type | Description |
---|---|---|
shim | Shim | The shim this function was passed to. |
original | object | | The item which needs wrapping. Most of the time this will be a function. |
name | string | The name of |
- Source
The wrapper for the original, or the original value itself.
- Type:
- *
WrapSpecParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
matchArity | boolean | <optional> | |
wrapper | function | <optional> |
- Mixes In
- Source
startSegmentCallback(cb) → {Promise}
Name | Type | Description |
---|---|---|
cb | function | The function to time with the created segment. |
Returns a promise if cb returns a promise.
- Type:
- Promise