Article

Control observability costs from trial to rollout

Learn what each Datadog product bills on, set sample rates and filters during a trial, and add usage monitors before you move to a paid plan.

Published Updated 10 min read

A trial of an observability platform often runs with every setting at 100%, because the team wants to see everything. That is useful for a few weeks, but the same settings on a paid plan can make the first bill much higher than you planned. This guide shows how sampling, session replay, log indexing and security scanning add up, and what to check before you move from a trial to a paid plan. It uses Datadog as the example and is written for tech leads and platform engineers who own the rollout. It extends our post on Datadog RUM and APM for the Next.js App Router, which explains the RUM and APM sample rates in detail. This post gives no prices, so check the Datadog pricing page and your own contract.

Know the billing unit of each product

Every product has its own billing unit, and each unit has a different control. Unless your order says otherwise, Datadog calculates fees on the usage in each calendar month.

Product Billing unit Main control
RUM Measure Per 1,000 sessions sent to Datadog sessionSampleRate in the SDK
RUM Investigate Per 1,000 sessions that you retain RUM retention filters
Session Replay Per 1,000 sessions, as an add-on sessionReplaySampleRate and retention filters
Log ingestion Per GB ingested What the browser and the Agent send
Indexed logs Per million log events, at the rate for the retention period Exclusion filters, daily quota, index retention
APM hosts Per host that sends traces Number of hosts
Ingested spans Per GB ingested Sampling rules, Ingestion Control
Indexed spans Per million spans APM retention filters
Sensitive Data Scanner Per GB scanned, per month Scanning group filters
Static Code Analysis (SAST), Static SCA Per committer, per month Repositories that you scan
Synthetic tests Per 10,000 API test runs, per 1,000 browser test runs Test frequency and locations

A RUM session expires after 15 minutes of inactivity or after 4 hours of continuous activity. Datadog bills webview events in an instrumented mobile app as part of the mobile session. Sessions that Synthetic Monitoring creates are billed under Synthetic Monitoring and not under RUM.

For code security, a committer is an active Git committer, identified by the Git author email address. A committer counts towards billing after at least 3 commits in a month. In an organisation with many teams, that number can be large.

The pricing list shows three rates for most products: billed annually, month-to-month and on-demand. The log and code security billing pages explain that usage above your commitment is billed on-demand. If a code security product is not on your contract, Datadog bills the on-demand rate for each product that you enable. So check which products you turned on during the trial, and make sure each one is either in the contract or turned off.

Make sample rates configuration, not code

The browser RUM SDK has two rates:

  • sessionSampleRate is the percentage of all sessions that the SDK tracks. The default is 100.
  • sessionReplaySampleRate is the percentage of tracked sessions that also record a replay. Since SDK v5.0.0, the default is 0.

The replay rate applies after the session rate. In the Datadog example, a sessionSampleRate of 60 and a sessionReplaySampleRate of 50 drop 40% of sessions, collect 30% as RUM and collect 30% as RUM with Session Replay. So a replay rate of 100 during a trial is a choice that someone made, not a default.

The browser logs SDK has its own sessionSampleRate, with a default of 100. It also has forwardErrorsToLogs, which forwards uncaught exceptions and network errors to logs and is true by default. So the same frontend error can arrive once as a RUM error and once as a log.

Read all rates from build-time configuration. Each environment can then have its own rates, and the move from trial to rollout becomes a configuration change:

import { datadogRum } from '@datadog/browser-rum';
import { datadogLogs } from '@datadog/browser-logs';

const rate = (value: string | undefined, fallback: number) =>
  value === undefined ? fallback : Number(value);

datadogRum.init({
  applicationId: '<application-id>',
  clientToken: '<client-token>',
  site: '<site>',
  service: '<service>',
  env: '<env>',
  version: '<version>',
  sessionSampleRate: rate(process.env.NEXT_PUBLIC_DD_SESSION_SAMPLE_RATE, 100),
  sessionReplaySampleRate: rate(process.env.NEXT_PUBLIC_DD_REPLAY_SAMPLE_RATE, 0),
});

datadogLogs.init({
  clientToken: '<client-token>',
  site: '<site>',
  service: '<service>',
  env: '<env>',
  version: '<version>',
  sessionSampleRate: rate(process.env.NEXT_PUBLIC_DD_LOGS_SAMPLE_RATE, 100),
  // Set to false if RUM already gives you the errors that you need.
  forwardErrorsToLogs: true,
});

Write down every rate that you set for the trial and the value that you want for the rollout. Do the same for the APM rates that our Next.js post describes.

Keep the right RUM sessions with retention filters

With RUM without Limits, ingestion and retention are separate. The SDK sample rate decides which sessions Datadog ingests. Retention filters then decide which of those sessions Datadog stores for 30 days.

Retention filters run on RUM events as Datadog ingests them. Each event goes through three groups in this order:

  1. Permanent retention filters. These are predefined and you cannot change them. One of them keeps all sessions with a replay that you force-collected.
  2. Exclusion filters. A matching event skips the custom retention filters. A predefined exclusion filter reuses the errors that you excluded in Error Tracking.
  3. Custom retention filters, in your order. Each filter has a query and a retention rate. When an event matches and the rate samples it in, Datadog keeps the whole session.

Note these points:

  • An exclusion filter applies to the event, not to the session. If another event from the same session matches a custom retention filter, Datadog keeps the session, including the excluded event.
  • The lowest retention rate is 0.1%, so you cannot use a custom filter to exclude events. Add - terms to the query of the filter instead, for example -@device.type:Bot.
  • Counts such as @session.error.count start at zero and update in real time. Use a >= condition, such as @session.error.count >= 2, or add @session.is_active: false.

