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

# Get Monitor Metrics

> Detailed metrics for a single monitor, including runs summary, latency stats, recent failures, and error distribution.



## OpenAPI

````yaml https://hub.griff.services/documentation/json get /metrics/monitors/{monitorId}
openapi: 3.1.0
info:
  title: Griffin Hub API
  description: API for managing and running test monitors
  version: 1.0.0
servers:
  - url: https://hub.griff.services
    description: Local development server
  - url: http://localhost:3000
    description: Local development server
security:
  - bearerAuth: []
tags:
  - name: monitors
    description: Test monitor management endpoints
  - name: runs
    description: Test run management endpoints
  - name: metrics
    description: Metrics and health summary endpoints
paths:
  /metrics/monitors/{monitorId}:
    get:
      tags:
        - metrics
      summary: Get Monitor Metrics
      description: >-
        Detailed metrics for a single monitor, including runs summary, latency
        stats, recent failures, and error distribution.
      parameters:
        - schema:
            type: string
          in: query
          name: environment
          required: false
        - schema:
            type: string
            enum:
              - 1h
              - 6h
              - 24h
              - 7d
              - 30d
          in: query
          name: period
          required: false
        - schema:
            type: string
          in: path
          name: monitorId
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - monitorId
                      - monitorName
                      - environment
                      - period
                      - periodStart
                      - periodEnd
                      - status
                      - runs
                      - latency
                      - uptimePercent
                      - recentFailures
                      - errorDistribution
                    properties:
                      monitorId:
                        type: string
                      monitorName:
                        type: string
                      environment:
                        type: string
                      period:
                        type: string
                        enum:
                          - 1h
                          - 6h
                          - 24h
                          - 7d
                          - 30d
                      periodStart:
                        type: string
                        format: date-time
                      periodEnd:
                        type: string
                        format: date-time
                      status:
                        type: string
                        enum:
                          - healthy
                          - degraded
                          - failing
                      runs:
                        type: object
                        required:
                          - total
                          - successful
                          - failed
                          - successRate
                        properties:
                          total:
                            type: number
                          successful:
                            type: number
                          failed:
                            type: number
                          successRate:
                            type: number
                      latency:
                        type: object
                        properties:
                          minDurationMs:
                            type: number
                          avgDurationMs:
                            type: number
                          p50DurationMs:
                            type: number
                          p95DurationMs:
                            type: number
                          p99DurationMs:
                            type: number
                          maxDurationMs:
                            type: number
                      uptimePercent:
                        type: number
                      lastRun:
                        type: object
                        required:
                          - id
                          - status
                          - success
                          - startedAt
                        properties:
                          id:
                            type: string
                          status:
                            type: string
                          success:
                            type: boolean
                          durationMs:
                            type: number
                          startedAt:
                            type: string
                            format: date-time
                      recentFailures:
                        type: array
                        items:
                          type: object
                          required:
                            - id
                            - startedAt
                            - errors
                          properties:
                            id:
                              type: string
                            startedAt:
                              type: string
                              format: date-time
                            errors:
                              type: array
                              items:
                                type: string
                      errorDistribution:
                        type: object
                        additionalProperties:
                          type: number
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '502':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '503':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '504':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````