Thundra APM
Search…
Deployment Integrations
Hapi

Step 1: Install Thundra

npm install @thundra/core --save

Step 2: Configure Integration

After installing the @thundra/core module, there is no need to add any plugins. Thundra will monitor your application automatically.
app.js
const thundra = require("@thundra/core");
const Hapi = require('@hapi/hapi');
thundra.init();
const startServer = async () => {
const server = Hapi.server({
...
});
server.route([{
method: 'GET',
path: '/',
handler: (request, h) => {
return 'Hello Thundra';
}
}]);
await server.start();
}
startServer();

Step 3: Add Thundra API Key

Set the thundra_apiKey environment variable to the API key value you got from the Thundra console. You can add api key in different ways:
app.js
const thundra = require("@thundra/core");
// adding apiKey programmatically
thundra.init({
apiKey:<Thundra-ApiKey>
})
Shell
export thundra_apiKey=<Thundra-ApiKey>
Dockerfile
ENV thundra_apiKey=<Thundra-ApiKey>
By default, the name of your app will be thundra-app. When you are monitoring multiple Hapi applications you might want to set this to different names for each application, or in general, you might want to describe your applications better. To change the default application name, you can set the thundra_agent_application_name environment variable to anything you want.
Copy link
On this page
Step 1: Install Thundra
Step 2: Configure Integration
Step 3: Add Thundra API Key