Troubleshooting
SDK Disabled in Production
Section titled “SDK Disabled in Production”Symptom
Section titled “Symptom”No traces appear after deploying to production, even though traces work in local development.
The Glasstrace SDK includes a production guard that disables itself when NODE_ENV === 'production' or VERCEL_ENV === 'production'. This prevents accidental trace capture in production environments.
This is expected behavior. The SDK is designed for development and staging environments only.
If you are running a local production build (e.g., next build && next start) and want traces, set the force-enable flag:
GLASSTRACE_FORCE_ENABLE=true next startDo not set GLASSTRACE_FORCE_ENABLE=true in actual production deployments. The production guard exists to protect your application’s performance and your trace budget.
See Configuration for all environment variables.
Rate Limited
Section titled “Rate Limited”Symptom
Section titled “Symptom”The ingestion API returns 429 Too Many Requests.
Your application is sending more traces per minute than your tier allows.
Rate limits by tier:
| Tier | Traces per minute |
|---|---|
| Anonymous | 100 |
| Free Trial | 500 |
| Pro | 2,000 |
- Check which tier your account is on in the dashboard.
- Reduce trace volume by adjusting capture settings or sampling.
- Upgrade your tier if you need higher throughput.
The rate limit response uses the standard error shape and includes a Retry-After header:
{ "code": "rate_limited", "message": "Rate limit exceeded. Limit: 100 requests per minute", "retryable": true, "requestId": "<request-id>"}The Retry-After header (in seconds) indicates how long to wait before retrying. The response also includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers.
Anonymous Traces Disappeared
Section titled “Anonymous Traces Disappeared”Symptom
Section titled “Symptom”MCP tools return no traces or empty results after using Glasstrace anonymously for more than 48 hours.
Anonymous traces have a 48-hour storage TTL. Traces older than 48 hours are automatically deleted. The anonymous key itself does not expire — only the traces stored under it.
Storage TTL by tier:
| Tier | Storage TTL |
|---|---|
| Anonymous | 48 hours |
| Free Trial | 7 days |
| Pro | 90 days |
This is expected behavior for anonymous mode. To retain traces longer, sign up for an account:
- Free Trial: 7-day TTL (30-day trial, credit card required at signup)
- Pro: 90-day TTL
See Auth & Keys for details on the signup and claim flow.
enrichment_pending Status
Section titled “enrichment_pending Status”Symptom
Section titled “Symptom”The get_root_cause MCP tool returns status: "pending" instead of enrichment results.
LLM enrichment runs asynchronously via Upstash Workflow. After a trace is captured, enrichment is queued and processed in the background. The pending status means enrichment has not completed yet.
Wait 5-30 seconds and retry the get_root_cause call.
The get_root_cause response uses these status values:
| Status | Meaning |
|---|---|
"completed" | Enrichment finished. Results available. |
"pending" | Enrichment in progress or queued. Retry shortly. |
"failed" | Enrichment encountered an error. |
"unavailable" | Enrichment not attempted (anonymous tier or enrichment disabled). |
If the status stays "pending" for more than 60 seconds:
- Verify your account is active and not lapsed.
- Verify enrichment is enabled for your tier (
enrichmentEnabledistruefor Free Trial and Pro tiers,falsefor Anonymous). - Check the MCP Server docs for additional diagnostics.
No Traces Found
Section titled “No Traces Found”Symptom
Section titled “Symptom”MCP tools return empty results even though you expect traces to be present.
This can happen for several reasons:
- The SDK is not initialized in your application.
- The
GLASSTRACE_ENVvariable is set to a different environment than expected. - Traces have expired based on your tier’s storage TTL.
- Verify
registerGlasstrace()is called in yourinstrumentation.tsfile:
import { registerGlasstrace } from "@glasstrace/sdk";
export function register() { registerGlasstrace();}- If you set
GLASSTRACE_ENV, verify it matches the environment you are querying:
echo $GLASSTRACE_ENV- Check your tier’s storage TTL — traces may have expired:
- Anonymous: 48 hours
- Free Trial: 7 days
- Pro: 90 days
See SDK Reference for initialization details.
Source Maps Unavailable
Section titled “Source Maps Unavailable”Symptom
Section titled “Symptom”Stack traces in MCP tool responses show minified or compiled JavaScript instead of your TypeScript source.
Anonymous mode does not upload source maps. Without an API key, the SDK skips source map upload during builds.
- Set the
GLASSTRACE_API_KEYenvironment variable:
export GLASSTRACE_API_KEY=<your-api-key>- Wrap your Next.js config with
withGlasstraceConfig():
import { withGlasstraceConfig } from "@glasstrace/sdk";
export default withGlasstraceConfig({ // your Next.js config});- Run
next build— source maps will be uploaded automatically.
See Configuration for build integration details.
MCP Connection Failures
Section titled “MCP Connection Failures”Symptom
Section titled “Symptom”Your AI agent cannot connect to the Glasstrace MCP server.
- Wrong endpoint URL in the MCP configuration.
- Missing or malformed Bearer token.
- Network connectivity issue.
-
Verify the endpoint is
https://api.glasstrace.dev/mcp. -
Verify the Bearer token is set. The token is either your API key (
GLASSTRACE_API_KEY) or the auto-generated anonymous key from.glasstrace/anon_key. -
Test connectivity with curl:
curl -X POST https://api.glasstrace.dev/mcp \ -H "Authorization: Bearer <your-token>" \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'A successful response returns a JSON-RPC result with the available tools list. If you get a connection error, check your network and firewall settings.
See MCP Server for full configuration instructions.
Auth Failures (401/403)
Section titled “Auth Failures (401/403)”Symptom
Section titled “Symptom”The API returns 401 Unauthorized or 403 Forbidden.
Several conditions can trigger auth failures:
- 401 Unauthorized: Invalid, expired, or revoked API key.
- 403 Forbidden: Subscription expired or inactive, or wrong credential type for the endpoint (e.g., using an anonymous key on an endpoint that requires a development API key).
- Verify the key format matches the expected prefix:
| Key type | Prefix | How obtained |
|---|---|---|
| Anonymous | gt_anon_xxx | Auto-generated by SDK on first run |
| Development API key | gt_dev_xxx | Created via dashboard after signup |
- If you receive a
403, check whether your subscription is active. A lapsed subscription returns:
{ "code": "subscription_expired", "message": "Subscription expired or inactive", "retryable": false, "requestId": "<request-id>"}- If you receive a
401, verify the key has not been revoked and regenerate it from the dashboard if needed:
{ "code": "invalid_key", "message": "Invalid or expired authentication credentials", "retryable": false, "requestId": "<request-id>"}See Auth & Keys for key management details.
Import Graph Not Captured
Section titled “Import Graph Not Captured”Symptom
Section titled “Symptom”The get_test_suggestions MCP tool returns an empty coverage map (Part 1 returns no data).
Import graph capture is opt-in. It is controlled by the CaptureConfig.importGraph setting, which defaults to false.
-
Enable import graph capture in the dashboard capture settings.
-
Verify your tier supports the coverage map feature:
| Tier | coverageMapEnabled |
|---|---|
| Anonymous | false |
| Free Trial | true |
| Pro | true |
Coverage map requires coverageMapEnabled, which is available on Free Trial and Pro tiers (not Anonymous).
After enabling, run a new build to capture the import graph. The get_test_suggestions tool will include coverage data on the next query.
Still Stuck?
Section titled “Still Stuck?”If none of the above solutions resolve your issue, your AI agent can call get_latest_error to retrieve the most recent error trace for additional context. You can also check the SDK Reference and MCP Server docs for detailed API documentation.