metrics

Get metrics data points.

Notes

  • As a pre-requiste user should be aware of the MetricQL
  • Default time interval is 2 hrs
  • Default step size is 60 sec is recommened
  • Step size can be user driven interval
  • Query value should be encoded
  • Max 11000 metric data points on given step size
  • User needs to adjust the step size accoringly to the time interval queried

Data Retention Policy

  • The maximum retention period of the metric data is 13 months
  • Based on TTL configuration more than 13 months data will be deleted.

Step value calculation

  • Default step value is 60 sec.
  • Step value limit the number of returned points per time-series based on step value resolution.Step is interval in terms of seconds. Metric engine timeseries data by default can give upto 11000 datapoints only.For e.g. if we are querying data for last 10 days with step value as 60s we get below exception
    • exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)
  • Sample calculation at metric engine for 10 days duration based on step value as below
    • start = 1634629345
    • end = 1635493345
    • step = 60(60 sec)
      • Formula ((end-start / step )>11000)
        • (1635493345-1634629345)/60 = 14400 i.e result greater than 11000 i..e more than support limit.
    • Example calculations based on above limitation upto 11000 datapoints for best practices.
      • For 11000 points upto one week, use step value as 60sec
      • For 11000 points upto one year, use step value as 1hr(3600 sec)
  • Upto 1 week → step size = 60 sec
  • Greater than 1 week and less than 1 month → step size = 250 sec
  • Greater than 1 month and less than 3 months → step size = 730 sec
  • Greater than 3 months and less than 6 months → step size = 1450 sec
  • Greater than 6 months and less than 1 year → step size = 2875 sec

Example:- Custom scenario to get 13 months metric data

  • Create the step size as per requirement, say for each day/week with 90 sec interval step size within 16MB data size and 11,000 datapoints.
  • Get the metric for each day/week to complete 13 months period
  • Collect metric data for each day with the set step-size
  • e.g 1st day of last 13th month from current day https://<server.com>/metricsql/api/v3/tenants/<tenantId>/metrics?query=synthetic_response_time%7Binstance%3D%7E%22MonitoringChannel%7CTest+old+binary%22%7D%26step%3D90&start=1630454400&end=1630540800

Max data size supported

  • 16MB per endpoint call

Max MetricQL length

  • 8K Characters

Reference for query language

Example endpoint with encoded query

  • https://<server.com>/metricsql/api/v3/tenants/<tenantId>/metrics?query=synthetic_response_time%7Binstance%3D%7E%22MonitoringChannel%7CTest+old+binary%22%7D&start=1635470492&end=1635488492

Get metrics data points with timestamps

Path Parameters

  • tenantIdstringrequired

    Describes clientId of the tenant

Query Parameters

  • querystringrequired

    MetricQL supported query format.This should be in encoded format. Refer: https://prometheus.io/docs/prometheus/latest/querying/basics/

  • startstring

    startTime - Timestamp in seconds

  • endstring

    EndTime

  • stepnumber

    step size

    Default: 60

Responses

  • statusstringrequired

  • dataobjectrequired

Loading Examples...