Our next-gen architecture is built to help you make sense of your ever-growing data Watch a 4-min demo video!

Back to All Docs

Metrics API Metrics API

Last Updated: Nov. 07, 2022

Coralogix provides a Metrics API that allows you to securely query your hosted metrics with ease.

Query Your Metrics

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:

  • Headers:
    • ‘token:<Logs Query Key>
    • ‘Content-type: application/json‘
  • URL: https://prom-api.<domain>/api/v1/

Examples:

Note: Be sure to update your domain and Log Query Key when using the following examples.

  1. Instant query – evaluates an instant metric at a single point in time of your server
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 ''
  1. Instant query – evaluates an instant metric at a single point of time defined.
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 ''
  1. Range query – evaluates an instant metric over a range of time.
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 ''

Additional Resources

Support

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].

On this page