> ## Documentation Index
> Fetch the complete documentation index at: https://www.ravion.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a PromQL range query through an Operator agent

> Run a PromQL range query against a Prometheus reached through the Operator agent enrolled for clusterArn. GET /metrics/eks-prometheus/query-range in the…



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml get /metrics/eks-prometheus/query-range
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: AwsAmp
  - name: EksPrometheus
  - name: EksLoki
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleCategories
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: Gitlab
  - name: Git
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Domains
  - name: AcmCertificates
  - name: Describe
  - name: Reports
paths:
  /metrics/eks-prometheus/query-range:
    get:
      tags:
        - EksPrometheus
      summary: Run a PromQL range query through an Operator agent
      description: >-
        Run a PromQL range query against a Prometheus reached through the
        Operator agent enrolled for `clusterArn`. Use this instead of the Amazon
        Managed Prometheus endpoint (`aws/amp/query-range`) when the module's
        `ui.metrics` prometheus source carries `cluster_arn` + `endpoint` — an
        in-cluster Prometheus, or an external one such as Grafana Cloud Metrics.
        Applies the same Redis answer cache the in-cluster Loki queries use. A
        cluster whose agent is disconnected answers 200 with no series and the
        ARN in `offlineClusters`.
      operationId: GetEksPrometheusMetricData
      parameters:
        - description: >-
            ARN of the EKS cluster whose Operator agent proxies the query.
            Resolved to a connected agent inside the caller's own organization,
            which is what confines this endpoint to clusters the caller can see
            — an ARN belonging to another tenant resolves to nothing.
          in: query
          name: clusterArn
          required: true
          schema:
            type: string
        - description: >-
            Base URL of the Prometheus to query, without the
            `/api/v1/query_range` suffix. Naming it is not a permission: the
            agent judges every proxied destination against its own
            `httpProxy.allowedEndpoints`, so an endpoint that install was not
            configured for is refused in the cluster.
          in: query
          name: endpoint
          required: true
          schema:
            type: string
        - description: >-
            Name of a Kubernetes Secret in the Operator namespace whose contents
            the AGENT presents as the Authorization header. A name, never a
            value — Ravion neither reads nor stores the credential. Omit for an
            endpoint that needs none.
          in: query
          name: authSecret
          schema:
            nullable: true
            type: string
        - description: >-
            PromQL expression. Occurrences of `$__interval` are replaced
            server-side with the normalized step, so range-vector windows always
            match the resolution actually queried.
          in: query
          name: query
          required: true
          schema:
            type: string
        - description: >-
            Requested step in seconds. Widened server-side to a 15s floor and to
            whatever keeps the window under the 11,000-samples-per-series cap;
            the effective value is echoed as `stepSeconds`.
          in: query
          name: step
          required: true
          schema:
            format: int32
            type: integer
        - description: >-
            Inclusive start of the query window (ISO 8601). Must be earlier than
            `endTime`.
          in: query
          name: startTime
          required: true
          schema:
            type: string
        - description: >-
            Inclusive end of the query window (ISO 8601). Must be after
            `startTime` and not in the future.
          in: query
          name: endTime
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EksPrometheusMetricDataResponse'
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The request is invalid or malformed.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The server cannot find the requested resource.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Client error
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Client error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  schemas:
    EksPrometheusMetricDataResponse:
      additionalProperties: false
      description: >-
        Response payload for a PromQL range query proxied through an Operator
        agent. `series` and `stepSeconds` are the same shape the Amazon Managed
        Prometheus endpoint returns, so one chart component renders both;
        `offlineClusters` is the field that exists only here.
      properties:
        offlineClusters:
          description: >-
            Cluster ARNs whose Operator agent is not connected, so no query
            could be sent. Empty on a normal answer. Render this as an explicit
            state and fall through to the next source in the chart's chain —
            never as an empty result.
          items:
            type: string
          type: array
        series:
          description: Result series, in the order Prometheus returned them.
          items:
            $ref: '#/components/schemas/AmpMetricSeries'
          type: array
        stepSeconds:
          description: >-
            The step in seconds actually used, after normalization to
            Prometheus's floor and per-series sample cap. May be coarser than
            the requested `step`.
          format: int32
          type: integer
      required:
        - series
        - stepSeconds
        - offlineClusters
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows SUPERADMINs to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Stripped for internal errors unless
            superadmin.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    AmpMetricSeries:
      additionalProperties: false
      description: >-
        One result series from a PromQL range query: its label set plus its
        datapoints.
      properties:
        datapoints:
          description: Datapoints, ordered by timestamp ascending
          items:
            $ref: '#/components/schemas/AmpMetricDatapoint'
          type: array
        labels:
          additionalProperties:
            type: string
          description: >-
            Prometheus label set identifying the series (e.g. `{pod: api-abc}`).
            Empty for fully-aggregated queries.
          type: object
      required:
        - labels
        - datapoints
      type: object
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
    AmpMetricDatapoint:
      additionalProperties: false
      description: A single datapoint in a Prometheus result series
      properties:
        timestamp:
          description: Datapoint timestamp in ISO 8601 format
          type: string
        value:
          description: Sample value at that timestamp
          format: double
          type: number
      required:
        - timestamp
        - value
      type: object
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````