Skills
Log in

Get service metrics

Get metrics for a service

Required permission

Project > Services > Deployment > View Observability

Path parameters

    • projectId

      string required
      ID of the project
    • serviceId

      string required
      ID of the service

Query parameters

    • queryType

      string
      Selects metrics for specified timestamp.
      one of
      range, single
    • metricTypes

      string
      Type of metric. Multiple metric types can be selected by specifying the query parameter repeatedly.
      one of
      cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
    • startTime

      string
      Fetch metrics generated after this timestamp. Only valid for queryType: `range`.
    • endTime

      string
      Fetch metrics generated before this timestamp. Only valid for queryType: `range`.
    • duration

      integer
      Range duration in seconds. If set, only one of `startTime` or `endTime` can be set.
      max
      2592000
    • containerName

      string
      Limits metrics to a specific container.
      min length
      3
      max length
      64
    • deploymentId

      string
      Limits metrics to a specific deployment
    • time

      string
      Fetch metrics at this timestamp. If not provided will use current time. Only valid for queryType: `single`.

Response body

  • {object}
    Response object.
    • data

      {object} required
      Result data.
      • cpu

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • memory

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • networkIngress

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • networkEgress

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • tcpConnectionsOpen

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • diskUsage

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • requests

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • http4xxResponses

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • http5xxResponses

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • bandwidth

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required
      • bandwidthVolume

        {object}
        • metricInfo

          {object}
          • metricId

            string required
            Type of metric to fetch
            one of
            cpu, memory, networkIngress, networkEgress, tcpConnectionsOpen, diskUsage, requests, http4xxResponses, http5xxResponses, bandwidth, bandwidthVolume
          • metricUnit

            string required
            Wire unit for every sample field. 1000 millicores equal one CPU core. Memory bytes are not display megabytes.
            one of
            pct, vCPU, mb, kbps, rps, count
          • metricResolution

            number
        • values

          [array] required
          • {object}
            • metadata

              {object}
              • containerId

                string required
                Container identifier.
              • volumeId

                string
            • data

              [array] required
              • {object}
                • value

                  number required
                • ts

                  string required

GET /v1/projects/{projectId}/services/{serviceId}/metrics

GET /v1/teams/{teamId}/projects/{projectId}/services/{serviceId}/metrics

curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request GET \
  "https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/metrics?queryType=range&startTime=2023-02-16T14%3A00%3A00.000Z&endTime=2023-02-16T15%3A00%3A00.000Z&duration=600&containerName=my-container-67d6d748c5-kgvwh&deploymentId=latest&time=2023-02-16T14%3A00%3A00.000Z"

Example response

200 OK

List of metrics values

JSON

{
  "data": {
    "cpu": {
      "metricInfo": {
        "metricId": "cpu",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "memory": {
      "metricInfo": {
        "metricId": "memory",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "networkIngress": {
      "metricInfo": {
        "metricId": "networkIngress",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "networkEgress": {
      "metricInfo": {
        "metricId": "networkEgress",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "tcpConnectionsOpen": {
      "metricInfo": {
        "metricId": "tcpConnectionsOpen",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "diskUsage": {
      "metricInfo": {
        "metricId": "diskUsage",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "requests": {
      "metricInfo": {
        "metricId": "requests",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "http4xxResponses": {
      "metricInfo": {
        "metricId": "http4xxResponses",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "http5xxResponses": {
      "metricInfo": {
        "metricId": "http5xxResponses",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "bandwidth": {
      "metricInfo": {
        "metricId": "bandwidth",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    },
    "bandwidthVolume": {
      "metricInfo": {
        "metricId": "bandwidthVolume",
        "metricUnit": "pct",
        "metricResolution": 10
      },
      "values": [
        {
          "metadata": {
            "containerId": "nginx-669cc865b7-5458n",
            "volumeId": "data-volume-1"
          },
          "data": [
            {
              "value": 0.5,
              "ts": "2023-03-21T15:01:17.310Z"
            }
          ]
        }
      ]
    }
  }
}

© 2026 Northflank Ltd. All rights reserved.

northflank.com / Terms / Privacy / feedback@northflank.com