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

# Get Metrics For Destination

> Retrieve metrics for a specific destination based on the provided parameters.

    This endpoint returns metrics data for a given destination ID, allowing flexibility in the type of metrics
    returned (timeseries, timesummary, or latest), the time interval, and the time range. The response includes
    metadata about the metrics and is tailored to the specified time type.

    ### Parameters:
    - **destination_id** (path): The unique identifier of the destination for which metrics are requested.
    - **time_type** (query): Specifies the type of metrics to return:
        - `timeseries`: Metrics over a series of time intervals.
        - `timesummary`: Aggregated summary of metrics over the specified period.
        - `latest`: The most recent metrics available.
    - **time_interval** (query): The numeric interval between metrics data points (e.g., 1, 2, etc.).
    - **time_unit** (query): The unit of time for the interval (e.g., minute, hour, day, week, month).
        Combined with `time_interval` to define the granularity (e.g., 1 hour, 2 days).
    - **timestamp_from** (query, optional): The start time of the metrics data in UTC (ISO 8601 format, e.g.,
        `2025-03-02T07:10:15Z`). Defaults to 24 hours before the current time if not provided.
    - **timestamp_to** (query, optional): The end time of the metrics data in UTC (ISO 8601 format).
        Defaults to the current time if not provided.

    ### Authentication:
    - Requires a valid user token with the `read:destination_metrics` permission.

    ### Returns:
    Depending on the `time_type`:
    - `DestinationTimeseriesMetricsWithMetadata`: For `timeseries` metrics.
    - `DestinationTimesummaryMetricsWithMetadata`: For `timesummary` metrics.
    - `DestinationLatestMetricsWithMetadata`: For `latest` metrics.

    ### Errors:
    - **400 Bad Request**: Invalid parameters or unexpected errors during processing.
    - **404 Not Found**: Metrics not found for the specified destination or connector plugin issues.
    - **500 Internal Server Error**: Connector plugin not found or misconfigured.

    ### Example Request:
    ```http
    https://api.streamkap.com/destinations/67ad6e0af08a2365c729ba79/metrics?time_type=latest&time_interval=2&time_unit=hour&timestamp_from=2025-03-02T07:10:15Z&timestamp_to=2025-03-04T07:10:15Z
    ```
    ### Example Response:
    ```json
    {
        "data": {
            "connector_status": "Active",
            "latency": 0.0,
            "partitionCount": 1.0,
            "putBatchMaxTimeMs": 0.0,
            "recordsLag": 0.0,
            "sinkRecordReadTotal": 101.0,
            "recordsConsumedTotal": null,
            "sinkRecordSendTotal": 65.0,
            "bytesConsumedTotal": null,
        },
        "metadata": {
            "connector_status": {
                "name": "Destination State",
                "unit": "enum"
            },
            "latency": {
                "name": "Destination Latency",
                "unit": "milliseconds"
            },
            "sinkRecordReadTotal": {
                "name": "Events (Received)",
                "unit": "count"
            },
            "sinkRecordSendTotal": {
                "name": "Events (Sent)",
                "unit": "count"
            },
            "partitionCount": {
                "name": "Partition Count",
                "unit": "count"
            },
            "putBatchMaxTimeMs": {
                "name": "Put Batch Max Time",
                "unit": "milliseconds"
            },
            "bytesConsumedTotal": {
                "name": "Volume",
                "unit": "bytes"
            },
            "recordsConsumedTotal": {
                "name": "Consumed Events",
                "unit": "count"
            },
            "recordsLag": {
                "name": "Lag in Events",
                "unit": "count"
            }
        }
    }
    ```



## OpenAPI

````yaml /openapi/openapi.json get /destinations/{destination_id}/metrics
openapi: 3.1.0
info:
  title: Streamkap REST API
  description: >-
    The Streamkap REST API allows you to programmatically manage your CDC
    pipelines, sources, destinations, transforms, and more.


    Authenticate using a bearer token obtained from the [Access
    Token](/api-reference/auth/access-token) endpoint with your API client
    credentials.
  contact:
    name: Streamkap Support
    url: https://streamkap.com/
    email: support@streamkap.com
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api.streamkap.com
    description: Production
