Skip to content

Configuration

The Docker setup is ready to use without changing metric.toml. The installer chooses one tested file from deploy/profiles/ and saves it as metric.toml. Most installations only need the values already created in .env:

  • METRIC_PROFILE;
  • COMPOSE_PROFILES;
  • METRIC_MONGO_PASSWORD;
  • METRIC_SCRUB_HMAC_KEY;
  • METRIC_HTTP_PORT;
  • METRIC_IMAGE;
  • METRIC_SYMBOLICATOR_IMAGE;
  • METRIC_MONGO_CACHE_GB;
  • METRIC_MONGO_MEMORY_LIMIT;
  • METRIC_APP_MEMORY_LIMIT;
  • METRIC_SYMBOLICATOR_MEMORY_LIMIT;
  • METRIC_CLEANUP_MEMORY_LIMIT;
  • METRIC_LOG_MAX_SIZE;
  • METRIC_LOG_MAX_FILES.

Advanced settings live in metric.toml beside compose.yml. Metric reads them once at startup, so restart the container after a change.

Supplied profiles

Profile fileMain purpose
min.tomlMinimum memory and disk use; no Symbolicator or attachments.
low.tomlSmall installation with attachments but no Symbolicator.
medium.tomlRecommended default with Symbolicator.
high.tomlLarger queues, files, storage and retention.

Profile settings are designed as a group. Copying only High queue sizes into Min can make a 1 GiB server run out of memory. Copying only High retention into a smaller profile can fill its disk.

Minidumps and cold archive stay disabled in all supplied profiles. Session Replay still requires an explicit per-project choice.

Check changes before starting

bash
docker compose run --rm --no-deps metric \
  --config /etc/metric/metric.toml \
  --check-config

Unknown names and invalid values stop startup instead of being ignored.

The current Metric version requires MongoDB schema generation 19 exactly. An empty database is prepared automatically. A database created by another schema generation is rejected; follow Update Metric and do not delete data to bypass this check.

How values are selected

From highest to lowest priority:

text
command line → APP__ environment variable → TOML file → built-in default

For example, the environment variable APP__SERVER__REQUEST_TIMEOUT=45s overrides server.request_timeout from TOML.

Environment files are loaded only when passed with --env-file. Existing process environment variables take priority over values in that file.

Docker Compose uses .env to fill values referenced by compose.yml. It does not pass every value from .env into the Metric container. For Docker, the simplest option is to edit metric.toml. If you use an APP__... override, also add that variable under services.metric.environment in compose.yml.

Secrets

Do not write passwords or keys directly in TOML. Point to an environment variable or a file:

toml
[mongodb]
uri = { env = "MONGODB_URI" }

[projects]
scrub_hmac_key = { file = "/run/secrets/scrub-hmac-key" }

SCRUB_HMAC_KEY must contain exactly 32 random bytes written as 64 lowercase hexadecimal characters. Changing it changes IP-address pseudonyms, so keep the same value while the installation contains data.

Value formats

Durations accept values such as 250ms, 30s, 15m, 24h and 30d. Sizes accept values such as 64 KiB, 20 MiB and 1 GiB.

The tables below list every setting and its standalone default. Docker profiles override many of these values; use the selected metric.toml as the exact source for that installation. The main profile differences are summarized in Capacity and profiles.

Server and database

SettingValueMeaning
roleallRuns the complete application. This is the only supported role.
server.http_address127.0.0.1:4001Address and port used by the binary. The container uses 0.0.0.0:4001.
server.shutdown_grace10s (Docker: 30s)Time allowed for work to finish during shutdown.
server.trusted_proxies[]Proxy IP addresses or networks allowed to supply forwarding headers.
server.max_active_requests512Maximum requests handled at the same time. Profiles use 32, 128, 512 or 1536.
server.request_timeout30sGeneral HTTP request deadline.
mongodb.uriMONGODB_URIMongoDB connection string. Keep it secret.
mongodb.databasemetricMongoDB database name.
mongodb.bootstrap_timeout10s (Docker: 30s)Time allowed for database startup checks.
projects.scrub_hmac_keySCRUB_HMAC_KEYSecret used to pseudonymize stored values such as IP addresses.
projects.identity_collision_retries16Attempts to create a unique project identifier.
projects.max_keys_per_project32Maximum DSN keys for one project.

HTTP login and development settings

The built-in defaults require HTTPS. The supplied Docker profiles deliberately set development.allow_insecure_cookies = true and auth.secure_cookie = false, so sign-in works immediately over HTTP. These two values must be changed together.

HTTP does not encrypt passwords, cookies or application data. After adding HTTPS, set development.allow_insecure_cookies = false and auth.secure_cookie = true.

