> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/query-ingestion-measurements.md).

# Query Ingestion Measurements

Query accepted and dropped ingestion counts and bytes by signal and pipeline stage.

Use ingestion measurements to inspect accepted and dropped data volumes by workload, namespace, source, and other dimensions.

### Endpoints

| Operation                     | Endpoint                                                  |
| ----------------------------- | --------------------------------------------------------- |
| Search ingestion measurements | **POST** `/api/ingestion-measurements/search`             |
| Query a time series           | **POST** `/api/ingestion-measurements/search-time-series` |

### Authentication

Send an [API key](https://docs.groundcover.com/administer/api-keys.md) in `Authorization: Bearer <YOUR_API_KEY>` and select the backend with `X-Backend-Id: <YOUR_BACKEND_ID>`. Self-hosted deployments use their own API base URL.

### Request Body

| Field            | Type   | Description                                                                                                     |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| `start`, `end`   | string | Time range in RFC3339 format.                                                                                   |
| `query`          | string | gcQL containing one top-level `signal_type` equality filter and one top-level `pipeline_stage` equality filter. |
| `pipeline`       | object | Alternative structured query. Supply exactly one of `query` or `pipeline`. The same mandatory filters apply.    |
| `sources`        | array  | Optional structured scope conditions.                                                                           |
| `filters`        | string | Optional additional filters.                                                                                    |
| `bucketDuration` | string | Required for time series; at least `10m`.                                                                       |
| `valueField`     | string | Numeric result alias to chart.                                                                                  |
| `fillValue`      | number | Optional replacement for empty time buckets; defaults to `null`.                                                |

Use a search window of at least 10 minutes, and a time-series bucket of at least 10 minutes. Smaller windows or rollups return HTTP `400`.

Examples below select `signal_type:logs` and `pipeline_stage:storage`. Replace those values with the signal and stage you want to inspect, keeping both filters at the top level of the query. Use explicit sums of counters to distinguish accepted counts, dropped counts, and bytes.

### Example: Accepted and Dropped Logs

```bash
curl --request POST 'https://api.groundcover.com/api/ingestion-measurements/search' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'X-Backend-Id: <YOUR_BACKEND_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "start": "2026-10-28T10:00:00Z",
    "end": "2026-10-28T11:00:00Z",
    "query": "signal_type:logs pipeline_stage:storage | stats by (workload) sum(accepted_count) as accepted, sum(dropped_count) as dropped, sum(accepted_size_bytes) as accepted_bytes, sum(dropped_size_bytes) as dropped_bytes | sort by (accepted_bytes desc) | limit 20"
  }'
```

The response has a `data` array of query rows and `valueFieldHints`, the names of numeric columns. For example:

```json
{
  "data": [{"workload": "checkout", "accepted": 200, "dropped": 10, "accepted_bytes": 40000, "dropped_bytes": 2000}],
  "valueFieldHints": ["accepted", "accepted_bytes", "dropped", "dropped_bytes"]
}
```

The response values above are illustrative.

### Example: Accepted Bytes over Time

```bash
curl --request POST 'https://api.groundcover.com/api/ingestion-measurements/search-time-series' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'X-Backend-Id: <YOUR_BACKEND_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "start": "2026-10-28T10:00:00Z",
    "end": "2026-10-28T12:00:00Z",
    "query": "signal_type:logs pipeline_stage:storage | stats by (workload) sum(accepted_size_bytes) as bytes",
    "bucketDuration": "10m",
    "valueField": "bytes",
    "fillValue": 0
  }'
```

The response is a time-series array containing `metric` labels and `velocity` points. The endpoint adds the time buckets to the aggregation. Historical requests can exclude an unfinished trailing bucket. See [Time-Series Queries](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/time-series-queries.md).

### Errors

Missing or duplicate mandatory filters, supplying both query forms, invalid gcQL, and windows or buckets below 10 minutes return HTTP `400`. A backend without ingestion-measurement support returns `404`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/query-ingestion-measurements.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
