Querying you data using an API
groundcover provides a robust user interface that allows you to view and analyze all your observability data from inside the platform. However, there may be cases in which you need to query the data from outside our platform using API communication.
Our proprietary eBPF sensor automatically captures granular observability data, which is stored via our integrations with two best-of-breed technologies. VictoriaMetrics for metrics storage, and ClickHouse for storage of logs, traces, and Kubernetes events.
Read more about our architecture here.
Generate the API key
Run the following command in your CLI, and select tenant:
groundcover auth get-datasources-api-key
Querying ClickHouse
Example for querying ClickHouse database using POST HTTP Request:
Command parameters
X-ClickHouse-Key
(header): API Key you retrieved from the groundcover CLI. Replace${API_KEY}
with your actual API key, or setAPI_KEY
as env parameter.SELECT count() FROM traces WHERE start_timestamp > now() - interval '15 minutes'
(data): The SQL query to execute. This query counts the number of traces where thestart_timestamp
is within the last 15 minutes.
Learn more about the ClickHouse query language here.
Querying VictoriaMetrics
Example for querying the VictoriaMetrics database using the query_range
API:
Command parameters
apikey
(header): API Key you retrieved from the groundcover CLI. Replace${API_KEY}
with your actual API key, or setAPI_KEY
as env parameter.query
(data): The promql query to execute. In this case, it calculates the sum of the rate ofgroundcover_resource_total_counter
with thetype
set tohttp
.start
(data): The start timestamp for the query range in Unix time (seconds since epoch). Example:1715760000
.end
(data): The end timestamp for the query range in Unix time (seconds since epoch). Example:1715763600
.
Learn more about the promql syntax here.
Learn more about VictoriaMetrics HTTP API here.
Last updated