SettingValueMeaning
development.allow_literal_secretsfalseAllows secrets to be written directly in TOML.
development.allow_insecure_cookiesfalse (Docker profiles: true)Allows login cookies without HTTPS.

File and S3 storage

SettingValueMeaning
blob.backendlocalStorage type: local or s3.
blob.root./metric-data/blobs (Docker: /var/lib/metric/blobs)Local storage directory.
blob.capacity1 GiBMaximum space Metric may use in local storage. Profiles use 5 GiB, 10 GiB, 33 GiB or 83 GiB.
blob.reserve128 MiBSpace kept free before new objects are rejected.
blob.max_object_bytes100 MiBMaximum size of one stored object.
blob.s3.endpointunsetCustom S3-compatible endpoint. Leave unset for AWS S3.
blob.s3.regionus-east-1S3 region.
blob.s3.bucketmetricS3 bucket name.
blob.s3.access_key_idunsetS3 access-key reference.
blob.s3.secret_access_keyunsetS3 secret-key reference.
blob.s3.session_tokenunsetOptional temporary S3 session-token reference.
blob.s3.force_path_styletrueUses path-style bucket URLs for compatible storage services.
blob.s3.part_bytes8 MiBSize of each multipart-upload part.

Cold archive

Cold archive is disabled by default.

SettingValueMeaning
archive.enabledfalseWrites old errors, logs and spans to cold storage.
archive.maximum_events500Maximum records in one archive batch.
archive.target_uncompressed_bytes64 MiBTarget batch size before compression.
archive.write_chunk_bytes256 KiBStreaming write chunk size.
archive.poll_interval30sHow often Metric looks for archive work.
archive.hot_copy_delay0sTime data remains only in hot storage before archive work starts.
archive.orphan_grace24hAge required before an unused archive object can be deleted.
archive.cleanup_max_pages4Maximum cleanup pages handled in one run.

Native crashes and symbolication

