Operations

What running CoverOps looks like after the install: the handful of knobs, what to watch, how to upgrade, and what to do when something is wrong.

Configuration reference (coverops.env)

KeyDefaultMeaning
COVEROPS_REGISTRY160313985872.dkr.ecr.eu-central-1.amazonaws.comwhere the images come from
COVEROPS_VERSIONnonethe release to run; changing it and up -d is an upgrade
COVEROPS_HOSTnonethe dashboard's hostname; in links and the OIDC callback
COVEROPS_API_HOSTemptya second hostname for agents (built-in edge only)
WEB_PORT / API_PORT8080 / 4300where the dashboard and API listen on the host (behind your proxy)
DATABASE_URLbundledan external PostgreSQL; start with --scale postgres=0
DATABASE_CONNECTION_LIMIT / DATABASE_POOL_TIMEOUT10 / 10the API's database connection pool (connections per API process) and how many seconds a query waits for a free connection before it fails. The API adds them to its own connection as connection_limit / pool_timeout; a value already in DATABASE_URL wins. Keep them out of the URL itself: backups hand DATABASE_URL to pg_dump, which refuses those parameters. Without them Prisma sizes the pool from the CPU count it sees (2 × CPUs + 1: 5 on a 2-vCPU host, far more on a large Kubernetes node), too small for a dashboard's parallel requests on a small host and too large for many pods sharing one database. Keep PostgreSQL's max_connections (100 by default) well above the sum over every API process, plus a few for migrations and backups. See Database connections
POSTGRES_PASSWORD, JWT_SECRET, COVEROPS_SECRETS_KEY, BOOTSTRAP_PASSWORDgeneratedthe four secrets; generate-secrets.sh fills them, chmod 600
COVEROPS_SECRETS_KEYgenerated, requiredencrypts the third-party credentials CoverOps stores (git tokens, Xray/TestRail/ReplayOps keys, AI provider keys, webhook URLs and secrets, the OIDC client secret, the reCAPTCHA secret) with AES-256-GCM before they reach the database; at least 32 characters (openssl rand -base64 32). The API will not start in production without it. Losing it means re-entering those credentials, so keep a copy apart from the database backups
COVEROPS_SECRETS_PREVIOUS_KEYSemptyolder values of COVEROPS_SECRETS_KEY, comma-separated, still accepted for reading during a rotation (see Rotating secrets)
BOOTSTRAP_EMAILadmin@coverops.localthe first administrator of an unlicensed trial only; a licensed installation gets its company administrator from the first-run setup and its super admin from the licence
ACCESS_TOKEN_TTL / REFRESH_TOKEN_TTL1h / 30ddashboard session lifetimes
COVERAGEOPS_TRACE_RETENTION_DAYS14raw call frames kept for the session views; the day tables keep the history
COVEROPS_AUDIT_RETENTION_DAYS0 (forever)audit events
COVEROPS_ACCESS_LOG / ACCESS_LOG_DIRstdout / volumethe per-request log and where the file sink writes
MAX_FLUSH_SIZE48mblargest agent request body accepted, counted after gzip is inflated; over it the answer is 413 PAYLOAD_TOO_LARGE, naming the limit. It is also the only cap on a coverage report's LCOV. The agents never send more than 48 MB, so lowering it refuses a large service's reports. source uploads have their own 30 MB
COVEROPS_INGEST_MAX_INFLIGHT_BYTESheap limit / 20large coverage bodies (over 1 MB inflated) the API stores at once, in inflated bytes, per API process; 160mb style or plain bytes, 0 turns the guard off. Storing a report costs ~11–15× its size, so the default (~156 MB under the 3 GB heap below, three 48 MB reports) keeps a burst of large uploads inside the heap. Past it a report waits, then gets 503 INGEST_BUSY with Retry-After and is sent again by the agent on its next cycle; see ingest protocol. GET /health/ingest shows what is held
COVEROPS_INGEST_MAX_WAIT_MS5000how long a large coverage report waits for room before the 503; at most 60000. Keep it well under the agents' timeouts (10–30 s)
API_MEMORY_LIMIT / API_NODE_OPTIONS4g / --max-old-space-size=3072the API container's memory limit and its V8 heap (~75% of the limit; the rest is buffers, code and graphify's child processes). Change them together. At the limit the API stops on its own and restart: unless-stopped brings it back, instead of the kernel killing postgres. On the 4 GB evaluation tier use 2g / --max-old-space-size=1536 (one 48 MB report at a time)
TLS_MODE, TLS_EMAIL, TLS_CERT_DIRautothe built-in edge; see network-dns-tls
BACKUP_EVERY_HOURS, BACKUP_KEEP_DAYS, BACKUP_DIR, RCLONE_CONF, BACKUP_RCLONE_REMOTE24 / 14 / volume / none / nonescheduled backups; see backup-restore
COVEROPS_OAUTH_<PROVIDER>_CLIENT_ID/SECRETempty"Authorise with…" buttons for git hosts (GITHUB, GITLAB, AZURE, BITBUCKET) and "Connect with…" for SLACK and ATLASSIAN; pasted tokens work without them. Callback to register: <API_URL>/v1/connect/<provider>/callback (git hosts: /v1/workspace/git-connections/oauth/<provider>/callback)
COVEROPS_DASHBOARD_URLderivedonly when the dashboard is not api.-less of the API host
COVEROPS_GRAPHIFYonthe structural code map (graphify in the API image), rebuilt when source arrives or a repository is connected; off skips it. COVEROPS_GRAPHIFY_BIN / _DIR override the binary and the graph directory
COVEROPS_LOCAL_REPOSunsetwhich paths on this server a tenant may point a repository or a project's working-copy path at: off refuses every path (set on the hosted compose; a shared server must not let one customer read another's checkout), a directory allows only paths under it, unset allows any git checkout. The code-map directory is never readable this way
COVEROPS_AI_LOCAL_ENDPOINTSunsetwhere the server will send a tenant's model requests: off allows public hosts only (set on the hosted compose; a tenant's base URL must not reach the database, the metadata service or the API's own loopback), unset allows any host, for a single-tenant install whose Ollama runs on localhost. Only http(s), resolved before trusted, redirects never followed
COVEROPS_KPI_DIGEST_HOUR7the UTC hour of the daily KPI digest: one message per project with every KPI and its state, to channels that take everything or list digest; -1 turns it off
COVEROPS_PLATFORM_WEBHOOK / COVEROPS_PLATFORM_EMAILSunsetwhere demo and access requests from the public forms are announced: a Slack or Teams incoming webhook or any JSON URL, and/or comma-separated addresses (super admins are mailed as well when SMTP_URL is set)
COVEROPS_GRAPHIFY_REFRESH_HOURS24a code map that includes remote repositories is rebuilt this often, since a connected repository changes without anybody uploading source; 0 turns the schedule off
COVEROPS_LICENSE / COVEROPS_LICENSE_REQUIREDunset / false (the on-prem kits set true)on-prem: the signed licence that sets the installation's package (tier + add-ons); its limits are the installation's total across every account, self-registered users included. Warned 30 days before expiry, 14 days of grace after it; then, or with no licence or a refused one when REQUIRED is true, new data, sessions and AI calls stop and stored data stays readable. Without a licence and with REQUIRED false (the hosted service) packages are assigned per account in Platform → Packages
CUNDA_USAGE_TOKENunsetopens GET /licence/usage (Bearer token) for the Cunda portal; unset answers 404
CUNDA_SETUP_TOKENunsetopens /licence/setup (Bearer token, 64 hex) for the Cunda installer's first-run setup: licence, company, company administrator; unset answers 404
CUNDA_PORTAL_ADMIN_TOKENunsethosted service only: opens the portal's company and user endpoints (POST /organizations, …/users, contract 2 §5.2); 64 hex and different from CUNDA_PORTAL_TOKEN, otherwise closed
COVEROPS_LLM_PRICESunsetJSON {"model-id": {"input": 3, "output": 15}} (USD per 1M tokens): adds or corrects rows of the model price list the LLM spend is counted with
CUNDA_PORTAL_TOKENunsethosted service only: opens /partner/cunda/v1 for the Cunda portal to assign packages and read usage (cunda-portal-api); 64 hex, otherwise closed; always closed on a licensed installation
COVEROPS_KPI_EVAL_MINUTES15how often KPI targets are judged server-side and breaches sent to Slack/Teams; 0 disables; see api-and-mcp
COVEROPS_RUN_FINISH_GRACE_SECONDS60how long a run stays open after the last of its test-runner sessions finished, for a shard that starts late and the services' last coverage flushes; 0 closes at once, at most 3600; see ingest protocol
COVEROPS_RUN_IDLE_CLOSE_HOURS6a run that has received no data for this many hours (a runner that crashed, a pipeline that never finished it) is closed with what its verdicts say and marked as closed for inactivity; monitoring windows never, the local-YYYYMMDD day run only once its day is over; 0 turns it off, at most 720; see ingest protocol
SMTP_URL, SMTP_FROMemptyoutgoing mail from the deployment; when set it wins and Installation settings shows it locked. Usually left empty: the mail server is entered in the first-run setup or under Installation settings (tested with a message, password stored encrypted)
SES_REGIONemptyoutgoing mail through the Amazon SES API in this region, with the server's own AWS credentials (on EC2 the instance role needs ses:SendEmail on the sending identity), so there is no mail password. SMTP_FROM is the sender and its domain must be verified in SES with DKIM. SMTP_URL wins when both are set
CUNDA_SETUP_MANAGEDemptyinstaller: the Cunda Installer runs the first-run setup through /licence/setup and finishes it with /licence/setup/complete; the browser wizard does not open and the sign-in page says so. Empty: CoverOps' own wizard
CUNDA_INSTALLER_URLemptythe Cunda Installer's address, linked from that sign-in notice

