> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-fix-issues-on-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Kafka Cluster Stats

> This endpoint gets detailed stats of a database.

## URL Parameters

<ParamField path="id" type="string" required>
  The ID of the Kafka cluster
</ParamField>

## Response Parameters

<ResponseField name="throughput" type="Object">
  <Expandable title="Properties">
    <ResponseField name="x" type="string">
      Timestamp indicating when the measurement was taken.
    </ResponseField>

    <ResponseField name="y" type="int">
      Number of monthly messages in kafka cluster
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="produce_throughput" type="Object">
  <Expandable title="Properties">
    <ResponseField name="x" type="string">
      Timestamp indicating when the measurement was taken.
    </ResponseField>

    <ResponseField name="y" type="int">
      Number of monthly messages produced in kafka cluster
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="consume_throughput" type="Object">
  <Expandable title="Properties">
    <ResponseField name="x" type="string">
      Timestamp indicating when the measurement was taken.
    </ResponseField>

    <ResponseField name="y" type="int">
      Number of monthly messages consumed in kafka cluster
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="diskusage" type="Object">
  <Expandable title="Properties">
    <ResponseField name="x" type="string">
      Timestamp indicating when the measurement was taken.
    </ResponseField>

    <ResponseField name="y" type="int">
      Total disk usage of the kafka cluster
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="days" type="Array<string>">
  String representation of last 5 days of the week starting from the current day
</ResponseField>

<ResponseField name="dailyproduce" type="int">
  Last 5 days daily produced message count in kafka cluster
</ResponseField>

<ResponseField name="dailyconsume" type="int">
  Last 5 days daily consumed message count in kafka cluster
</ResponseField>

<ResponseField name="total_monthly_storage" type="int">
  Average storage size of the kafka cluster in the current month
</ResponseField>

<ResponseField name="total_monthly_billing" type="int">
  Total cost of the kafka cluster in current month
</ResponseField>

<ResponseField name="total_monthly_produce" type="int">
  Total number of produced message in current month
</ResponseField>

<ResponseField name="total_monthly_consume" type="int">
  Total number of consumed message in current month
</ResponseField>

<RequestExample>
  ```shell curl
  curl -X GET \
    https://api.upstash.com/v2/kafka/stats/cluster/:id \
    -u 'EMAIL:API_KEY'
  ```

  ```python Python
  import requests

  response = requests.get('https://api.upstash.com/v2/kafka/stats/cluster/:id', auth=('EMAIL', 'API_KEY'))
  response.content
  ```

  ```go Go
  client := &http.Client{}
  req, err := http.NewRequest("GET", "https://api.upstash.com/v2/kafka/stats/cluster/:id", nil)
  if err != nil {
      log.Fatal(err)
  }
  req.SetBasicAuth("email", "api_key")
  resp, err := client.Do(req)
  if err != nil {
      log.Fatal(err)
  }
  bodyText, err := ioutil.ReadAll(resp.Body)
  if err != nil {
      log.Fatal(err)
  }
  fmt.Printf("%s\n", bodyText);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK
  {
    "throughput": [
      {
        "x": "2022-02-07 11:30:28",
        "y": 0
      }
      ...
    ],
    "produce_throughput": [
      {
        "x": "2022-02-07 11:30:28",
        "y": 0
      }
      ...
    ],
    "consume_throughput": [
      {
        "x": "2022-02-07 11:30:28",
        "y": 0
      }
      ...
    ],
    "diskusage": [
      {
        "x": "2022-02-07 11:45:28",
        "y": 0
      }
      ...
    ],
    "days": [
      "Thursday",
      "Friday",
      "Saturday",
      "Sunday",
      "Monday"
    ],
    "dailyproduce": [
      {
        "x": "2022-02-07 11:30:28.937259962 +0000 UTC",
        "y": 0
      }
      ...
    ],
    "dailyconsume": [
      {
        "x": "2022-02-07 11:30:28.937256776 +0000 UTC",
        "y": 0
      }
      ...
    ],
    "total_monthly_storage": 0,
    "total_monthly_billing": 0,
    "total_monthly_produce": 0,
    "total_monthly_consume": 0
  }
  ```
</ResponseExample>
