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

# Get metrics

> **Token scope:** `account` · `org` · `project` — read-only tokens allowed.

Resource metrics (compute and managed Fly databases via Fly Prometheus; insta-db serves CPU/memory/storage series, other database providers return a note instead)



## OpenAPI

````yaml /openapi/project.json get /projects/{projectId}/metrics
openapi: 3.1.0
info:
  title: InstaCloud API — Project level
  version: 0.1.0
  description: >-
    Endpoints under `/projects/{projectId}`: branches, services, deploys,
    secrets, databases, storage, cron, observability, governance. Callable with
    any token whose binding covers the project.


    Generated from the platform's own OpenAPI document
    (https://api.instacloud.com/openapi.json); see the [API
    overview](/reference/api/overview) for authentication and token scopes.
servers:
  - url: https://api.instacloud.com
    description: InstaCloud
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Projects inside an organization.
  - name: Branches
    description: >-
      Branch environments of a project: isolated database, storage and compute
      per branch.
  - name: Services
    description: 'Services on a branch: compute, postgres, storage and managed databases.'
  - name: Deploy
    description: Deploy an image or a source to a compute service.
  - name: Compute
    description: Build output of a compute service.
  - name: Secrets
    description: User secrets, service credentials and how they bind into compute env.
  - name: Database
    description: Postgres databases, extensions, credentials and ad-hoc SQL.
  - name: Storage
    description: Objects in a storage service.
  - name: Backups
    description: Database backups and restores.
  - name: Cron
    description: Scheduled HTTP calls against a service or an external URL.
  - name: Observability
    description: Logs, metrics, deploy events and database insight.
  - name: Governance
    description: Per-project agent policy and the approval queue.
  - name: Audit
    description: The project's event timeline, including agent-ingested events.
  - name: Domains
    description: >-
      Domains bought through InstaCloud, bring-your-own zones and their DNS
      records.
  - name: Billing
    description: Usage, cycles, invoices and credits.
  - name: Templates
    description: Deploy a template into a project.
paths:
  /projects/{projectId}/metrics:
    get:
      tags:
        - Observability
      summary: Get metrics
      description: >-
        **Token scope:** `account` · `org` · `project` — read-only tokens
        allowed.


        Resource metrics (compute and managed Fly databases via Fly Prometheus;
        insta-db serves CPU/memory/storage series, other database providers
        return a note instead)
      operationId: getMetrics
      parameters:
        - schema:
            type: string
            enum:
              - db
              - compute
              - redis
              - mysql
              - mongodb
          in: query
          name: component
          required: true
        - schema:
            type: string
          in: query
          name: branch
          required: false
          description: branch name (default branch if omitted)
        - schema:
            type: string
          in: query
          name: group
          required: false
          description: >-
            one service by name; omit for EVERY service of this component on the
            branch, each series tagged with labels.group
        - schema:
            type: string
            enum:
              - instance
          in: query
          name: breakdown
          required: false
          description: >-
            CPU and memory per replica, labelled with labels.instance. Requires
            component=compute and an explicit nonempty group. Omit for service
            totals; network and disk remain service totals only.
        - schema:
            type: integer
          in: query
          name: from
          required: false
          description: unix seconds (default now-3600)
        - schema:
            type: integer
          in: query
          name: to
          required: false
          description: unix seconds (default now)
        - schema:
            default: 60s
            type: string
          in: query
          name: step
          required: false
          description: PromQL step
        - schema:
            format: uuid
            type: string
          in: path
          name: projectId
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsResult'
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    MetricsResult:
      type: object
      properties:
        source:
          example: fly-prometheus
          type: string
        series:
          type: array
          items:
            $ref: '#/components/schemas/MetricSeries'
        note:
          description: present when a provider can't serve the request (e.g. DB metrics)
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    MetricSeries:
      type: object
      properties:
        name:
          type: string
        unit:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        sampleIntervalSeconds:
          exclusiveMinimum: 0
          description: >-
            Source sampling interval in seconds, independent of the requested
            chart step.
          type: number
        points:
          type: array
          description: '[unixSeconds, value] pairs'
          items:
            type: array
            items:
              type: number
            minItems: 2
            maxItems: 2
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Session access JWT or an API token (`insta_<prefix>_<secret>`).

````