Global

Methods

getDatabaseNameFromUseQuery(query) → (nullable) {string}

Parses the database name from a USE SQL query.

Source:
Parameters:
Name Type Description
query string

The SQL query to parse the database name from.

Returns:
Type:
string

The name of the database if it could be parsed, otherwise null.

setIgnoreTransaction(ignored)

Tell the tracer whether to ignore the current transaction. The most common use for this will be to mark a transaction as ignored (maybe it's handling a websocket polling channel, or maybe it's an external call you don't care is slow), but it's also useful when you want a transaction that would otherwise be ignored due to URL or transaction name normalization rules to not be ignored.

Source:
Parameters:
Name Type Description
ignored boolean

Ignore, or don't ignore, the current transaction.

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.

Source:
Parameters:
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.

ConstructorHookFunction(shim, Base, name, args)

Pre/post constructor execution hook for wrapping classes. Used by ClassWrapSpec.

Source:
See:
Parameters:
Name Type Description
shim Shim

The shim performing the wrapping/binding.

Base function

The class that was wrapped.

name string

The name of the Base class.

args Array.<*>

The arguments to the class constructor.

MessageConsumerWrapperFunction(shim, consumer, name, queue) → {function}

Function that is used to wrap message consumer functions. Used along side the MessageShim#recordSubscribedConsume API method.

Source:
See:
Parameters:
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.

Returns:
Type:
function

The consumer method, possibly wrapped.

MessageFunction(shim, func, name, args) → {MessageSpec}

Used for determining information about a message either being produced or consumed.

Source:
See:
Parameters:
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.

Returns:
Type:
MessageSpec

The specification for the message being produced or consumed.

MessageHandlerFunction(shim, func, name, args) → {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.

Source:
See:
Parameters:
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.

Returns:
Type:
MessageSpec

The extracted properties of the consumed message.

MiddlewareWrapperFunction(shim, middleware, fnName, routeopt)

Called for each middleware passed to a mounting method. Should perform the wrapping of the middleware.

Source:
See:
Parameters:
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.

QueryFunction(shim, func, name, args) → {string}

Pulls the query argument out from an array of arguments.

Source:
See:
Parameters:
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.

Returns:
Type:
string

The query string from the arguments list.

QueryParserFunction(query) → {ParsedQueryData}

Used to parse queries to extract the basic information about it.

Source:
See:
Parameters:
Name Type Description
query string

The query to be parsed.

Returns:
Type:
ParsedQueryData

An object containing the basic information about the query.

QuerySpecFunction(shim, func, name, args) → {QuerySpec}

Used for determining information about a query when it can not be simply found in the arguments.

Source:
See:
Parameters:
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.

Returns:
Type:
QuerySpec

The spec for how this query should be recorded.

RecorderFunction(shim, func, name, args) → {string|RecorderSpec}

A function which is called to compose a segment for recording.

Source:
Parameters:
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.

Returns:
Type:
string | RecorderSpec

The desired properties for the new segment.

RouteNextFunction(shim, fn, fnName, args, wrap) → {Object}

Used to wrap functions that users can call to continue to the next middleware.

Source:
Parameters:
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.

wrap NextWrapperFunction

A function to wrap an individual next function.

Returns:
Type:
Object

The request object.

RouteParameterFunction(shim, fn, fnName, args) → {Object}

Extracts the route parameters from the arguments to the middleware function.

Source:
Parameters:
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.

Returns:
Type:
Object

A map of route parameter names to values.

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.

Source:
Parameters:
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 | RegExp

The route that was given to the function.

Returns:
Type:
string | RegExp

The mount point from the given route.

RouteRequestFunction(shim, fn, fnName, args) → {Object}

Extracts the request object from the arguments to the middleware function.

Source:
Parameters:
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.

Returns:
Type:
Object

The request object.

SegmentFunction(shim, func, name, args) → {string|SegmentSpec}

A function which is called to compose a segment.

Source:
Parameters:
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.

Returns:
Type:
string | SegmentSpec

The desired properties for the new segment.

startSegmentCallback(cb) → {Promise}

Source:
Parameters:
Name Type Description
cb function

The function to time with the created segment.

Returns:
Type:
Promise

Returns a promise if cb returns a promise.

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.

Source:
Parameters:
Name Type Description
shim Shim

The shim this function was passed to.

original Object | function

The item which needs wrapping. Most of the time this will be a function.

name string

The name of original if it can be determined, otherwise '<anonymous>'.

Returns:
Type:
*

The wrapper for the original, or the original value itself.