security: []
tags:
  - name: Alerts
    description: Manage alert subscribers, preferences, and notification credentials.
  - name: Authentication
    description: Obtain and refresh access tokens, manage client credentials and roles.
  - name: Billing
    description: Retrieve usage metrics, summaries, and export billing data.
  - name: Consumer Groups
    description: List, inspect, and reset Kafka consumer group offsets.
  - name: Dashboard
    description: Retrieve organisation-level statistics and overview data.
  - name: Destinations
    description: Create, configure, and manage data destinations and their lifecycle.
  - name: Kafka Access
    description: Manage Kafka users and their access permissions.
  - name: Logs
    description: Query and summarise system logs.
  - name: Pipelines
    description: Create, configure, and manage CDC pipelines and their lifecycle.
  - name: Project Keys
    description: Manage project keys that bundle API credentials and optional Kafka access.
  - name: Schema Registry
    description: Browse schema subjects, versions, and retrieve schema definitions.
  - name: Services
    description: View and switch service metadata.
  - name: Sources
    description: >-
      Create, configure, and manage data sources, snapshots, and their
      lifecycle.
  - name: Tags
    description: Create, update, and manage resource tags for organisation.
  - name: Topics
    description: Browse topic details, statistics, configurations, metrics, and messages.
  - name: Transforms
    description: >-
      Create, deploy, and manage data transforms, unit tests, and implementation
      details.
