ccproxy.plugins.metrics.hook¶
ccproxy.plugins.metrics.hook
¶
Hook-based metrics collection implementation.
MetricsHook
¶
Bases: Hook
Hook-based metrics collection implementation.
This hook listens to request/response lifecycle events and updates Prometheus metrics accordingly. It provides event-driven metric collection without requiring direct metric calls in the code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
MetricsConfig | None
|
Metrics configuration |
None
|
Source code in ccproxy/plugins/metrics/hook.py
get_collector
¶
Get the Prometheus metrics collector instance.
Returns:
| Type | Description |
|---|---|
PrometheusMetrics | None
|
The metrics collector or None if disabled |
get_pushgateway_client
¶
Get the Pushgateway client instance.
Returns:
| Type | Description |
|---|---|
PushgatewayClient | None
|
The pushgateway client or None if disabled |