Skip to content

Celery Stats

Operations Summary

Method Endpoint Description
GET /api/celery-stats/ Get Celery worker statistics

Get Celery worker statistics

Provides a comprehensive snapshot of all Celery workers' status.

This endpoint returns detailed information about: - active: Tasks currently being executed by workers - scheduled: Tasks scheduled for future execution (with ETA) - reserved: Tasks received by workers but not yet started - revoked: Task IDs that have been cancelled/revoked - query_task: Results of task queries (if any) - stats: Detailed worker statistics including uptime, pool info, and broker connection

Each field is a dictionary where keys are worker names (e.g., 'celery@hostname'). If no workers are available, fields will be null.

Requires support user permissions.

1
2
3
4
http \
  GET \
  https://api.example.com/api/celery-stats/ \
  Authorization:"Token YOUR_API_TOKEN"
1
2
3
4
5
6
7
8
9
from waldur_api_client.client import AuthenticatedClient
from waldur_api_client.api.celery_stats import celery_stats_retrieve # (1)

client = AuthenticatedClient(
    base_url="https://api.example.com", token="YOUR_API_TOKEN"
)
response = celery_stats_retrieve.sync(client=client)

print(response)
  1. API Source: celery_stats_retrieve
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import { celeryStatsRetrieve } from 'waldur-js-client';

try {
  const response = await celeryStatsRetrieve({
  auth: "Token YOUR_API_TOKEN"
});
  console.log('Success:', response);
} catch (error) {
  console.error('Error:', error);
}

200 -

Field Type Description
active object (free-form) Currently executing tasks per worker. Keys are worker names, values are lists of active tasks.
scheduled object (free-form) Tasks scheduled for future execution per worker. Keys are worker names, values are lists of scheduled tasks with ETA.
reserved object (free-form) Tasks that have been received but not yet started per worker. Keys are worker names, values are lists of reserved tasks.
revoked object (free-form) IDs of revoked (cancelled) tasks per worker. Keys are worker names, values are lists of task IDs.
query_task object (free-form) Query results for specific tasks. May be null if no query was performed.
stats object (free-form) Detailed statistics per worker including uptime, pool info, and resource usage. Keys are worker names.