ccproxy.plugins.metrics.tasks¶
ccproxy.plugins.metrics.tasks
¶
Scheduled tasks for the metrics plugin.
PushgatewayTask
¶
PushgatewayTask(
name,
interval_seconds,
enabled=True,
max_backoff_seconds=300.0,
metrics_config=None,
metrics_hook=None,
)
Bases: BaseScheduledTask
Task for pushing metrics to Pushgateway periodically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Task name |
required |
interval_seconds
|
float
|
Interval between pushgateway operations |
required |
enabled
|
bool
|
Whether task is enabled |
True
|
max_backoff_seconds
|
float
|
Maximum backoff delay for failures |
300.0
|
metrics_config
|
Any | None
|
Metrics plugin configuration |
None
|
metrics_hook
|
Any | None
|
Metrics hook instance for getting collector |
None
|
Source code in ccproxy/plugins/metrics/tasks.py
setup
async
¶
Initialize pushgateway client for operations.
Source code in ccproxy/plugins/metrics/tasks.py
run
async
¶
Execute pushgateway metrics push.