curl -X GET \
https://api.upstash.com/v2/kafka/stats/topic/:id \
-u 'EMAIL:API_KEY'
import requests
response = requests.get('https://api.upstash.com/v2/kafka/stats/topic/:id', auth=('EMAIL', 'API_KEY'))
response.content
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.upstash.com/v2/kafka/stats/topic/: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 12:05:11",
"y": 0
}
...
],
"produce_throughput": [
{
"x": "2022-02-07 12:05:11",
"y": 0
}
...
],
"consume_throughput": [
{
"x": "2022-02-07 12:05:11",
"y": 0
}
...
],
"diskusage": [
{
"x": "2022-02-07 12:20:11",
"y": 0
}
...
],
"total_monthly_storage": 0,
"total_monthly_produce": 0,
"total_monthly_consume": 0
}
Topics
Get Kafka Topic Stats
This endpoint gets detailed stats of a Kafka cluster.
GET
/
v2
/
Kafka
/
stats
/
topic
/
{id}
curl -X GET \
https://api.upstash.com/v2/kafka/stats/topic/:id \
-u 'EMAIL:API_KEY'
import requests
response = requests.get('https://api.upstash.com/v2/kafka/stats/topic/:id', auth=('EMAIL', 'API_KEY'))
response.content
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.upstash.com/v2/kafka/stats/topic/: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 12:05:11",
"y": 0
}
...
],
"produce_throughput": [
{
"x": "2022-02-07 12:05:11",
"y": 0
}
...
],
"consume_throughput": [
{
"x": "2022-02-07 12:05:11",
"y": 0
}
...
],
"diskusage": [
{
"x": "2022-02-07 12:20:11",
"y": 0
}
...
],
"total_monthly_storage": 0,
"total_monthly_produce": 0,
"total_monthly_consume": 0
}
URL Parameters
string
required
The ID of the Kafka topic
Response Parameters
Object
Object
Object
Object
int
Average storage size of the Kafka topic in the current month
int
Total number of monthly produced messages to the Kafka topic
int
Total number of monthly consumed messages from the Kafka topic
curl -X GET \
https://api.upstash.com/v2/kafka/stats/topic/:id \
-u 'EMAIL:API_KEY'
import requests
response = requests.get('https://api.upstash.com/v2/kafka/stats/topic/:id', auth=('EMAIL', 'API_KEY'))
response.content
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.upstash.com/v2/kafka/stats/topic/: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 12:05:11",
"y": 0
}
...
],
"produce_throughput": [
{
"x": "2022-02-07 12:05:11",
"y": 0
}
...
],
"consume_throughput": [
{
"x": "2022-02-07 12:05:11",
"y": 0
}
...
],
"diskusage": [
{
"x": "2022-02-07 12:20:11",
"y": 0
}
...
],
"total_monthly_storage": 0,
"total_monthly_produce": 0,
"total_monthly_consume": 0
}
Was this page helpful?
⌘I