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

# Query current metric values

> Get the latest values for a metric, optionally grouped by a label



## OpenAPI

````yaml https://controller.simplecloud.app/swagger/doc.json get /v0/metrics/query
openapi: 3.1.0
info:
  contact:
    email: support@swagger.io
    name: API Support
    url: http://www.swagger.io/support
  description: API for SimpleCloud Controller
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: SimpleCloud Controller API
  version: '1.0'
servers:
  - url: https://controller.platform.simplecloud.app/
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /v0/metrics/query:
    get:
      tags:
        - metrics
      summary: Query current metric values
      description: Get the latest values for a metric, optionally grouped by a label
      parameters:
        - description: Network ID
          in: header
          name: X-Network-ID
          required: true
          schema:
            type: string
        - description: Network Secret
          in: header
          name: X-Network-Secret
          required: true
          schema:
            type: string
        - description: Metric name (e.g., server.player_count, server.cpu_usage_percent)
          in: query
          name: metric
          required: true
          schema:
            type: string
        - description: Label to group by (e.g., server_group_name, persistent_server_name)
          in: query
          name: group_by
          schema:
            type: string
        - description: Comma-separated server IDs to filter
          in: query
          name: server_ids
          schema:
            type: string
        - description: Comma-separated server group IDs to filter
          in: query
          name: server_group_ids
          schema:
            type: string
        - description: Comma-separated persistent server IDs to filter
          in: query
          name: persistent_server_ids
          schema:
            type: string
        - description: Comma-separated server group types to filter (e.g., SERVER, PROXY)
          in: query
          name: server_type
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/metrics.InstantResult'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
          description: Unauthorized
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    metrics.InstantResult:
      properties:
        samples:
          items:
            $ref: '#/components/schemas/metrics.Sample'
          type: array
          uniqueItems: false
      type: object
    models.ErrorResponse:
      description: Generic error response
      properties:
        error:
          type: string
      type: object
    metrics.Sample:
      properties:
        labels:
          additionalProperties:
            type: string
          type: object
        metric:
          type: string
        timestamp:
          type: string
        value:
          type: number
      type: object

````