Size in Records
The metric provides the number of messages present in a partition of desired stream on each Kafka broker at any given time.
Basic usage
Please refer to the example partition size in records metric provided in the API docs
This request is asking for the size in messages of the partition 0 of stream payment-events-stream on environment dev between 2022-10-18T12:20:00Z and 2022-10-18T13:00:00Z with the step-size of 10 minutes.
Basic Request
{
  "metric": "io.axual.partition/size_records",
  "stepSize": "PT10M",
  "timeWindow": "2022-10-18T12:20:00Z/2022-10-18T13:00:00Z",
  "filter": {
    "type": "AND",
    "filters": [
      {
        "type": "FIELD",
        "field": "environment",
        "operation": "EQUALS",
        "value": "dev"
      },
      {
        "type": "FIELD",
        "field": "stream",
        "operation": "EQUALS",
        "value": "payment-events-stream"
      },
      {
        "type": "FIELD",
        "field": "partition",
        "operation": "EQUALS",
        "value": "0"
      }
    ]
  }
}
The below part of sample response, represents the size of partition 0 on each kafka broker (pod) in messages.
Basic Response
{
  "type": "UNGROUPED",
  "dataPoints": [
    {
      "timestamp": "2022-10-18T12:30:00",
      "value": 0,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-0",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    },
    {
      "timestamp": "2022-10-18T12:40:00",
      "value": 0,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-0",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    },
    {
      "timestamp": "2022-10-18T12:50:00",
      "value": 270,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-0",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    },
    {
      "timestamp": "2022-10-18T13:00:00",
      "value": 630,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-0",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    },
    {
      "timestamp": "2022-10-18T12:30:00",
      "value": 0,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-2",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    },
    {
      "timestamp": "2022-10-18T12:40:00",
      "value": 0,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-2",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    },
    {
      "timestamp": "2022-10-18T12:50:00",
      "value": 270,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-2",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    },
    {
      "timestamp": "2022-10-18T13:00:00",
      "value": 630,
      "labels": {
        "axual_cluster": "jupiter",
        "partition": "0",
        "pod": "jupiter-kafka-2",
        "topic": "axual-qa-dev-payment-events-stream"
      },
      "unit": "Records"
    }
  ]
}
This metric could be used to know how many messages stored in each partition, how they distributed among partitions and how many messages are produced per time unit.