Query Data with gcQL
Query logs, traces, and Kubernetes events over HTTP using gcQL, groundcover's pipe-based query language. All signals share the same request structure and response format.
groundcover exposes a search endpoint per data type, all sharing the same request structure and all powered by gcQL - the same query language used in the platform's Data Explorer, dashboards, and monitors. Anything you can express in the product's search bar can be executed through these endpoints: filtering, field projection, aggregations, sorting, joins, and more.
Endpoints
Logs
POST /api/logs/v2/search
Traces
POST /api/traces/v2/search
Kubernetes Events
POST /api/k8s/v2/events/search
The base URL for all endpoints is https://api.groundcover.com.
Authentication
All endpoints require an API key passed in the Authorization header:
Authorization: Bearer <YOUR_API_KEY>If your account is associated with multiple backends, also include the X-Backend-Id header:
X-Backend-Id: <YOUR_BACKEND_ID>To locate your Backend ID, navigate to Settings → Access, open the API Keys tab, and find it in the section header.
Request Body
All search endpoints accept the same JSON body:
start
string
Yes
Start of the time range, RFC3339 / ISO 8601 (e.g. "2026-08-22T14:00:00Z")
end
string
Yes
End of the time range, RFC3339 / ISO 8601
query
string
Yes
The gcQL query to execute
Example Request Body:
Writing gcQL Queries
A gcQL query starts with a filter expression (or * to match everything) followed by pipe operations:
For example, counting error logs per workload:
A few rules of thumb for queries over the API:
Always end with
| limit Nto bound the result size.Filters alone return no data - pipe to
| fields,| stats, or| limitto select what comes back.Prefer selective filters (a specific workload, namespace, or level) over
*, and keep time ranges as narrow as your use case allows. Both dramatically reduce query cost.Use
| fieldsto select only the columns you need and keep responses small.The request's
startandendset the time window - use the_timefield inside the query only for sub-windows or offsets.
See the full gcQL reference for all filters, pipes, and aggregation functions.
Response
The response is a JSON array of row objects. The shape of each row depends on the query: raw record queries return the record fields (or the ones selected with | fields), and aggregation queries return the group-by fields plus the computed values.
Pagination
Paginate with the offset and limit pipes, keeping the same time range and a stable sort order across pages:
For aggregation queries, prefer refining the query (tighter filters, higher-level grouping) over paginating through a large result set.
Per-Signal Examples
APM measurements (pre-aggregated request, error, and latency data) are also queried with gcQL, through their own endpoints - see Query APM Measurements.
Last updated
