Coralogix provides a Metrics API that lets you query your hosted metrics easily.
To use the Metrics API to query your metrics, first locate your:
Each HTTP request should add The Logs Query Key as a Coralogix token. Your Coralogix domain will be used to construct the Metrics API endpoint specific to your account.
The API request should contain the following:
Domain | URL |
coralogix.us cx498.coralogix.com coralogix.com eu2.coralogix.com coralogixsg.com | https://ng-api-http.<domain>/metrics/api/v1 |
coralogix.in | https://ng-api-http.app.<domain>/metrics/api/v1 |
Be sure to update your domain and Log Query Key when using the following examples.
Evaluates a server’s instant metric at a specific moment in time.
curl --location --request GET '/api/v1/query?query=<metric_name>' \\ --header 'Authorization: Bearer <TOKEN>' \\ --header 'Content-Type: application/json' \\ --data-raw ''
Evaluates an instant metric at a defined single point in time.
curl --location --request GET 'https://ng-api-http.app.<domain>/metrics/api/v1/query?query=<metric_name>&time=2022-10-26T12:10:51.781Z' \\ --header 'Authorization: Bearer <TOKEN>' \\ --header 'Content-Type: application/json' \\ --data-raw ''
Evaluates an instant metric over a range of time.
curl --location --request GET 'https://ng-api-http.app.<domain>/metrics/api/v1/query_range?query=<metric_name>&start=2022-10-26T10:10:51.781Z&end=2022-10-26T12:10:51.781Z' \\ --header 'Authorization: Bearer <TOKEN>' \\ --header 'Content-Type: application/json' \\ --data-raw ''
Documentation | Prometheus API Documentation |
Need help?
Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.
Contact us via our in-app chat or by emailing [email protected].