> ## Documentation Index
> Fetch the complete documentation index at: https://docs.struct.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Query and explore telemetry

> Use bounded queries and record details to investigate real application behavior.

Query traces, logs and metrics from your workspace, then read the details behind an interesting result.

## Find the service and its fields

Use CLI 5.0.0 or newer for query and record-detail commands. See [installation and availability](https://docs.struct.ai/reference/cli.md).

```bash theme={null}
struct whoami --json
struct telemetry services --since 1h --json
struct telemetry describe traces --service checkout-api --json
```

Use the returned service name, field names and the signal that answers the question. No records in a window does not mean the application is healthy.

## Run a bounded query

Queries are JSON documents in Struct's [query language](https://docs.struct.ai/observability/query-language.md):

```bash theme={null}
struct telemetry query --json --document '{"kind": "query", "range": {"last": "1h"}, "result": "raw", "queries": [{"name": "spans", "signal": "traces", "filter": "service.name = '"'"'checkout-api'"'"'", "select": ["timestamp", "span.name", "trace_id", "span_id", "duration"], "limit": 20}]}'
```

Replace the example service. Use `--file query.json` for longer documents, which avoids shell quoting. An invalid document exits 1 with `query_invalid` and says how to fix it. Do not fetch broad telemetry dumps when a small sample answers the question.

## Read the matching record

```bash theme={null}
struct telemetry span TRACE_ID SPAN_ID --json
struct telemetry log ROW_ID --json
```

Each runs a `raw` query with `"select": ["*"]` and returns every stored column of the row. Use the trace and span IDs from a traces query for `telemetry span`. For `telemetry log`, use the `id` of a raw `logs` row:

```bash theme={null}
struct telemetry query --json --document '{"kind": "query", "range": {"last": "1h"}, "result": "raw", "queries": [{"name": "logs", "signal": "logs", "filter": "service.name = '"'"'checkout-api'"'"'", "select": ["trace_id", "span_id", "severity_text"], "limit": 20}]}'
```

`span` looks back 24 hours and `log` 1 hour; pass `--since` (at most 30 days) for an older span, and `--at TIMESTAMP` with the log row's `timestamp` for an older log row. A log lookup by `id` reads every log in that window, so keep it to a few hours. A span's logs are a separate raw `logs` query filtered by its `trace_id` and `span_id`. `telemetry log` takes a row id since CLI 6.0.0.

The [MCP telemetry tools](https://docs.struct.ai/mcp/tools/telemetry.md) provide the same investigation path to an MCP client. Inspect their discovered schemas for supported arguments.

## Limits

Each workspace's telemetry queries from the CLI, the API and MCP share these limits, on every plan:

| Limit | Default | When it is reached |
| - | - | - |
| Queries | 300 a minute. They can be spent at once, and come back at 5 a second. | HTTP 429 with `Retry-After`. The CLI exits 1 with `telemetry_query_rate_limited` and `retryAfterSeconds` in its JSON error; an MCP tool returns an error that says when to retry. |
| Data read | 200 GB or 50 billion rows an hour (UTC clock hours), counted from what each query read. | The same refusals, until the next hour starts. A narrower time range, filter or service reads less. |
| One query | Each of its reads may run 30 seconds and read 10 GB. | That query returns an `error`. Narrow it. |

Successful (`200`) answers from the API's telemetry query, describe and services routes carry `X-RateLimit-Limit`, `X-RateLimit-Period`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` and `X-RateLimit-Name`, and a `429` from a query limit carries the limit that refused it. After a refusal, wait the `Retry-After` seconds before you run the query again; never retry in a loop. Struct's own agents working for your workspace have their own limits, and monitors are never limited. To raise your workspace's limits, contact Struct.

## Check and report

Inspect errors and truncated results. Verify the time window, service and returned timestamps. A paused unclaimed workspace needs [claim](https://docs.struct.ai/reference/cli-auth.md#claim-and-resume) before queries resume. Keep sensitive record contents out of a public report; cite only the evidence needed to support the conclusion.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.