Defining Thundra for each function can be a daunting task, which is why we created a Serverless Framework plugin that automatically adds Thundra Layer and instruments all the functions in the .yaml file.
Note that this plugin is currently only available for Java, Python, Node.js and .NET functions.
- First, download Thundra’s serverless plugin using the npm command as shown below:
npm install serverless-plugin-thundra
- After installing Thundra’s serverless plugin, specify it as a plugin for your serverless environment by adding it under the
pluginssection of your .yml file:
- Add your Thundra API key by setting the
Note that some runtime specific configuration should be applied. You may need to check integration options for your function(s) runtime.
You can configure Thundra's serverless plugin to disable specific functions or the whole plugin.
To disable Thundra's serverless plugin, use the
disablevariable under the Thundra component, which you added under
customwhen adding the
pluginto your '.yml' file:
You may disable Thundra's serverless plugin for some specific function when defining your functions under the
Thundra's Serverless Framework plugin allows you to instrument several functions in one go, and also protect your code base from errors that can occur from manual wrapping. However, you still need to configure other aspects of your monitoring requirements. Thundra has several monitoring capabilities, such as instrumentation, to visualize your entire serverless environment in forms of spans. If you would like to enhance your monitoring experience, you will need to perform further configurations, most of which can be performed via environment variables. This prevents you from injecting configurations within your code base, which are prone to errors if not done correctly.