Fastify
Code Execution Monitoring for Fastify applications.
Last updated
Code Execution Monitoring for Fastify applications.
Last updated
Fastify >= 3.x
Install the latest version of the module using the npm command below:
You need an Ingestion Key to create an Inspector instance. You can obtain a key creating a new project in your dashboard.
If you use dotenv
you can configure the Inspector Ingestion Key in your environment file:
Just two steps:
Initialize Inspector before you require any other modules in your application - i.e. before fastify
, http
, mysql
, etc.
Attach the inspector.fastify()
function to your fastify app.
Send an HTTP request to your fastify app to see the first data in your dashboard.
If you want to turn off monitoring in some parts of your application you can pass a JSON object to the registering function with excludePaths
property to define which routes you want to exclude:
You can also use the wildcard character *
to match a subset of your urls:
Inspector will decorate the fastify instance with a new property to access Inspector anywhere in your application:
It's mandatory to call the Inspector instance inside your fastify instance to allow automatic tasks identification.
By default Inspector will report many different tasks based on the application's dependencies, but you are free to "wrap" some parts of your code that you consider relevant to create a more complete picture of what statements are executed during an execution cycle and its performance.
Some of the most used modules will be autowired by default. .