A known noisy error from one high-traffic app is a good first exclusion filter, because it can match many events. If you already excluded it in Error Tracking, turn on the predefined filter instead of a second copy.

Limit log ingestion and indexing

Logs have two billing units, so there are two places to save. Ingestion is billed per GB, and you control it before the data leaves your systems. Indexing is billed per million events, and you control it in Datadog.

To stop logs before ingestion, use a processing rule in the Agent:

# datadog.yaml
logs_config:
  processing_rules:
    - type: exclude_at_match
      name: exclude_healthcheck
      pattern: healthcheck

To limit indexing, use the settings of each log index:

Setting What it does
Exclusion filter A query and a sampling rate from 0 to 100%, per log or per unique value of an attribute. Only the first active filter that matches applies.
Daily quota A limit in millions of log events per day, with an optional reset time and a warning threshold of at least 50%. Datadog creates an event when a threshold or the quota is reached.
Retention The number of days that the index keeps logs. The rate for indexed logs depends on it.

The Datadog docs give an example: keep all 3xx, 4xx and 5xx logs, and exclude 95% of the 2xx logs. Excluded logs still go to Live Tail, to metrics generated from logs and to archives. So you can keep a metric for every request and index only a sample of the logs.

Put noisy sources in their own index with a short retention and a daily quota. That way, one platform with many errors cannot use up the volume of the other teams.

Check APM ingestion

APM has three units: hosts, ingested spans in GB and indexed spans. The Ingestion Control page shows the data that you ingested this month, a projection for the end of the month and your monthly allotment. From there, you can change sampling rates for high-throughput services or set an adaptive sampling target. Our Next.js post has a worked example of how browser and backend rates combine.

Plan security scanning before you enable it

Security products scale with your organisation, not with your traffic. SAST and Static SCA count committers, so one setting that turns on scanning for every repository can add many committers at once. Agree the number of committers and the products in the contract before you enable them on all repositories.

Sensitive Data Scanner bills per GB scanned. A scanning group has a query filter and a toggle per product, so limit each group to the data that can hold sensitive values. You can sample a product at 10% to 99% when you get started, but you cannot use actions that obfuscate data on a sampled product.

Attribute usage to teams

A single total does not tell you which team or service causes a change. Usage Attribution in Plan & Usage breaks down usage by up to three tag keys, for example team, service and env. You need the Admin role or the Usage Read permission.

  • The first report arrives 24 hours after you set the tags.
  • Monthly reports update daily, and you can download them as CSV or get them through the API. Hourly data is available through the API.
  • If you change the tags in the middle of a month, you get partial reports for each period.
  • Usage that cannot be tagged at instrumentation is not supported.

Choose the tag keys before the rollout, and make sure every service, RUM application and log source sends them. If your organisation has the Bill Overview page, it shows the estimated cost to date and a projection for the month.

Alert on estimated usage

Datadog has two kinds of usage metrics:

  • Estimated usage metrics are near real-time. On average, they differ from billable usage by 10% to 20%, and the difference is larger for small usage.
  • Finalised usage metrics match billed values, but they arrive 4 to 24 hours later.

Use the estimated metrics for dashboards and monitors. Always use sum as the space aggregator, because many of these metrics are split into several timeseries and only sum gives your total.

What to watch Estimated usage metric
RUM sessions datadog.estimated_usage.rum.sessions
Ingested and retained RUM sessions datadog.estimated_usage.rum.ingested_sessions, datadog.estimated_usage.rum.indexed_sessions
Ingested logs datadog.estimated_usage.logs.ingested_bytes, datadog.estimated_usage.logs.ingested_events
Ingested and indexed spans datadog.estimated_usage.apm.ingested_bytes, datadog.estimated_usage.apm.indexed_spans
Scanned data datadog.estimated_usage.sds.scanned_bytes
Code security committers datadog.estimated_usage.code_security.sast.committers, datadog.estimated_usage.code_security.sca.committers

logs.ingested_events includes the logs that exclusion filters remove, so compare it with your index settings. The committer metrics count from the start of the calendar month.

Datadog has out-of-the-box Estimated Usage dashboards in the preset dashboard lists. Clone one, add your team tags, and create a metric monitor for each product with a threshold that matches your commitment.

In practice

An international cosmetics retailer chose Datadog in November 2025, and the trial ran until late December 2025. During the trial, RUM and session replay ran at 100% intake, and they stayed there until early January 2026, so the usage in that period was much higher than expected.

After the move to a paid account, all intake was set to 2% to keep usage low. The next steps were to limit the intake of sessions and logs with errors, and to filter the errors from one high-traffic platform aggressively. Static analysis had also moved into Datadog, in place of a separate SAST tool, so its usage, which is billed per committer, had to be part of the plan. Read the full case study.

Checklist

  • List every product that you turned on in the trial and its billing unit.
  • Make sure each product is in the contract or turned off.
  • Read sessionSampleRate and sessionReplaySampleRate from configuration per environment.
  • Decide whether forwardErrorsToLogs sends errors that RUM already has.
  • Add RUM retention filters and reuse the Error Tracking exclusions.
  • Give each log index exclusion filters, a daily quota and a fitting retention.
  • Agree the number of committers before you enable SAST and SCA everywhere.
  • Choose up to three tag keys for Usage Attribution before the rollout.
  • Clone the Estimated Usage dashboards and add monitors on the estimated usage metrics.
  • Compare the estimated usage with the first bill and adjust the rates.

For a review of your Datadog setup and its usage before you sign a contract, see the frontend observability assessment.

Sources

Let's connect

Talk about your project

Tell us about your team and your problem. In 30 minutes we find out whether one of our offers fits, and if none does, we tell you.

Book a 30-minute call