Optional
allowlistList of URLs/paths that should be instrumented.
Note that when used for an http client the entry represents a full
outbound URL (https://example.org/api/foo
) but when used as a
server the entry represents an inbound path (/api/foo
).
/^.*$/
Optional
blocklistList of URLs/paths that should not be instrumented. Takes precedence over allowlist if a URL matches an entry in both.
Note that when used for an http client the entry represents a full
outbound URL (https://example.org/api/foo
) but when used as a
server the entry represents an inbound path (/api/foo
).
[]
Optional
clientConfiguration for HTTP clients.
Optional
enabledWhether to enable the plugin.
true
Optional
headersAn array of headers to include in the span metadata.
[]
Optional
measuredWhether to measure the span. Can also be set to a key-value pair with span names as keys and booleans as values for more granular control.
Optional
serverConfiguration for HTTP servers.
Optional
serviceThe service name to be used for this plugin.
Optional
splitUse the remote endpoint host as the service name instead of the default.
false
Optional
validateCallback function to determine if there was an error. It should take a
status code as its only parameter and return true
for success or false
for errors.
Callback function to determine if there was an error. It should take a
status code as its only parameter and return true
for success or false
for errors.
code => code < 400 || code >= 500
code => code < 400 || code >= 500
Generated using TypeDoc
This plugin automatically instruments the http2 module.
By default any option set at the root will apply to both clients and servers. To configure only one or the other, use the
client
andserver
options.