Observability storage and retention

Use database measurements—not fixed bytes-per-record estimates—to size observability storage. Attribute sizes, indexes, compression, sampling, and traffic shape all affect the result. This page explains the defaults Temps applies and the controls available when telemetry grows faster than expected.

Understand the defaults

Temps stores OpenTelemetry data and proxy request logs in PostgreSQL with TimescaleDB unless ClickHouse is configured.

DataDefault retentionDefault TimescaleDB compression
OTel spans90 daysafter 24 hours
Proxy request logs30 daysafter 24 hours
OTel metrics90 daysafter 7 days
OTel log events90 daysafter 7 days

The application settings API can change the compression delay for spans and proxy logs at runtime. Retention limits how long records remain available; it does not limit how quickly new records arrive.

Measure TimescaleDB usage

Run the following query with psql against the Temps database to compare the large observability hypertables:

psql

SELECT
  hypertable_name,
  pg_size_pretty(
    hypertable_size(
      format('%I.%I', hypertable_schema, hypertable_name)::regclass
    )
  ) AS total_size,
  approximate_row_count(
    format('%I.%I', hypertable_schema, hypertable_name)::regclass
  ) AS approximate_rows
FROM timescaledb_information.hypertables
WHERE hypertable_name IN (
  'otel_spans',
  'otel_metrics',
  'otel_log_events',
  'proxy_logs'
)
ORDER BY hypertable_name;

To see which chunks consume the most space, run chunks_detailed_size for the table you want to investigate:

psql

SELECT
  chunk_schema,
  chunk_name,
  pg_size_pretty(total_bytes) AS total_size
FROM chunks_detailed_size('otel_spans')
ORDER BY total_bytes DESC;

Measure the same tables at regular intervals to establish a growth rate for your workload. Avoid extrapolating from another installation because span attributes and instrumentation choices can change storage per record substantially.

Reduce span volume

Reduce unnecessary telemetry before changing database policies. Common options include:

  • Sample traces with your OpenTelemetry SDK or Collector.
  • Exclude health checks, static assets, and other high-volume endpoints that do not need traces.
  • Disable instrumentation that creates low-value middleware or network spans.
  • Remove large or unbounded span attributes.

For SDKs that support the standard OpenTelemetry environment variables, this example keeps a sample of traces:

environment

OTEL_TRACES_SAMPLER=traceidratio
OTEL_TRACES_SAMPLER_ARG=0.05

Choose the ratio from your own traffic and diagnostic requirements. Head sampling can omit rare traces, so validate the result before applying it to incident-critical services.

Set an ingest quota

OpenTelemetry storage quotas are disabled by default. Set TEMPS_OTEL_QUOTA_GB to enable the same per-project limit for every project:

environment

TEMPS_OTEL_QUOTA_GB=10

Temps estimates the project's combined OTel metrics, spans, and log-event storage. Once the estimate reaches the configured limit, further OTLP ingest for that project returns 413 Storage Quota Exceeded. Unset the variable, or set it to 0, to disable the quota.

Two additional variables control the per-project request rate:

environment

TEMPS_OTEL_RATE_LIMIT=1000
TEMPS_OTEL_RATE_LIMIT_WINDOW_SECS=60

The defaults are 1,000 ingest requests per 60-second window. Rate limiting bounds request bursts; it does not replace a storage quota or source-side sampling.

Change retention and compression

Change the span and proxy-log compression delays from the Temps settings API or dashboard. Temps reapplies the corresponding TimescaleDB compression policies without requiring a rebuild.

If you intentionally manage retention in SQL, replace the policy for the relevant hypertable. For example, to retain spans for 30 days:

psql

SELECT remove_retention_policy('otel_spans', if_exists => TRUE);
SELECT add_retention_policy(
  'otel_spans',
  drop_after => INTERVAL '30 days',
  if_not_exists => TRUE
);

To remove existing chunks older than that window immediately:

psql

SELECT drop_chunks('otel_spans', older_than => now() - INTERVAL '30 days');

Use ClickHouse for sustained volume

ClickHouse is the optional column-oriented backend for analytics and observability data. Consider it when measured growth or query latency makes the default TimescaleDB backend unsuitable for your workload.

Configure all required TEMPS_CLICKHOUSE_* connection values and restart Temps. New records then use ClickHouse for the supported domains; existing TimescaleDB history is not copied automatically. Follow the migration guide to backfill and validate historical data before treating the switch as complete.

ClickHouse applies row-level retention to spans and proxy logs. The open-source defaults are 90 days for spans and 30 days for proxy logs.

Was this page helpful?