---
title: "Get Metrics For Destination"
method: GET
path: "/destinations/{destination_id}/metrics"
tags: ["Destinations"]
---

# Get Metrics For Destination

`GET /destinations/{destination_id}/metrics`

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"
            }
        }
    }
    ```

## Path parameters

- `destination_id` string, required

## Query parameters

- `time_type` 'timeseries' | 'timesummary' | 'latest' — Type of the metrics.
- `time_interval` integer — The interval between each metrics data point.
- `time_unit` 'minute' | 'hour' | 'day' | 'week' | 'month' — 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.
- `timestamp_from` string, date-time, nullable — Start time of the metrics data in UTC timezone. If not provided, start time is set to 24 hours before the current time.
- `timestamp_to` string, date-time, nullable — End time of the metrics data in UTC timezone. If not provided, end time is set to the current time.

## Response `200`

Successful Response

- union
  - DestinationTimeseriesMetricsWithMetadata — Destination timeseries metrics with metadata.
    - `data` DestinationTimeseriesMetrics, required — Destination timeseries metrics.
      - `latency` TimeseriesEntry[], nullable
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `partitionCount` TimeseriesEntry[]
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `putBatchMaxTimeMs` TimeseriesEntry[]
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `recordsLag` TimeseriesEntry[], nullable
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `sinkRecordReadTotal` TimeseriesEntry[]
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `recordsConsumedTotal` TimeseriesEntry[]
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `sinkRecordSendTotal` TimeseriesEntry[], nullable
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `bytesConsumedTotal` TimeseriesEntry[]
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
      - `qa_exact_count_diff` TimeseriesEntry[]
        - `value` union, required — The metric value at this timestamp
          - integer
          - number
        - `timestamp` string, required — ISO 8601 timestamp for this data point
    - `metadata` object, required
  - DestinationLatestMetricsWithMetadata — Destination latest metrics with metadata.
    - `data` DestinationLatestMetrics, required — Destination latest metrics.
      - `connector_status` string, nullable
      - `latency` union
        - integer
        - number
      - `partitionCount` union
        - integer
        - number
      - `putBatchMaxTimeMs` union
        - integer
        - number
      - `recordsLag` union
        - integer
        - number
      - `sinkRecordReadTotal` union
        - integer
        - number
      - `recordsConsumedTotal` union
        - integer
        - number
      - `sinkRecordSendTotal` union
        - integer
        - number
      - `bytesConsumedTotal` union
        - integer
        - number
      - `qa_exact_count_diff` union
        - integer
        - number
    - `metadata` object, required
  - DestinationTimesummaryMetricsWithMetadata — Destination timesummary metrics with metadata.
    - `data` DestinationTimesummaryMetrics, required — Destination timesummary metrics.
      - `connector_status` string, nullable
      - `latency` union
        - integer
        - number
      - `partitionCount` union
        - integer
        - number
      - `putBatchMaxTimeMs` union
        - integer
        - number
      - `recordsConsumedTotal` union
        - integer
        - number
      - `recordsLag` union
        - integer
        - number
      - `sinkRecordReadTotal` union
        - integer
        - number
      - `sinkRecordSendTotal` union
        - integer
        - number
      - `bytesConsumedTotal` union
        - integer
        - number
      - `qa_exact_count_diff` union
        - integer
        - number
    - `metadata` object, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/streamkap/apis/streamkap-rest-api.md) · [All operations](https://skmtc.net/streamkap/apis/streamkap-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/streamkap/streamkap-rest-api/revisions/e9ce8221bac6/schema)
