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

# Get volume metrics



## OpenAPI

````yaml /api-reference/openapi.json get /v1/volumes/{id}/metrics
openapi: 3.1.0
info:
  title: microsandbox cloud API
  description: >-
    REST API for microsandbox cloud operations authenticated with an
    organization API key.
  version: 0.1.0
servers:
  - url: https://api.microsandbox.dev
security:
  - api_key: []
paths:
  /v1/volumes/{id}/metrics:
    get:
      tags:
        - Volumes
      summary: Get volume metrics
      operationId: get_metrics
      parameters:
        - name: id
          in: path
          description: Volume id
          required: true
          schema:
            type: string
            format: uuid
        - name: range_secs
          in: query
          description: Look-back window in seconds (default 3600 = 1h, max 604800 = 7d).
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int64
            minimum: 0
        - name: step_secs
          in: query
          description: Sample resolution in seconds (default 30, min 5).
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int64
            minimum: 0
      responses:
        '200':
          description: Volume performance metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VolumeMetricsResponse'
        '400':
          description: Invalid time range or resolution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: invalid request
                  details: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_api_key
                  message: unauthorized
                  details: null
        '404':
          description: Volume not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: sandbox_not_found
                  message: resource not found
                  details: null
        '502':
          description: Metrics backend unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: orchestrator_unreachable
                  message: orchestrator unreachable
                  details: null
      security:
        - api_key: []
components:
  schemas:
    VolumeMetricsResponse:
      type: object
      description: Per-volume JuiceFS performance metrics over a time range.
      required:
        - volume_id
        - range
        - metrics
      properties:
        metrics:
          type: object
          description: >-
            Metric key → aggregate series across every worker mounting the
            volume.

            An empty series means "no data in range".
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/MetricSeries'
          propertyNames:
            type: string
        range:
          $ref: '#/components/schemas/MetricsRange'
          description: The resolved query window.
        volume_id:
          type: string
          format: uuid
          description: The volume these metrics belong to.
    ErrorResponse:
      type: object
      description: Error envelope returned by every non-2xx response.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code, e.g. `invalid_api_key`.
            message:
              type: string
              description: Human-readable description of the error.
            details:
              type:
                - object
                - 'null'
              description: Optional structured context for the error.
    MetricSeries:
      type: object
      description: One labelled series for a metric.
      required:
        - labels
        - samples
      properties:
        labels:
          type: object
          description: >-
            Series labels (e.g. `sandbox_name`), minus internal Prometheus
            names.
          additionalProperties:
            type: string
          propertyNames:
            type: string
        samples:
          type: array
          items:
            type: array
            items:
              type: number
              format: double
          description: '`[epoch_millis, value]` pairs in ascending time order.'
    MetricsRange:
      type: object
      description: The resolved time window a metrics response covers.
      required:
        - start
        - end
        - step_secs
      properties:
        end:
          type: integer
          format: int64
          description: Window end, epoch milliseconds.
        start:
          type: integer
          format: int64
          description: Window start, epoch milliseconds.
        step_secs:
          type: integer
          format: int64
          description: Sample resolution in seconds.
          minimum: 0
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      description: Organization API key (msb_…) - org-scoped programmatic access.

````