Nothing is read at image build time; change a value and up -d.

Who may create an account. Under Platform → Security the operator chooses between open self-service registration (the on-prem default: the sign-in page creates the account at once) and registration by request, where the form files an access request into Demo requests and the person is told it is being approved; an administrator then adds them. The third choice, approval, lets people register but keeps the account shut until two things are true: its owner has confirmed the email address through a link mailed to it (single use, valid 24 hours, resendable from the sign-in page), and a super administrator has approved it under Platform → Accounts to approve. Super administrators are mailed when an account is confirmed and waiting; the person is mailed when it is approved or declined, and a declined account loses any session it had. Approval needs outgoing mail (SMTP_URL, SMTP_FROM) and cannot be selected without it; set COVEROPS_DASHBOARD_URL so links point at the public address. Single sign-on is held to the same rule for an account registered this way; accounts created by an administrator, SSO or SCIM, and accounts that existed before, are not affected. Registrations, confirmations and decisions are written to the audit trail.

Sign-in protection. Google reCAPTCHA in front of password sign-in and registration is configured from the dashboard, not the environment: a super administrator opens Platform → Security, pastes the site key and secret key created at google.com/recaptcha/admin for the dashboard's domain, picks v2 (checkbox) or v3 (invisible, scored), and turns it on. The API verifies every token with Google before it reads the password and stays shut when Google is unreachable. SSO sign-in is not challenged.

