Coralogix provides a Metrics API that allows you to securely query your hosted metrics with ease.
In order to use the Metrics API to query your metrics, first locate your:
The Logs Query Key should be added as Coralogix token with each HTTP request. Your Coralogix Domain will be used to construct the Metrics API endpoint specific to your account.
The API request should contain the following:
Examples:
Note: Be sure to update your domain and Log Query Key when using the following examples.
curl --location --request GET 'https://prom-api.<domain>/api/v1/query?query=<metric_name>' \\ --header 'token: <Log Query Key>' \\ --header 'Content-Type: application/json' \\ --data-raw ''
curl --location --request GET 'https://prom-api.<domain>/api/v1/query?query=<metric_name>&time=2022-10-26T12:10:51.781Z' \\ --header 'token: <Log Query Key>' \\ --header 'Content-Type: application/json' \\ --data-raw ''
curl --location --request GET 'https://prom-api.<domain>/api/v1/query_range?query=<metric_name>&start=2022-10-26T10:10:51.781Z&end=2022-10-26T12:10:51.781Z' \\ --header 'token: <Log Query Key>' \\ --header 'Content-Type: application/json' \\ --data-raw ''
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.
Feel free to reach out to us via our in-app chat or by sending us an email to [email protected].