Prometheus · Arazzo Workflow

Prometheus Chart a Range Query and Pull Its Exemplars

Version 1.0.0

Validate an expression, graph it over a time range, then link the spikes to traces.

1 workflow 1 source API 1 provider
View Spec View on GitHub AlertingMetricsMonitoringObservabilityTime SeriesArazzoWorkflows

Provider

prometheus

Workflows

range-query-with-exemplars
Evaluate a PromQL expression over a time range and fetch its exemplars.
Validating the expression with an instant query before issuing the range query keeps a malformed or overly expensive expression from being evaluated at every step across the whole window.
3 steps inputs: end, query, start, step outputs: exemplarData, resultType, series
1
validateExpression
queryInstant
Evaluate the expression once at the end of the window. A 400 or 422 here means the expression is malformed and the range query would fail the same way, only after far more work on the server.
2
evaluateRange
queryRange
Evaluate the expression at every step across the range, producing the matrix of time series a chart renders.
3
fetchExemplars
queryExemplars
Retrieve exemplars over the same window. Exemplars carry the trace or log IDs attached to individual observations, which is what turns a latency spike on the chart into a specific trace to open.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Prometheus Chart a Range Query and Pull Its Exemplars
  summary: Validate an expression, graph it over a time range, then link the spikes to traces.
  description: >-
    The flow behind every Prometheus-backed dashboard panel that supports
    click-through to tracing. The workflow validates the PromQL expression with a
    cheap instant query, evaluates it across the full time range at a step
    interval to produce the matrix a chart needs, and then retrieves the
    exemplars over the same window so high-value samples can be linked to their
    trace IDs. Every step spells out its request inline so the flow can be read
    and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: httpApi
  url: ../openapi/prometheus-http-api-openapi.yml
  type: openapi
workflows:
- workflowId: range-query-with-exemplars
  summary: Evaluate a PromQL expression over a time range and fetch its exemplars.
  description: >-
    Validating the expression with an instant query before issuing the range
    query keeps a malformed or overly expensive expression from being evaluated
    at every step across the whole window.
  inputs:
    type: object
    required:
    - query
    - start
    - end
    - step
    properties:
      query:
        type: string
        description: >-
          The PromQL expression to chart (e.g.
          histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))).
      start:
        type: string
        description: Start of the range as a Unix timestamp or RFC3339 string.
      end:
        type: string
        description: End of the range as a Unix timestamp or RFC3339 string.
      step:
        type: string
        description: Resolution step width as a duration string (e.g. 15s, 1m, 1h).
  steps:
  - stepId: validateExpression
    description: >-
      Evaluate the expression once at the end of the window. A 400 or 422 here
      means the expression is malformed and the range query would fail the same
      way, only after far more work on the server.
    operationId: queryInstant
    parameters:
    - name: query
      in: query
      value: $inputs.query
    - name: time
      in: query
      value: $inputs.end
    - name: timeout
      in: query
      value: 30s
    successCriteria:
    - condition: $statusCode == 200
    - condition: $response.body#/status == "success"
    outputs:
      resultType: $response.body#/data/resultType
      sampleCount: $response.body#/data/result
  - stepId: evaluateRange
    description: >-
      Evaluate the expression at every step across the range, producing the
      matrix of time series a chart renders.
    operationId: queryRange
    parameters:
    - name: query
      in: query
      value: $inputs.query
    - name: start
      in: query
      value: $inputs.start
    - name: end
      in: query
      value: $inputs.end
    - name: step
      in: query
      value: $inputs.step
    - name: timeout
      in: query
      value: 60s
    successCriteria:
    - condition: $statusCode == 200
    - condition: $response.body#/status == "success"
    - condition: $response.body#/data/resultType == "matrix"
    outputs:
      resultType: $response.body#/data/resultType
      series: $response.body#/data/result
      firstSeriesMetric: $response.body#/data/result/0/metric
      firstSeriesValues: $response.body#/data/result/0/values
  - stepId: fetchExemplars
    description: >-
      Retrieve exemplars over the same window. Exemplars carry the trace or log
      IDs attached to individual observations, which is what turns a latency
      spike on the chart into a specific trace to open.
    operationId: queryExemplars
    parameters:
    - name: query
      in: query
      value: $inputs.query
    - name: start
      in: query
      value: $inputs.start
    - name: end
      in: query
      value: $inputs.end
    successCriteria:
    - condition: $statusCode == 200
    - condition: $response.body#/status == "success"
    outputs:
      exemplarData: $response.body#/data
      firstSeriesLabels: $response.body#/data/0/seriesLabels
      firstExemplars: $response.body#/data/0/exemplars
  outputs:
    series: $steps.evaluateRange.outputs.series
    resultType: $steps.evaluateRange.outputs.resultType
    exemplarData: $steps.fetchExemplars.outputs.exemplarData

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/prometheus-range-query-with-exemplars-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.