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

# Query Kubernetes volume metrics

> Returns the latest filesystem metrics per Kubernetes volume and node in a time range: used, available, and total bytes, and inode counts.

For authentication and the other Kubernetes endpoints, see the [Public API (V2) overview](https://docs.appsignal.com/api/v2/overview.md#kubernetes).

```yaml POST /api/v2/kubernetes/volumes theme={null}
openapi: 3.1.0
info:
  title: AppSignal V2 API
  description: >-
    REST API for metrics, traces, logs, Kubernetes monitoring, and deployment
    tracking.
  license:
    name: ''
  version: 0.1.0
paths:
  /api/v2/kubernetes/volumes:
    post:
      tags:
        - Kubernetes
      summary: Query Kubernetes volume metrics
      operationId: volumes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VolumesQuery'
            example:
              site_id: abc123
              from: '2024-01-01T00:00:00Z'
              to: '2024-01-01T01:00:00Z'
        required: true
      responses:
        '200':
          description: >-
            One row per node and volume name in the requested time range. Both
            names must be nonempty. For equal timestamps, the sample with the
            highest used bytes wins first.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VolumeRow'
        '400':
          description: >-
            The time range is empty, reversed, or longer than 48 hours, or
            contains unsupported timestamps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Missing or invalid authentication token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Route or resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: External query concurrency limit exceeded; retry shortly.
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Unhandled server-side failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer_auth: []
        - token_query: []
components:
  schemas:
    BadRequestResponse:
      type: object
      description: >-
        Standard body for HTTP 400 Bad Request responses. Branch on the stable
        `error` slug, display `message` as-is, and read per-error structured
        data from `details`.
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Stable, machine-readable slug identifying the specific error case.
        message:
          type: string
          description: Human-readable message. Safe to log or display to end users.
        details:
          description: >-
            Per-error structured payload. Shape varies by
            [`error`](Self::error).
    ErrorResponse:
      type: object
      description: Error body returned for 401, 404 and 500 responses.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
    TooManyRequestsResponse:
      type: object
      description: Error body returned for 429 responses.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        suggestion:
          type:
            - string
            - 'null'
          description: >-
            A cheaper way to write the request's filter. Only the trace list

            endpoints set it, and only for a filter with a known indexed
            rewrite.
    VolumeRow:
      type: object
      description: The latest filesystem metrics for a named volume on a node.
      required:
        - timestamp
        - node_name
        - volume_name
        - fs_used_bytes
        - fs_capacity_bytes
        - fs_available_bytes
        - fs_inodes_used
        - fs_inodes
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the filesystem sample.
        node_name:
          type: string
          description: Nonempty name of the node that reported the volume.
        volume_name:
          type: string
          description: Nonempty name of the volume on that node.
        fs_used_bytes:
          type: integer
          format: u-int64
          description: Filesystem space used in bytes.
          minimum: 0
        fs_capacity_bytes:
          type: integer
          format: u-int64
          description: Total filesystem capacity in bytes.
          minimum: 0
        fs_available_bytes:
          type: integer
          format: u-int64
          description: Filesystem space available in bytes.
          minimum: 0
        fs_inodes_used:
          type: integer
          format: u-int64
          description: Number of inodes in use.
          minimum: 0
        fs_inodes:
          type: integer
          format: u-int64
          description: Total number of inodes.
          minimum: 0
    VolumesQuery:
      type: object
      description: >-
        Query for fetching the latest metrics per Kubernetes volume in a time
        range.
      required:
        - site_id
        - from
        - to
      properties:
        site_id:
          type: string
          description: >-
            Site whose volume metrics to query; the caller must have access to
            it.
        from:
          type: string
          format: date-time
          description: Inclusive start, at or after 1970-01-01T00:00:00Z and before `to`.
        to:
          type: string
          format: date-time
          description: >-
            Exclusive end, at most 48 hours after `from` and no later than
            2106-02-07T06:28:16Z.
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer <token>`'
    token_query:
      type: apiKey
      in: query
      name: token
      description: >-
        Alternative to the Authorization header: pass the token as a
        `?token=<token>` query parameter.
```


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://docs.appsignal.com/llms.txt).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.