Upstash
Connect
Connect Upstash from the terminal. Pass --help for the flags Upstash accepts, plus --no-browser for headless environments.
polylane cloud connect --provider upstashThe email of your Upstash account and a Developer API key from the Upstash Console.
Connect one Upstash account with its email and a Developer API key. Polylane encrypts the key before it stores it, and the agent never sees it.
- In the Upstash Console, open Account → Management API and choose Create API Key.
- Copy the key.
- In Polylane, enter the email that you sign in to Upstash with, and paste the key.
- Polylane checks the key and starts the first sync.
A key reads the resources of the account that owns it. To connect the resources of an Upstash team, create a key while that team is selected, and connect it as a separate account.
Connect Upstash from a CI job or any other environment without a browser.
You can connect Upstash without a browser. A CI job can call the same endpoint that the console calls. One authenticated POST creates the connection and starts the first sync.
Prerequisites
- A Polylane API key with the
cloud_accounts:writeandcloud_accounts:readscopes. See API keys and OAuth. - Your workspace ID, which starts with
ws_. Read it fromGET /v1/workspaceswith the same key. - The email of your Upstash account and a Developer API key, created under Account → Management API in the Upstash Console.
Create the connection
curl -X POST https://api.polylane.com/v1/cloud_accounts \
-H "x-api-key: $POLYLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "upstash",
"workspaceId": "ws_0abc123",
"email": "you@example.com",
"token": "<upstash-api-key>"
}'
One call connects one Upstash account.
The response lists the connected accounts, and the first sync is already running. This example shows only the two fields that the next steps read:
{
"success": true,
"result": {
"provider": "upstash",
"accounts": [{ "id": "acc_34gky74ibc92h8t2efn8csrh", "status": "syncing" }],
"failures": []
}
}
An account that is already connected goes into failures, not accounts. A repeated call never makes a second connection.
Wait for the first sync
Poll each returned account by its id until status is ready. The status is new at registration and syncing while resources arrive:
until [ "$(curl -s "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY" | jq -r '.result.status')" = "ready" ]; do
sleep 15
done
Give the loop a deadline, so that a failed connection fails the job and does not stop it indefinitely. When the account is ready, its resources are in the topology and Polylane has started its first check.
Disconnect from the API
Deleting the connection stops every sync and check and deletes the credentials that Polylane held. The call needs the cloud_accounts:delete scope:
curl -X DELETE "https://api.polylane.com/v1/cloud_accounts/$WORKSPACE_ID/$ACCOUNT_ID" \
-H "x-api-key: $POLYLANE_API_KEY"
Then delete the Upstash API key, as the Disconnecting section tells.
How it works
Access
Polylane only reads from Upstash. The API key reaches the Upstash Developer API. When a read needs the read-only token of a database, an index or a QStash region, Polylane gets the token from the Developer API at that time and does not store it. The Developer API also returns passwords and tokens in its listings, so Polylane removes them before it stores anything.
Infrastructure graph
Polylane syncs the account every 15 minutes. It maps Redis databases, Vector indexes, Search indexes, and each QStash region with its schedules, queues and URL groups. A QStash region contains its schedules, queues and URL groups. A schedule links to its queue or URL group, and to the service that its destination URL points at.
A service elsewhere in your stack that connects to an Upstash endpoint, for example through UPSTASH_REDIS_REST_URL, links to that database or index on the topology. Upstash has no environments, so every resource is production.
Metrics and logs
Each Redis database charts latency, throughput, connections and keys. Each Vector and Search index charts its query and update traffic. Each QStash region charts its daily delivered requests and Workflow runs. QStash delivery logs are the only Upstash log source, so QStash regions, schedules, queues and URL groups show logs. Polylane leaves out message headers, bodies and URL query strings. Upstash has no traces API.
Checks
By default, Polylane runs these checks every 30 minutes:
- Redis p99 latency of the slowest active database, compared with the history of the account.
- Redis throughput across active databases, compared with the history of the account.
- Redis storage against the disk limit of the database. A breach adds a capacity warning to the check run and does not open an issue alone.
- New messages in the QStash dead-letter queue of each region since the previous run.
Investigations
During an investigation, agents use read-only tools for Redis, Vector, Search, QStash and Workflow. The section "What agents read" lists each tool.
What agents read
| Tool | What it reads |
|---|---|
upstashApi | GET requests to the Upstash Developer API, such as database stats and audit logs. Polylane removes credentials from the response. |
upstashRedisCommand | One read command on a Redis database with its read-only token, such as DBSIZE, SCAN, TTL or MEMORY USAGE. Upstash refuses every write with this token. |
upstashQStashApi | GET requests to QStash with the read-only token of the region: schedules, queues, URL groups, the dead-letter queue, logs and flow control. Polylane refuses requests for signing keys. |
upstashVectorIndex | Info, namespaces, stored vector IDs and metadata, and nearest-neighbor queries on a Vector index, with its read-only token. |
upstashSearchIndex | Info, index names, stored document IDs and search queries on a Search database, with its read-only token. A search counts against your query quota. |
upstashQStashLogs | QStash delivery logs: each state change of each message, with the response status and error of the destination. Message headers and bodies are not included. |
upstashQStashDeadLetters | Messages in the QStash dead-letter queue. Polylane removes credential headers. |
upstashQStashResources | QStash schedules, queues, URL groups and flow-control keys. Forwarded headers and bodies are not included. |
upstashWorkflowRuns | Upstash Workflow runs, their steps, and failed runs. Polylane removes credential headers. |
Troubleshooting
"Upstash does not recognize this email and API key" error
- Use the email that you sign in to Upstash with, not a team name.
- Make sure that you copied the full key and that it is not deleted under Account → Management API.
"This Upstash API key cannot read the account's databases" error
- Create a new key under Account → Management API in the Upstash Console.
Missing resources
- The first sync can take a few minutes.
- Click Sync in the account header to start a sync immediately.
Disconnecting
Disconnecting stops every sync and check, and deletes the key that Polylane stored. The API key stays valid in Upstash. Delete it under Account → Management API in the Upstash Console.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what Upstash's API lets it remove. The following stays until you remove it yourself:
- Upstash Developer API key
polylane cloud disconnect <id>Tools
9Operations agents can perform in threads.
Supported resources
7Resource types that show up in your infrastructure graph.