Database connections

Every API process keeps its own pool of PostgreSQL connections. A request that needs the database borrows one, and a request that changes something a package limits (creating a project, giving someone a seat) holds its connection for the whole of a short transaction. When the pool is empty, the next request waits up to DATABASE_POOL_TIMEOUT seconds and then fails with Prisma error P2024 or P2028 ("Unable to start a transaction in the given time"). Those errors in the API log mean the pool is too small for the load, or something is holding connections for too long.

  • Size. DATABASE_CONNECTION_LIMIT = 10 suits a 2–4 vCPU host. Raise it to 15–20 on 8 vCPU or with heavy ingest. Each connection costs PostgreSQL about 10 MB.
  • Several API processes (Kubernetes replicas, a second API node): the limit is per process. Replicas × limit, plus about 5, must stay below the database's max_connections.
  • Changing it is up -d (Compose) or a helm upgrade with api.env.DATABASE_CONNECTION_LIMIT / api.env.DATABASE_POOL_TIMEOUT. Nothing is migrated.

Health and what to monitor

SignalWhereAlert when
GET /health on the APIhttps://<host>/health on the address that serves the API → {"status":"ok","version":"…"}; the kit's Caddy, the Helm Ingress and the OpenShift Routes send /health there. Behind your own proxy, route /health to the API too (the dashboard answers it with 404), or check http://<api-host>:4300/health directlynot 200 for 2 minutes
Migration containerdocker compose ps migrate exited 0non-zero after an upgrade (the API will not start, by design)
Disk on the data volumehost> 80 %; raise the disk, not the retention
Postgres connections / sizeprovider metrics or pg_stat_databasegrowth without a traffic change: check call_frames and the roll-up log
Roll-upAPI log lines [traces] rolled up N frame(s), retired M every 2 minutesabsent for 15 minutes while agents report
AgentsAgents page: fleet with last-seen and version; Agents → Trace sampling: watched share per servicea service silent for longer than its flush interval; a route never sampled for a week
Sign-in troubleaudit log: auth.login.failed bursts, auth.login.throttled, auth.sso.login.failedmore than a handful an hour outside a test
Backupsdocker compose logs backup: [backup] wrote … and off-host copy doneno line in BACKUP_EVERY_HOURS + 1 h

Container logs are the operational log; the access log is on the same stream when COVEROPS_ACCESS_LOG=stdout. Collect both.

Capacity and retention

Disk grows with traced traffic, not with people. The order of things to do when it grows faster than planned:

  1. Check Agents → Trace sampling: a service tracing every request (COVERAGEOPS_TRACE_SAMPLE_EVERY=1 on a busy service) is usually the cause; raise it, or rely on the default route-aware sampler.
  2. Confirm the roll-up is running (log lines above). Raw frames are retired after COVERAGEOPS_TRACE_RETENTION_DAYS; the counts live on.
  3. Only then shorten a retention value, and remember the session views reach back exactly that far.