paths:
  /destinations/{destination_id}/metrics:
    get:
      tags:
        - Destinations
      summary: Get Metrics For Destination
      description: >-
        Retrieve metrics for a specific destination based on the provided
        parameters.

            This endpoint returns metrics data for a given destination ID, allowing flexibility in the type of metrics
            returned (timeseries, timesummary, or latest), the time interval, and the time range. The response includes
            metadata about the metrics and is tailored to the specified time type.

            ### Parameters:
            - **destination_id** (path): The unique identifier of the destination for which metrics are requested.
            - **time_type** (query): Specifies the type of metrics to return:
                - `timeseries`: Metrics over a series of time intervals.
                - `timesummary`: Aggregated summary of metrics over the specified period.
                - `latest`: The most recent metrics available.
            - **time_interval** (query): The numeric interval between metrics data points (e.g., 1, 2, etc.).
            - **time_unit** (query): The unit of time for the interval (e.g., minute, hour, day, week, month).
                Combined with `time_interval` to define the granularity (e.g., 1 hour, 2 days).
            - **timestamp_from** (query, optional): The start time of the metrics data in UTC (ISO 8601 format, e.g.,
                `2025-03-02T07:10:15Z`). Defaults to 24 hours before the current time if not provided.
            - **timestamp_to** (query, optional): The end time of the metrics data in UTC (ISO 8601 format).
                Defaults to the current time if not provided.

            ### Authentication:
            - Requires a valid user token with the `read:destination_metrics` permission.

            ### Returns:
            Depending on the `time_type`:
            - `DestinationTimeseriesMetricsWithMetadata`: For `timeseries` metrics.
            - `DestinationTimesummaryMetricsWithMetadata`: For `timesummary` metrics.
            - `DestinationLatestMetricsWithMetadata`: For `latest` metrics.

            ### Errors:
            - **400 Bad Request**: Invalid parameters or unexpected errors during processing.
            - **404 Not Found**: Metrics not found for the specified destination or connector plugin issues.
            - **500 Internal Server Error**: Connector plugin not found or misconfigured.

            ### Example Request:
            ```http
            https://api.streamkap.com/destinations/67ad6e0af08a2365c729ba79/metrics?time_type=latest&time_interval=2&time_unit=hour&timestamp_from=2025-03-02T07:10:15Z&timestamp_to=2025-03-04T07:10:15Z
            ```
            ### Example Response:
            ```json
            {
                "data": {
                    "connector_status": "Active",
                    "latency": 0.0,
                    "partitionCount": 1.0,
                    "putBatchMaxTimeMs": 0.0,
                    "recordsLag": 0.0,
                    "sinkRecordReadTotal": 101.0,
                    "recordsConsumedTotal": null,
                    "sinkRecordSendTotal": 65.0,
                    "bytesConsumedTotal": null,
                },
                "metadata": {
                    "connector_status": {
                        "name": "Destination State",
                        "unit": "enum"
                    },
                    "latency": {
                        "name": "Destination Latency",
                        "unit": "milliseconds"
                    },
                    "sinkRecordReadTotal": {
                        "name": "Events (Received)",
                        "unit": "count"
                    },
                    "sinkRecordSendTotal": {
                        "name": "Events (Sent)",
                        "unit": "count"
                    },
                    "partitionCount": {
                        "name": "Partition Count",
                        "unit": "count"
                    },
                    "putBatchMaxTimeMs": {
                        "name": "Put Batch Max Time",
                        "unit": "milliseconds"
                    },
                    "bytesConsumedTotal": {
                        "name": "Volume",
                        "unit": "bytes"
                    },
                    "recordsConsumedTotal": {
                        "name": "Consumed Events",
                        "unit": "count"
                    },
                    "recordsLag": {
                        "name": "Lag in Events",
                        "unit": "count"
                    }
                }
            }
            ```
      operationId: getDestinationMetrics
      parameters:
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            title: Destination Id
        - name: time_type
          in: query
          required: false
          schema:
            enum:
              - timeseries
              - timesummary
              - latest
            type: string
            title: Time Type
            description: Type of the metrics.
            examples:
              - latest
            default: latest
          description: Type of the metrics.
        - name: time_interval
          in: query
          required: false
          schema:
            type: integer
            title: Time Interval
            description: The interval between each metrics data point.
            examples:
              - 1
            default: 1
          description: The interval between each metrics data point.
        - name: time_unit
          in: query
          required: false
          schema:
            enum:
              - minute
              - hour
              - day
              - week
              - month
            type: string
            title: Time Unit
            description: >-
              The unit of the time interval. Combined with time_interval to
              determine the interval between each metrics data point. For
              example, if time_interval=1 and time_unit=hour, the interval
              between each metrics data point is 1 hour.
            examples:
              - hour
            default: hour
          description: >-
            The unit of the time interval. Combined with time_interval to
            determine the interval between each metrics data point. For example,
            if time_interval=1 and time_unit=hour, the interval between each
            metrics data point is 1 hour.
        - name: timestamp_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Start Time
            description: >-
              Start time of the metrics data in UTC timezone. If not provided,
              start time is set to 24 hours before the current time.
            examples:
              - '2025-03-02T07:10:15Z'
          description: >-
            Start time of the metrics data in UTC timezone. If not provided,
            start time is set to 24 hours before the current time.
        - name: timestamp_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: End Time
            description: >-
              End time of the metrics data in UTC timezone. If not provided, end
              time is set to the current time.
            examples:
              - '2025-03-04T07:10:15Z'
          description: >-
            End time of the metrics data in UTC timezone. If not provided, end
            time is set to the current time.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: >-
                      #/components/schemas/DestinationTimeseriesMetricsWithMetadata
                  - $ref: '#/components/schemas/DestinationLatestMetricsWithMetadata'
                  - $ref: >-
                      #/components/schemas/DestinationTimesummaryMetricsWithMetadata
                title: Response Getdestinationmetrics
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggHTTPAuthentication: []
components:
  schemas:
    DestinationTimeseriesMetricsWithMetadata:
      properties:
        data:
          $ref: '#/components/schemas/DestinationTimeseriesMetrics'
        metadata:
          additionalProperties:
            additionalProperties:
              type: string
            type: object
          type: object
          title: Metadata
      additionalProperties: true
      type: object
      required:
        - data
        - metadata
      title: DestinationTimeseriesMetricsWithMetadata
      description: Destination timeseries metrics with metadata.
    DestinationLatestMetricsWithMetadata:
      properties:
        data:
          $ref: '#/components/schemas/DestinationLatestMetrics'
        metadata:
          additionalProperties:
            additionalProperties:
              type: string
            type: object
          type: object
          title: Metadata
      additionalProperties: true
      type: object
      required:
        - data
        - metadata
      title: DestinationLatestMetricsWithMetadata
      description: Destination latest metrics with metadata.
    DestinationTimesummaryMetricsWithMetadata:
      properties:
        data:
          $ref: '#/components/schemas/DestinationTimesummaryMetrics'
        metadata:
          additionalProperties:
            additionalProperties:
              type: string
            type: object
          type: object
          title: Metadata
      additionalProperties: true
      type: object
      required:
        - data
        - metadata
      title: DestinationTimesummaryMetricsWithMetadata
      description: Destination timesummary metrics with metadata.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DestinationTimeseriesMetrics:
      properties:
        latency:
          anyOf:
            - items:
                $ref: '#/components/schemas/TimeseriesEntry'
              type: array
            - type: 'null'
          title: Latency
          default: []
        partitionCount:
          items:
            $ref: '#/components/schemas/TimeseriesEntry'
          type: array
          title: Partitioncount
          default: []
        putBatchMaxTimeMs:
          items:
            $ref: '#/components/schemas/TimeseriesEntry'
          type: array
          title: Putbatchmaxtimems
          default: []
        recordsLag:
          anyOf:
            - items:
                $ref: '#/components/schemas/TimeseriesEntry'
              type: array
            - type: 'null'
          title: Recordslag
          default: []
        sinkRecordReadTotal:
          items:
            $ref: '#/components/schemas/TimeseriesEntry'
          type: array
          title: Sinkrecordreadtotal
          default: []
        recordsConsumedTotal:
          items:
            $ref: '#/components/schemas/TimeseriesEntry'
          type: array
          title: Recordsconsumedtotal
          default: []
        sinkRecordSendTotal:
          anyOf:
            - items:
                $ref: '#/components/schemas/TimeseriesEntry'
              type: array
            - type: 'null'
          title: Sinkrecordsendtotal
          default: []
        bytesConsumedTotal:
          items:
            $ref: '#/components/schemas/TimeseriesEntry'
          type: array
          title: Bytesconsumedtotal
          default: []
        qa_exact_count_diff:
          items:
            $ref: '#/components/schemas/TimeseriesEntry'
          type: array
          title: Qa Exact Count Diff
          default: []
      additionalProperties: true
      type: object
      title: DestinationTimeseriesMetrics
      description: Destination timeseries metrics.
    DestinationLatestMetrics:
      properties:
        connector_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Status
        latency:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Latency
        partitionCount:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Partitioncount
        putBatchMaxTimeMs:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Putbatchmaxtimems
        recordsLag:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Recordslag
        sinkRecordReadTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Sinkrecordreadtotal
        recordsConsumedTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Recordsconsumedtotal
        sinkRecordSendTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Sinkrecordsendtotal
        bytesConsumedTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Bytesconsumedtotal
        qa_exact_count_diff:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Qa Exact Count Diff
      additionalProperties: true
      type: object
      title: DestinationLatestMetrics
      description: Destination latest metrics.
    DestinationTimesummaryMetrics:
      properties:
        connector_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Status
        latency:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Latency
        partitionCount:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Partitioncount
        putBatchMaxTimeMs:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Putbatchmaxtimems
        recordsConsumedTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Recordsconsumedtotal
        recordsLag:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Recordslag
        sinkRecordReadTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Sinkrecordreadtotal
        sinkRecordSendTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Sinkrecordsendtotal
        bytesConsumedTotal:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Bytesconsumedtotal
        qa_exact_count_diff:
          anyOf:
            - type: integer
            - type: number
            - type: 'null'
          title: Qa Exact Count Diff
      additionalProperties: true
      type: object
      title: DestinationTimesummaryMetrics
      description: Destination timesummary metrics.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TimeseriesEntry:
      properties:
        value:
          anyOf:
            - type: integer
            - type: number
          title: Value
          description: The metric value at this timestamp
        timestamp:
          type: string
          title: Timestamp
          description: ISO 8601 timestamp for this data point
      additionalProperties: true
      type: object
      required:
        - value
        - timestamp
      title: TimeseriesEntry
      description: A single data point in a time series.
  securitySchemes:
    FronteggHTTPAuthentication:
      type: http
      scheme: bearer

````