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

# Query metrics

> Retrieve metrics based on the specified filters.



## OpenAPI

````yaml POST /query/metrics
openapi: 3.1.0
info:
  title: Lumos API
  version: 1.0.0
  description: Lumos RESTful API
  x-logo:
    url: >-
      https://zorp.zeetco.com/static/media/mark-white.8c3b78e3c878db1859b6319c98dc38b6.svg
    altText: Zeet Logo
  contact:
    email: support@zeet.co
servers:
  - url: https://api.alerty.ai
security: []
paths:
  /query/metrics:
    post:
      summary: Query metrics
      description: Retrieve metrics based on the specified filters.
      operationId: getMetrics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                start_time:
                  type: string
                  format: date-time
                  description: Start time for the query.
                  example: '2023-01-01T00:00:00Z'
                end_time:
                  type: string
                  format: date-time
                  description: End time for the query.
                  example: '2023-01-02T00:00:00Z'
                service_name:
                  type: string
                  description: Filter metrics by service name.
                metric_name:
                  type: string
                  description: Filter metrics by name.
                limit:
                  type: integer
                  default: 100
                  description: Limit the number of results.
      responses:
        '200':
          description: Metrics retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  exponential_histograms:
                    type: array
                    items:
                      $ref: '#/components/schemas/MetricExponentialHistogram'
                  gauges:
                    type: array
                    items:
                      $ref: '#/components/schemas/MetricGauge'
                  histograms:
                    type: array
                    items:
                      $ref: '#/components/schemas/MetricHistogram'
                  sums:
                    type: array
                    items:
                      $ref: '#/components/schemas/MetricSum'
                  summaries:
                    type: array
                    items:
                      $ref: '#/components/schemas/MetricSummary'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    MetricExponentialHistogram:
      type: object
      properties:
        resource_attributes:
          type: object
          additionalProperties:
            type: string
        resource_schema_url:
          type: string
        scope_name:
          type: string
        scope_version:
          type: string
        scope_attributes:
          type: object
          additionalProperties:
            type: string
        scope_dropped_attr_count:
          type: integer
        scope_schema_url:
          type: string
        metric_name:
          type: string
        metric_description:
          type: string
        metric_unit:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: string
        start_time_unix:
          type: string
          format: date-time
        time_unix:
          type: string
          format: date-time
        count:
          type: integer
        sum:
          type: number
          format: float
        scale:
          type: integer
        zero_count:
          type: integer
        positive_offset:
          type: integer
        positive_bucket_counts:
          type: array
          items:
            type: integer
        negative_offset:
          type: integer
        negative_bucket_counts:
          type: array
          items:
            type: integer
        exemplars:
          type: array
          items:
            $ref: '#/components/schemas/MetricExemplar'
        flags:
          type: integer
        min:
          type: number
          format: float
        max:
          type: number
          format: float
    MetricGauge:
      type: object
      properties:
        resource_attributes:
          type: object
          additionalProperties:
            type: string
        resource_schema_url:
          type: string
        scope_name:
          type: string
        scope_version:
          type: string
        scope_attributes:
          type: object
          additionalProperties:
            type: string
        scope_dropped_attr_count:
          type: integer
        scope_schema_url:
          type: string
        metric_name:
          type: string
        metric_description:
          type: string
        metric_unit:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: string
        start_time_unix:
          type: string
          format: date-time
        time_unix:
          type: string
          format: date-time
        value:
          type: number
          format: float
        flags:
          type: integer
        exemplars:
          type: array
          items:
            $ref: '#/components/schemas/MetricExemplar'
    MetricHistogram:
      type: object
      properties:
        resource_attributes:
          type: object
          additionalProperties:
            type: string
        resource_schema_url:
          type: string
        scope_name:
          type: string
        scope_version:
          type: string
        scope_attributes:
          type: object
          additionalProperties:
            type: string
        scope_dropped_attr_count:
          type: integer
        scope_schema_url:
          type: string
        metric_name:
          type: string
        metric_description:
          type: string
        metric_unit:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: string
        start_time_unix:
          type: string
          format: date-time
        time_unix:
          type: string
          format: date-time
        count:
          type: integer
        sum:
          type: number
          format: float
        bucket_counts:
          type: array
          items:
            type: integer
        explicit_bounds:
          type: array
          items:
            type: number
            format: float
        exemplars:
          type: array
          items:
            $ref: '#/components/schemas/MetricExemplar'
        flags:
          type: integer
        min:
          type: number
          format: float
        max:
          type: number
          format: float
    MetricSum:
      type: object
      properties:
        resource_attributes:
          type: object
          additionalProperties:
            type: string
        resource_schema_url:
          type: string
        scope_name:
          type: string
        scope_version:
          type: string
        scope_attributes:
          type: object
          additionalProperties:
            type: string
        scope_dropped_attr_count:
          type: integer
        scope_schema_url:
          type: string
        metric_name:
          type: string
        metric_description:
          type: string
        metric_unit:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: string
        start_time_unix:
          type: string
          format: date-time
        time_unix:
          type: string
          format: date-time
        value:
          type: number
          format: float
        flags:
          type: integer
        exemplars:
          type: array
          items:
            $ref: '#/components/schemas/MetricExemplar'
        agg_temp:
          type: integer
        is_monotonic:
          type: boolean
    MetricSummary:
      type: object
      properties:
        resource_attributes:
          type: object
          additionalProperties:
            type: string
        resource_schema_url:
          type: string
        scope_name:
          type: string
        scope_version:
          type: string
        scope_attributes:
          type: object
          additionalProperties:
            type: string
        scope_dropped_attr_count:
          type: integer
        scope_schema_url:
          type: string
        metric_name:
          type: string
        metric_description:
          type: string
        metric_unit:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: string
        start_time_unix:
          type: string
          format: date-time
        time_unix:
          type: string
          format: date-time
        count:
          type: integer
        sum:
          type: number
          format: float
        value_at_quantiles:
          type: array
          items:
            $ref: '#/components/schemas/MetricValueAtQuantile'
        flags:
          type: integer
    MetricExemplar:
      type: object
      properties:
        filtered_attributes:
          type: object
          additionalProperties:
            type: string
        time_unix:
          type: string
          format: date-time
        value:
          type: number
          format: float
        span_id:
          type: string
        trace_id:
          type: string
    MetricValueAtQuantile:
      type: object
      properties:
        quantile:
          type: number
          format: float
        value:
          type: number
          format: float
    ApiError:
      type: object
      properties:
        code:
          type: integer
          description: a custom Lumos error code
          format: uint64
          example: 1400
        field:
          type: string
          description: the field that this error is associated with, if applicable
          example: name
        description:
          type: string
          description: a description for this error
          example: A descriptive error message
      required:
        - description
  responses:
    Forbidden:
      description: The request is forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    cookieAuth:
      type: apiKey
      in: cookie
      name: __lumos_session

````