Skip to content

API providers

Some of what your product depends on runs at a provider you call, not in your cloud: a blockchain RPC provider or a MongoDB Atlas database. Korai can read those providers through their own API, with a read-only key, and keep their figures next to your telemetry. You connect providers in Settings › Integrations (see Integrations); their dashboards and suggested monitors are in Observability › Telemetry › API providers. Cloudflare, the CDN in front of your sites, is not an API you call: it has its own section, Observability › Edge.

API providers: each connected provider, how its reads go, and the suggested monitors

  1. In Settings › Integrations, press Add provider and choose it:
    • QuickNode: an Admin API key (Dashboard › API Keys), read access is enough. Korai reads requests per method, answers per HTTP status and p95 latency per minute for each endpoint, and the credits used per hour.
    • dRPC: a Statistics API token (Dashboard › Settings › Statistics API, created by the account owner). Korai reads requests and compute units per key, network and method each hour, and the account balance.
    • Cloudflare is connected here too, and shown in Observability › Edge: see Connect Cloudflare.
    • MongoDB Atlas: a service account with the Project Read Only role (see MongoDB Atlas below), pasted as client_id:client_secret. Korai reads the health of each cluster every minute.
  2. Paste the key and press Test and add. Korai tests it by listing the endpoints, keys or zones it reaches; a refused key is not kept. The key is write-only: Korai never shows it again, only its last four characters.
  3. Choose what to read and the environment of each endpoint, key or zone (prod, qa…). Korai suggests one from the names the provider uses. The environment becomes the deployment_environment label of the figures, so the environment selector at the top of Korai filters them as well.

Korai reads each provider every few minutes. QuickNode’s minutes arrive about ten minutes late, and hourly figures once the hour has closed, as the providers publish them. Read now asks for a read in the next few minutes.

What each provider does not give is said on its card: dRPC’s statistics have no errors, HTTP status or latency and are hourly totals; QuickNode’s JSON-RPC error codes and request logs need its Enterprise plan.

Once the first figures arrive, Open dashboard opens the built-in RPC providers dashboard (also in Observability › Dashboards): requests per minute, the share of server errors (5xx) and of rate-limited calls (429), the worst p95 latency, traffic by endpoint, status and method, credits and compute units per hour, and the balance. The 5xx and 429 shares count every request in the chosen range, and the per-minute charts show one point a minute, so a short burst of errors shows as long as it lasted. It can be filtered by provider, environment and endpoint, and cloned to make your own. Panels for figures your providers do not give are left out.

Atlas is a managed database: there is no host to point a collector at, so Korai reads the Atlas Administration API with a read-only service account and shows the result in Observability › Infrastructure › Datastores › MongoDB, next to self-managed MongoDB and the calls your services make to it. There is no separate Atlas menu.

The Add provider form shows these steps too, with a link to Atlas.

  1. In your organization, open Access Manager › Applications › Service Accounts and create one with the Organization Member role. Copy the client id and the client secret (Atlas shows the secret only once) and note the expiry you chose: when it expires, create a new secret and update the key in Korai.
  2. In each project to watch, add the service account with the Project Read Only role, and nothing else. Korai only reads.
  3. If your organization has Require IP Access List for the Atlas Administration API turned on, add Korai’s outbound addresses to the service account’s access list. Ask Korai support for them.
  4. In Korai, add MongoDB Atlas and paste client_id:client_secret. Then press Clusters to choose the clusters and the environment of each one (Korai suggests one from the cluster and project names).

Korai trades the service account for a one-hour token and keeps the token in memory only. Every three minutes it reads, for each member (mongod process) of the chosen clusters, one point a minute of:

  • connections and operations per second (query, insert, update, delete, getmore, command);
  • query targeting: documents scanned per document returned. A value in the thousands means a query without a good index;
  • read, write and command execution time, and the replication lag of each secondary;
  • CPU, memory, WiredTiger cache fill and network;
  • disk space used, IOPS and latency of each partition.

The MongoDB page then shows one row per cluster (connections and operations added over its members, the worst member for the rest), one row per member with its role (primary or secondary), and charts of operations and connections by cluster. The figures arrive about three minutes late. Shared and Flex clusters (M0, Flex) have no process metrics in the Atlas API, so Korai lists them as not read. Slow queries, Atlas logs, Atlas spend and security checks of your Atlas projects are not read yet.

Under the providers, Suggested monitors lists the alerts that fit what you read, each created with one click as an ordinary monitor you can edit, mute and send to your channels in Observability › Reliability › Monitors:

Monitor Fires when
Server errors over 1 % of answers are 5xx (critical at 5 %)
Rate limited over 2 % of calls get a 429 (critical at 10 %): the plan’s rate is short for the traffic
p95 latency the slowest endpoint’s p95 is over 500 ms (critical at 1 s)
No requests no calls in 20 minutes, or Korai stops receiving the figures
Credits per hour QuickNode credits in an hour go over the budget you type
Compute units per hour dRPC compute units in an hour go over the budget you type
Balance the dRPC balance goes under the minimum you type
Atlas replication lag the most delayed secondary is over 10 s behind (critical at 60 s)
Atlas query targeting a member scans over 1,000 documents per document returned (critical at 10,000)
Atlas CPU the busiest member’s CPU is over 80 % (critical at 95 %)
Atlas disk used a data partition is over 80 % full (critical at 90 %)

The providers’ APIs do not give the plan’s quota, so there is no forecast of when the credits run out: the hourly budget and the balance minimum are the figures you set.

Admins connect, change and remove providers (they hand Korai a credential). Operators create the suggested monitors. Everyone can see the providers and the dashboard. Removing a provider deletes its key; the figures already read stay.