You can configure Thundra using environment variables or set them programmatically. Environment varialbes have higher precedence over setting them programmatically.
Specifies the profile where the monitor data was collected from.
Profiles are used for representing different environments such as "development", "staging", "production", etc..
Set this true if you want to disable Thundra.
Set this true if you don't want to send your lambda function's request to Thundra.
Set this true if you don't want to send your lambda function's response to Thundra.
Set this true if you want to enable async monitoring.
Note that only setting this is not enough, you should do a little more.
Check out How to Setup Async Monitoring for more information.
Set this if you want to change the URL Thundra agent sends reports to.
Default is set to
Note: "/monitor-datas" is added to URL automatically. For example in the default case it will send the data to
Set this to determine the minimum level of log
thundra_log.Logger should collect. See log levels for more information.
If you set it true Thundra will print collected data to CloudWatch logs. This can be helpful to debug to see if agent behaves correctly. If you find any problem then you can reach us by sending these logs.
Specifies how much time is needed to send report before lambda is timed out. You should change this variable if the timeout_margin is not enough and you may not see your timed out functions on Thundra Console. The default value is 200 ms.
Instead of setting as an environment variable, you can use the following functions to configure your thundra.
// ... means you can add more configurations if you want t := thundra.NewBuilder()....SetApiKey("#YOUR API KEY")Build()
Enables warming up to reduce cold starts of your lambda. Note that only setting this is not enough, you should do a little more.
Check out How to Warmup for more information.
// ... means you can add more configurations if you want t := thundra.NewBuilder()...EnableWarmup().Build()
AddPlugin is used to add plugins thundra. Trace and Metrics are two plugins that are supported currently.
You need to initialize a plugin object and pass it as a parameter in order to enable it.
tr := trace.NewTrace() m := metric.NewBuilder().Build() // ... means you can add more configurations if you want t := thundra.NewBuilder()....AddPlugin(tr).AddPlugin(m).Build()