curl -X GET \
https://api.upstash.com/v2/kafka/stats/cluster/:id \
-u 'EMAIL:API_KEY'
import requests
response = requests.get('https://api.upstash.com/v2/kafka/stats/cluster/:id', auth=('EMAIL', 'API_KEY'))
response.content
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);
{
"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
}
Clusters
Get Kafka Cluster Stats
This endpoint gets detailed stats of a database.
GET
/
v2
/
kafka
/
stats
/
topic
/
{id}
curl -X GET \
https://api.upstash.com/v2/kafka/stats/cluster/:id \
-u 'EMAIL:API_KEY'
import requests
response = requests.get('https://api.upstash.com/v2/kafka/stats/cluster/:id', auth=('EMAIL', 'API_KEY'))
response.content
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);
{
"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
}
URL Parameters
string
required
The ID of the Kafka cluster
Response Parameters
Object
Object
Object
Object
Array<string>
String representation of last 5 days of the week starting from the current day
int
Last 5 days daily produced message count in kafka cluster
int
Last 5 days daily consumed message count in kafka cluster
int
Average storage size of the kafka cluster in the current month
int
Total cost of the kafka cluster in current month
int
Total number of produced message in current month
int
Total number of consumed message in current month
curl -X GET \
https://api.upstash.com/v2/kafka/stats/cluster/:id \
-u 'EMAIL:API_KEY'
import requests
response = requests.get('https://api.upstash.com/v2/kafka/stats/cluster/:id', auth=('EMAIL', 'API_KEY'))
response.content
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);
{
"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
}
Was this page helpful?
⌘I