palbaseDocs

Palbase Flags · API

GET/flags/evaluations

Read the reads and evaluations

How often the project's client apps read its flags, and the value each flag's answers carried, per hour or per UTC day over a window: what the project's charts draw.

An evaluation is a flag's value carried in an answer to a client app: each flag of a snapshot or a values read answered 200, and each flag a delta answered 200 leaves its client holding (the key's last op, when it is a put). Values are resolved on the server, so this is what was served; a client reusing a value it holds is not seen. A snapshot or a delta answered 304, a delta answered 410, and the project's server reading a user's values (GET /flags/users/{user_id}) carry none.

Every number is a counter, summed over the module's replicas; none is a gauge. A bucket nothing was counted in is absent from reads and from a flag's rows: it is zero. Buckets start on the hour or at midnight UTC; the first is the one the window starts in (since_ms).

With flag, that flag's evaluations per bucket and value. A value is the served value's JSON as it is kept (true, "dark", {"plan": "pro"}); one longer than 128 bytes is cut, and … and 8 hex characters of its SHA-256 follow the cut. A bucket counts its first 10 values by name and any further one as other, which no JSON text is; an answer names at most 10 per bucket, the most evaluated. Without flag, the 20 flags evaluated most over the window, each with its total per bucket.

Counts are written every minute: the last one may not be in yet, and a replica that stops without its last write loses at most that minute. Kept: hourly evaluations 15 days, daily evaluations and the hourly reads 91 — bucket=hour reads up to 14 days back, bucket=day up to 90.

Called by your server, with the project's secret key.

Query

window_secondsinteger · optionalHow far back: 1 to 7776000 (90 days), at most 1209600 (14 days) with bucket=hour (86400).
bucket"hour" | "day" · optionalhour, or day (UTC) (hour).
flagstring · optionalA flag's key: its evaluations by value. Without it, the 20 flags evaluated most, with their totals.
curl
curl -X GET "https://<your-ref>.palbase.studio/flags/evaluations" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

200The counts

400The request is malformed, or a definition or a value breaks a flag's rules (the error names which)

401No key, or not a key of this project, or a token that is not valid (the edge's answer)

403Not the project's secret key

429The project's request rate, or its flag reads for the period under its quota, are used up; Retry-After says when to try again

503The platform could not answer now; retrying is safe (Retry-After)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation GetEvaluations of flags's contract.