SettingValueMeaning
native_crash.minidump.enabledfalseAccepts minidumps. They may contain raw process memory.
native_crash.minidump.max_bytes100 MiBMaximum minidump size.
native_crash.minidump.chunk_bytes64 KiBStreaming read chunk size.
symbolicator.endpointunset (Medium/High: http://symbolicator:3021/symbolicate)Symbolicator API address. Min and Low leave it unset.
symbolicator.callback_base_urlhttp://127.0.0.1:4001/ (Docker: http://metric:4001/)Metric address that Symbolicator can call. Change it to a reachable address when Symbolicator runs outside the Compose network.
symbolicator.request_timeout20sSymbolicator request deadline.
symbolicator.maximum_concurrency8Maximum Symbolicator requests at the same time.
symbolicator.circuit_failure_threshold5Consecutive failures before requests pause.
symbolicator.circuit_cooldown30sPause after the failure threshold is reached.
symbolicator.maximum_response_bytes4 MiBMaximum accepted Symbolicator response size.

Medium and High also read symbolicator.yml beside compose.yml. This file configures Symbolicator's internal server, cache and logging. Min and Low omit symbolicator.endpoint; that is what disables processing and preserves raw frames. Their empty COMPOSE_PROFILES value also avoids starting the unused container.

Debug files and artifact bundles

These defaults are used when an [artifacts] section is not present.

SettingValueMeaning
artifacts.maximum_bundle_bytes64 MiBMaximum compressed bundle size.
artifacts.maximum_logical_bytes512 MiBMaximum total size after extraction.
artifacts.maximum_entries10000Maximum files in one bundle.
artifacts.maximum_entry_bytes16 MiBMaximum extracted size of one file.
artifacts.maximum_concurrent_assemblies2Maximum bundles assembled at the same time.
artifacts.parse_timeout30sTime allowed to inspect a bundle.
artifacts.orphan_grace24hAge required before unused upload data can be deleted.
artifacts.claim_lease5mTime one worker owns an assembly job.
artifacts.blob_operation_timeout30sStorage-operation deadline.
artifacts.tombstone_retention24hTime deletion markers are retained.
artifacts.gc_interval15mHow often unused artifact data is cleaned.
artifacts.gc_batch_size100Objects inspected in one cleanup batch.
artifacts.gc_max_concurrency4Maximum cleanup operations at the same time.
artifacts.maximum_bytes_per_organization0 BOrganization byte quota. Zero means unlimited.
artifacts.maximum_bundles_per_organization0Organization bundle quota. Zero means unlimited.

Incident Capsule export

SettingValueMeaning
incident_capsule.max_events10Maximum events included in one export.
incident_capsule.max_activities100Maximum issue activities included.
incident_capsule.max_total_uncompressed_bytes100 MiBMaximum total export size before compression.
incident_capsule.max_entry_bytes16 MiBMaximum size of one export entry.
incident_capsule.generation_timeout30sTime allowed to prepare an export.
incident_capsule.max_concurrency4Maximum exports prepared at the same time.
incident_capsule.stream_chunk_bytes64 KiBDownload streaming chunk size.
incident_capsule.stream_buffer_chunks4Number of chunks buffered during download.

Incoming SDK data

SettingValueMeaning
ingest.max_compressed_request_bytes20 MiBMaximum compressed request size.
ingest.max_decompressed_request_bytes100 MiBMaximum size after decompression.
ingest.max_event_bytes1 MiBMaximum event body size.
ingest.max_envelope_items100Maximum items in one Sentry envelope.
ingest.max_active_requests512Maximum ingest requests handled at the same time. Profiles use 64, 256, 1024 or 4096.
ingest.max_parsing_tasks0Parsing-task limit. Zero selects it automatically. Profiles use 2, 4, 8 or 16.
ingest.max_waiting_for_storage512Maximum queued storage records. Profiles use 128, 512, 2048 or 8192.
ingest.request_timeout10sIngest request deadline.
ingest.unsupported_backoff_seconds3600Retry delay returned for unsupported data.

Attachments

SettingValueMeaning
ingest.attachments.enabledtrueAccepts safe attachment types.
ingest.attachments.max_count10Maximum attachments in one event.
ingest.attachments.max_item_bytes1 MiBMaximum size of one attachment.
ingest.attachments.max_total_bytes5 MiBMaximum combined attachment size.
ingest.attachments.chunk_bytes64 KiBStreaming chunk size.
ingest.attachments.orphan_grace24hAge required before unused attachment data can be deleted.
ingest.attachments.cleanup_interval15mHow often unused attachments are cleaned.
ingest.attachments.cleanup_batch_size256Attachments inspected in one cleanup page.
ingest.attachments.cleanup_max_pages16Maximum cleanup pages in one run.

Session Replay

SettingValueMeaning
ingest.replay.max_segment_bytes5 MiBMaximum compressed replay segment size.
ingest.replay.max_decompressed_segment_bytes20 MiBMaximum segment size after decompression.
ingest.replay.max_events_per_segment100000Maximum replay records in one segment.
ingest.replay.queue_capacity32Maximum queued replay segments.
ingest.replay.max_queued_bytes32 MiBMaximum total replay data waiting in memory.
ingest.replay.orphan_grace1hAge required before unused replay data can be deleted.
ingest.replay.cleanup_interval5mHow often unused replay data is cleaned.
ingest.replay.cleanup_batch_size100Replay objects inspected in one cleanup batch.

Cache, batching and backlog

SettingValueMeaning
ingest.project_cache.capacity100000Maximum cached project entries.
ingest.project_cache.max_inflight512Maximum project lookups at the same time.
ingest.project_cache.positive_ttl60sCache time for a project that exists.
ingest.project_cache.negative_ttl5sCache time for a project that was not found.
ingest.batch.max_wait20msMaximum wait before a partial storage batch is written.
ingest.batch.max_documents250Maximum documents in one storage batch. Profiles use 128, 250, 500 or 500.
ingest.batch.max_bytes8 MiBMaximum estimated batch size. Profiles use 2 MiB, 8 MiB, 32 MiB or 64 MiB.
ingest.event_codec.compression_level3Compression level for stored event bodies.
ingest.event_codec.compression_min_savings64Minimum saved bytes required to keep compression.
ingest.backlog.max_pending_events1000000Pending-event level where ingest protection activates.
ingest.backlog.max_oldest_pending_age1hMaximum acceptable age of the oldest pending event.

Background processing

SettingValueMeaning
dispatcher.queue_capacity4096In-memory processing queue size. Profiles use 256, 1024, 4096 or 12288.
dispatcher.worker_concurrency32Dispatcher workers running at the same time. Profiles use 1, 4, 16 or 64.
dispatcher.low_watermark1024Queue level that triggers a refill.
dispatcher.refill_target3072Queue level targeted by a refill.
dispatcher.refill_batch_size512Maximum records fetched per refill.
dispatcher.poll_interval100msDelay between empty-queue checks.
dispatcher.metrics_interval5sInterval for internal dispatcher measurements.
dispatcher.source_timeout5sDeadline for reading pending work.
scheduler.poll_interval1sHow often scheduled work is checked.
scheduler.maintenance_interval1mGeneral maintenance interval.
scheduler.reconciliation_interval5mInterval for checking unfinished state.
scheduler.backlog_interval5sInterval for checking processing backlog.
scheduler.task_timeout10sDeadline for one scheduler task.
scheduler.retry_base1sFirst scheduler retry delay.
scheduler.retry_max1mMaximum scheduler retry delay.
scheduler.batch_size500Maximum records handled in one scheduler batch.
processor.max_concurrency32Events processed at the same time. Profiles use 1, 4, 16 or 64.
processor.max_attempts5Maximum attempts before processing stops retrying.
processor.retry_base1sFirst processing retry delay.
processor.retry_max5mMaximum processing retry delay.
processor.stage_timeout15sDeadline for one processing stage.
processor.total_timeout1mTotal deadline for one processing attempt.
processor.state_timeout5sDeadline for reading or updating processing state.

Data retention

SettingValueMeaning
retention.events_days30Days to keep error events.
retention.feedback_days90Days to keep user feedback.
retention.issue_stats_hourly_days400Days to keep hourly issue counts.
retention.logs_days30Days to keep structured logs.
retention.spans_days30Days to keep spans.
retention.span_stats_hourly_days90Days to keep hourly span statistics.
retention.sessions_days7Days to keep individual release sessions.
retention.session_stats_hourly_days400Days to keep hourly session statistics.
retention.session_active_max_hours24Maximum time a session may remain active.
retention.monitor_runs_days90Days to keep monitor runs.
retention.metrics_days90Days to keep application metric buckets.
retention.metric_max_series_per_project10000Maximum metric series per project.
retention.metric_archivefalseArchives application metrics when archive storage is enabled.
retention.replays_days30Days to keep Session Replays.
retention.replay_archivefalseArchives replay data when archive storage is enabled.

Project deletion

SettingValueMeaning
project_deletion.grace_period24hDelay during which project deletion can be cancelled.
project_deletion.delete_batch_documents5000Maximum records deleted in one batch.
project_deletion.completed_job_retention30dTime completed deletion records are kept.
project_deletion.slug_reservation30dTime a deleted project slug remains unavailable.
project_deletion.poll_interval1sHow often deletion work is checked.
project_deletion.operation_timeout10sDeadline for one deletion operation.
project_deletion.drain_timeout10sTime allowed for active project work to stop.
project_deletion.retry_base1sFirst deletion retry delay.
project_deletion.retry_max1mMaximum deletion retry delay.

Authentication

SettingValueMeaning
auth.identity_collision_retries16Attempts to create a unique identity value.
auth.store_timeout5sDeadline for an authentication storage operation.
auth.setup_token_timeout24hLifetime of setup and invitation tokens.
auth.max_api_token_lifetime365dLongest allowed personal API-token lifetime.
auth.activity_touch_interval5mMinimum interval between user activity updates.
auth.secure_cookietrue (Docker profiles: false)Sends login cookies only over HTTPS.
auth.session.idle_timeout7dSigns out a session after this inactive period.
auth.session.absolute_timeout30dMaximum session lifetime, even when active.
auth.password.memory_kib19456Memory used when hashing one password.
auth.password.iterations2Password-hashing work passes.
auth.password.parallelism1Password-hashing parallel lanes.
auth.password.max_concurrency2Password hashes calculated at the same time.
auth.login.max_attempts5Failed sign-in attempts allowed in one window.
auth.login.window1mSign-in rate-limit window.
auth.login.capacity10000Maximum sign-in rate-limit entries kept in memory.

Notifications

SettingValueMeaning
notifications.transition_batch_size100Alert changes expanded in one batch.
notifications.due_scan_limit100Due deliveries loaded in one scan.
notifications.poll_interval250msHow often queued notifications are checked.
notifications.queue.capacity1000In-memory notification queue size.
notifications.queue.worker_concurrency8Notification workers running at the same time.
notifications.retry.max_attempts8Maximum delivery attempts.
notifications.retry.initial_delay5sDelay before the first retry.
notifications.retry.max_delay1hMaximum retry delay.
notifications.retry.timeout10sDeadline for one delivery attempt.
notifications.retry.attempt_lease30sTime one worker owns a delivery attempt.
notifications.retention.delivered_days30Days to keep successful delivery records.
notifications.retention.dead_days90Days to keep permanently failed delivery records.
notifications.webhook.maximum_response_bytes64 KiBMaximum webhook response body read by Metric.
notifications.webhook.maximum_retry_after1hMaximum server-requested retry delay.
notifications.webhook.allow_httpfalseAllows unencrypted HTTP webhook targets.
notifications.webhook.allow_private_networksfalseAllows webhook targets on private network addresses.

For a bare binary:

bash
metric-server \
  --config config/metric.example.toml \
  --env-file .env.local \
  --print-effective-config

Secrets are redacted. This command is useful when an environment override does not behave as expected.

Released under the MIT License.