Postgres housekeeping is autovacuum's; on a self-run instance make sure it is on (it is by default). Reindex is not needed.

Upgrading

./backup.sh                                              # always
sed -i 's/^COVEROPS_VERSION=.*/COVEROPS_VERSION=0.3.0/' coverops.env
docker compose --env-file coverops.env pull               # or import the new bundle
docker compose --env-file coverops.env up -d              # migration runs; API waits for it
./doctor.sh

Compose will not start the API until migrate has exited successfully, so a failed migration stops the upgrade rather than leaving a new API on an old schema. Agents are additive: older agents keep reporting to a newer server; upgrade them from the dashboard when you want their newer features. Read the release notes for the rare migration that is not reversible; those are marked.

Rolling back: set the previous version and up -d. If the new version ran a migration, restore the backup you took first (./restore.sh ./backups/<stamp> --force).

Upgrading to the first version that encrypts stored credentials. It needs COVEROPS_SECRETS_KEY: run ./generate-secrets.sh once more before up -d (it adds the missing key and leaves the others alone). Credentials saved before the upgrade keep working as they are and are encrypted the next time they are saved; to encrypt them all at once:

docker compose --env-file coverops.env exec api node scripts/reseal-secrets.mjs --check   # what is still plaintext
docker compose --env-file coverops.env exec api node scripts/reseal-secrets.mjs           # encrypt it

The API also says it in its log at start-up when any are left. Rolling back past this version after the reseal leaves the older API unable to read the encrypted credentials; restore the pre-upgrade backup instead.

Rehearse in staging: a second compose directory with its own env file and ports, restored from a production backup, is a complete staging environment in fifteen minutes and the right place to see an upgrade before production.

Moving hosts

Backup on the old host → install the same version on the new → restore.sh → switch DNS → doctor.sh. Agents follow the DNS name; nothing on their side changes. Keep the old host until the first new backup has landed off-host.

Rotating secrets

SecretHowEffect
JWT_SECRETnew value in env, up -d api webeveryone signs in again; agent tokens unaffected
COVEROPS_SECRETS_KEYmove the current value to COVEROPS_SECRETS_PREVIOUS_KEYS, put a new one in COVEROPS_SECRETS_KEY, up -d api, then exec api node scripts/reseal-secrets.mjs; once it reports every credential under the current key, remove the previous key and up -d api againnone for users; new saves use the new key at once, old rows open with the previous one until resealed
Database passwordchange at the database, then in env, up -da few seconds of 500s
Agent tokensAgents page → rotatethe old token stops; update the service's configuration
SCIM tokenTeam → SSO → mint a new onethe old stops at once; update the IdP
OIDC client secretat the IdP, then Team → SSOimmediate
TLS certificate (files)replace the files, restart caddyimmediate

When something is wrong

Run ./doctor.sh first; it names most of these.

SymptomCauseFix
Dashboard loads, every screen emptyweb cannot reach api server-sideCOVERAGEOPS_API=http://api:4300 (the compose name)
Live feed says "Connection lost", numbers still movea proxy buffering /v1/proxy_buffering off, long read timeout
Agent reports coverage but no call chainstracing off in the agentCOVERAGEOPS_TRACE=true / -Dcoverageops.trace=true
Agent silent, its log says certificate / PKIX / verify failedcorporate CA not trusted by the runtimethe per-runtime line in network-dns-tls
"Download agent" returns 404an image built without its agent packagesreport the version; the release script refuses to push such a build
Coverage arrives, code view emptydeployed artefact ships no source (normal for JVM/.NET)connect the repository read-only, or tools/upload-source.mjs from the build
API will not start after an upgrademigration faileddocker compose logs migrate; restore and retry, or send us the log
429 on sign-inten failed attempts from that addresswait Retry-After; check the audit log for who
SSO callback error statecookie blocked between /start and /callbackthe dashboard and API must be the same site (one host, or api. under the same parent domain); check SameSite handling at the proxy
Everyone signed out at onceJWT_SECRET changed or the host clock jumpedexpected after rotation; otherwise fix NTP
API exits with COVEROPS_SECRETS_KEY must be set in productionan env file from before credential encryption./generate-secrets.sh, then up -d
Log says no configured key opens … stored credential row(s); a connection shows no tokenCOVEROPS_SECRETS_KEY replaced without keeping the old value in COVEROPS_SECRETS_PREVIOUS_KEYS, or a restore onto a host with a different keyput the old key back in COVEROPS_SECRETS_PREVIOUS_KEYS; reseal-secrets.mjs --check lists the rows. Without the old key, re-enter those credentials

Getting help

Send us the output of ./doctor.sh, docker compose logs --since 1h api migrate (the access log in it names no secrets), and the version. A coverops.env is never needed and should never be sent.