Metrics
All pages
Docs · OrganizationsMarkdown

Limits and fair use

These are the limits the Metrics API and its clients enforce. The API has no request rate limit or storage quota today. It rejects a value over a limit with an error that names the limit, and never truncates it. Metrics is free to use under fair use; there are no paid plans, and for more than this page allows, email info@041.io.

Requests

whatlimit
envelopes per request to /api/v2/events or /api/v2/experiments/{experimentId}/events1 to 1,000
envelopes per request to /api/v2/query/seriesexactly 1
request bodyat most 8 MiB of JSON, after gzip decoding; a larger one is a 413
messageId, correlationId1 to 200 characters
messageId in one experiment batchunique; a duplicate rejects the whole request with 400
tokenRevoke in a batchmust be the last event
query.experiments, query.revisionsat most 500 experimentIds, and the only event in its request

A batch is not a transaction: events run in order and each one succeeds or fails on its own. See HTTP API.

Experiments and folders

whatlimit
experiment slug1 to 200 characters, unique in the organization
experiment display name1 to 200 characters after trimming; null clears it
experiment descriptionat most 4,000 characters
experiment metaany JSON object
experiment.error message1 to 8,000 characters
folder name1 to 200 characters, not blank, no /, unique among its siblings
folder nestingat most 100 levels below a root folder

Saved views

whatlimit
view name1 to 200 characters after trimming, unique in the organization
view statea JSON object of at most 65,536 UTF-8 bytes as compact JSON

A name another view already has is refused with view_already_exists. The app and the command line write the workspace state; the API stores any JSON object within the limit.

Metrics

whatlimit
metric nameprintable ASCII, 1 to 256 bytes, and at most 512 bytes once percent-encoded
metricValuea finite number; NaN and infinity are rejected
stepan integer from 0 to 2^53 − 2
timestampMsan integer from 0 to 2^53 − 1
metadata keys per pointat most 32
metadata keyat most 128 UTF-8 bytes
metadata valuea string of at most 512 UTF-8 bytes
metadata, as canonical JSONat most 4,096 UTF-8 bytes
distinct metadata maps per metric in one experiment4,096

Every distinct metadata map is its own line on a chart. A write that would give a metric a 4,097th map fails with a 409 event error; writes that use only existing maps keep succeeding. Keep metadata to bounded categories such as split or rank; see What to log.

When an experiment's write buffer holds 8 MiB not yet flushed to long-term storage, its metric writes get a retryable 503 event error, with retryAfterMs, until flushing frees space. See Series storage.

Annotations

whatlimit
annotation text1 to 16,000 characters
annotation metadataat most 65,536 UTF-8 bytes of compact JSON
query.annotationsreturns at most 100,000 annotations, without pagination

Store larger records as artifacts and put their paths or URLs in the metadata.

Reading series

whatlimit
query.seriesone series per request
query.experimentseries seriesNamesat most 1,000; omit it to read every series
filter predicatesat most 32
filter metadataKeyat most 128 UTF-8 bytes
filter metadataValueat most 512 UTF-8 bytes
orderascending by step or timestamp

The API sets no cap on the points one read returns. The API has no slicing, descending order or aggregation; see API events.

Credentials

whatlimit
experiment token lifetime24 hours from experiment.open or experiment.tokenRefresh
old token after a refreshvalid for at most 30 more seconds
refreshing a tokenneeds the organization key and a token that is neither expired nor revoked
a revoked organization API keycan keep working for up to 60 seconds

The collector refreshes its tokens five minutes before they expire, so a run longer than a day keeps working. See Organizations and keys.

The collector

These are the defaults of o41-metrics-collector, not API limits, except where the API sets the ceiling.

settingdefaultrange or behavior
max_queue_items100,000at capacity the oldest metric (else annotation) is dropped and counted
max_batch_items1,0001 to 1,000, the API's batch ceiling
flush_delay_seconds60how long the oldest queued metric waits for a full request
request_timeout_seconds10.0per request
opening an experimentwaits up to 120 seconds
flushing at process exitup to 30 seconds

The collector checks metric and annotation limits when you call metric() or annotation() and raises ValueError there, so an invalid event never reaches the queue. It shortens an exception message to fit the 8,000-character error limit. See the collector.

Charts from the command line

o41-metrics renders PNG charts through a renderer with its own limits.

whatlimit
lines1 to 32
x positionsat most 10,000
lines × x positionsat most 50,000
width320 to 2,400 px, default 1,200
height240 to 1,600 px, default 720
subplotsat least 76 px of height per panel
titleat most 200 characters

See Command line.

Fair use and pricing

Metrics is free to use under fair use. There are no paid plans today.

If you need more than this page allows (higher limits, retention guarantees, an on-prem or dedicated deployment, or anything Metrics does not do yet), email info@041.io.