Reducing Data Size with Sampling

In a serverless system, you need to debug your application and detect issues quickly in order to have a reliable product. Observability is the key of obtaining such an application. You should have a useful contextual information to debug and observe your serverless system. However, to collect logs and data to have observability in your system can be costly. Thundra introduces sampling to solve cost issue for you!

Using Thundra, data of your system is collected by asynchronous or synchronously. In order to collect data async, lots of data is sent to CloudWatch logs and this causes much more cost to you. However Thundra's sampling feature allows you to reduce your cost.Taking a percentage of your invocation can be enough to observe your metrics, anomalies and debug your system. You can sample your metrics, traces and logs.

Thundra supports sampling for Java, NodeJS, .NET and Python.

Sampling Metrics

While sampling your metric data you can use 4 different ways:

  • Count Aware Sampler - samples metrics for a configured percentage of all invocations.

  • Time Aware Sampler - samples metrics with every configured time within consecutive lambda invocations.

  • Error Aware Sampler - samples metrics for erroneous invocations.

  • Custom Sampler - samples metrics with customized function.

  • Composite Sampler - samples metrics with more than one sampler.

Visit for detailed information: Java, .NET, NodeJS, Python Metric Sampling pages.

Sampling Traces

In Thundra you can also sample your trace data. In order to sample your trace data you can use different ways:

  • Duration Aware Sampler - samples trace data only if duration of invocation is more than configured time.

  • Error Aware Sampler - samples traces for erroneous invocations.

  • Count Aware Sampler - samples traces for a configured percentage of all invocations.

  • Time Aware Sampler - samples trace data with every configured time within consecutive lambda invocations.

  • Custom Sampler - samples traces with a customized function.

Visit for detailed information: Java, .NET, NodeJS, Python Trace Sampling pages.

Sampling Logs

Logs can cause spending more while you are observing your serverless system. Thundra helps you to sample your logs in different ways:

  • Count Aware Sampler - samples logs for a configured percentage of all invocations.

  • Time Aware Sampler - samples logs with every configured time within consecutive lambda invocations.

  • Error Aware Sampler - samples logs for erroneous invocations.

  • Custom Sampler - samples logs with customized function.

  • Log level filtering - set level of logs that will be reported.

How to configure your serverless system for logging?

For configuring sampling in each environment explore our documentation pages: Java, Python, NodeJS, .NET and Go.

‚Äč