Whether you are just starting your observability journey or already are an expert, our courses will help advance your knowledge and practical skills.
Expert insight, best practices and information on everything related to Observability issues, trends and solutions.
Explore our guides on a broad range of observability related topics.
Coralogix provides a Metrics API, granting you access to all metrics you’ve sent to Coralogix. This API supports two primary use cases: querying metrics data programmatically and acting as a PromQL-compatible query data source (e.g., as a Grafana Prometheus data source).
Each HTTP request must include an Authorization
header with a value Bearer <API-Key>
. Configure a customized API key with the DataQuerying
role preset or Query Metrics
permission: metrics.data-api#high:ReadData
. For more details, refer here.
Alternatively, you may use the Legacy Logs Query API Key
.
Include the following in your API request:
Header | Authorization: Bearer <API-Key> |
---|---|
URL | Select the Metrics endpoint associated with your Coralogix domain |
Ensure you update your Coralogix domain and API key in the following examples.
Instant Metric Query
Evaluates an instant metric at a defined single point in time.
curl --location --request GET 'https://ng-api-http.<domain>/metrics/api/v1/query?query=vector(1)' --header 'Authorization: Bearer <API-Key>'
Configure a Prometheus data source in Grafana:
STEP 1. Navigate to Home > Connection > Add new connection. Enter Prometheus data source.
STEP 2. Click Add new data source.
STEP 3. Input the following fields:
Connection
https://ng-api-http.<domain>/metrics/
(Input your Coralogix domain into the Metrics endpoint)Authentication
Authorization
Bearer <API-Key>
(as mentioned in the Authentication section above)Advanced Settings
Prometheus
2.24.x
STEP 4. Click Save & test. You should receive a message confirming a successful query to the Prometheus API.
Find out more here.
The following are examples of supported APIs for HTTP methods GET and POST.
API | Description |
---|---|
/api/v1/query | Instant query |
/api/v1/query_range | Range query |
GET /api/v1/label/<label_name>/values | Querying label values |
GET /api/v1/labels | Getting label names |
GET /api/v1/series | Finding series by label matchers |
Details on how to use supported APIs can be found here.
The following are examples of unsupported APIs for HTTP methods GET and POST.
API | Description |
---|---|
GET /api/v1/alerts | Returns a list of all active alerts |
/api/v1/query_exemplars | Query exemplars for a specific series over time |
GET /api/v1/rules | Returns a list of alerting and recording rules |
GET /api/v1/targets/metadata | Returns metadata about metrics from targets |
External Documentation | Prometheus API |
Need help?
Our world-class customer success team is available 24/7 to assist you with your setup and answer any questions.
Contact us via our in-app chat or by emailing support@coralogix.com.