Datasource API Keys (Legacy)
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.
Using the datasource API is not recommended (Legacy) as there are newer ways to use the API. You can refer to Metrics and Logs API
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:
curl 'https://ds.groundcover.com/' \
--header "X-ClickHouse-Key: ${API_KEY}" \
--data "SELECT count() from traces where start_timestamp > now() - interval '15 minutes' "Command parameters
X-ClickHouse-Key(header): API Key you retrieved from the groundcover CLI. Replace${API_KEY}with your actual API key, or setAPI_KEYas 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_timestampis 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_KEYas env parameter.query(data): The MetricsQL query to execute. In this case, it calculates the sum of the 5-minute rate ofgroundcover_container_cpu_throttled_seconds_totalwith thenamespaceset todefault. MetricsQL is PromQL-compatible, so plain PromQL works too.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 MetricsQL syntax, or the PromQL syntax it builds on.
Learn more about VictoriaMetrics HTTP API here.
Last updated
