A Prometheus exporter for Accel-PPP that exposes metrics from the accel-cmd show stat command.
Some small story behind this exporter on my blog.
- Go 1.24 or higher (that what I'm using, most likely is compatible down to Go 1.20)
- Accel-PPP 1.12 or compatible version
- Permission to execute
accel-cmd show statcommand
Note
This exporter has been tested with accel-ppp:
- 1.12
- Exposes all metrics from
accel-cmd show statas Prometheus metrics (have to have access rights to issue command) - Configurable listen address (default: :9101)
- Configurable metrics path (default: /metrics)
- Configurable path to
accel-cmdbinary - Ready-to-use Grafana dashboard
Download the latest release from the Releases page.
docker run -d --name accel-exporter -p 9101:9101 taihen/accel-exporter:latestgo install github.com/taihen/accel-exporter/cmd/accel-exporter@latestUsage of accel-exporter:
-accel-cmd.path string
Path to accel-cmd binary (default "accel-cmd")
-log.level string
Log level (debug, info, warn, error) (default "info")
-web.listen-address string
Address to listen on (default ":9101")
-web.metrics-path string
Path to expose metrics (default "/metrics")You can also configure the exporter using environment variables:
ACCEL_EXPORTER_PORT: The port to listen on (overrides-web.listen-address)
Add a scrape configuration to your prometheus.yml:
scrape_configs:
- job_name: 'accel-ppp'
static_configs:
- targets: ['localhost:9101']A Grafana dashboard is included in the dashboards directory. You can import it into your Grafana instance.
# Clone the repository
git clone https://github.com/taihen/accel-exporter.git
cd accel-exporter
# Build
go build -o accel-exporter ./cmd/accel-exporter
# Run
./accel-exporterdocker build -t accel-exporter .
docker run -p 9101:9101 accel-exporterThe exporter exposes the following metrics:
General:
accel_exporter_build_info{version, commit, date}: Metric with constant '1' value
labeled with version, commit, and build dateaccel_up: Was the last accel-cmd scrape successful (1 = yes, 0 = no).accel_scrape_failures_total: Number of errors while scraping accel-cmd.accel_uptime_seconds: Uptime of accel-ppp in seconds.accel_cpu_usage_percent: CPU usage percentage.accel_memory_rss_bytes: RSS memory usage in bytes.accel_memory_virtual_bytes: Virtual memory usage in bytes.
Core:
accel_core_mempool_allocated_bytes: Allocated memory pool sizeaccel_core_mempool_available_bytes: Available memory pool sizeaccel_core_thread_count: Number of core threadsaccel_core_thread_active: Number of active core threadsaccel_core_context_count: Number of core contextsaccel_core_context_sleeping: Number of sleeping core contextsaccel_core_context_pending: Number of pending core contextsaccel_core_md_handler_count: Number of MD handlersaccel_core_md_handler_pending: Pending MD handlers countaccel_core_timer_count: Number of core timersaccel_core_timer_pending: Number of pending core timers
Sessions:
accel_sessions_starting: Number of sessions startingaccel_sessions_active: Number of active sessionsaccel_sessions_finishing: Number of sessions finishing
PPPoE:
accel_pppoe_starting: Number of PPPoE sessions startingaccel_pppoe_active: Number of active PPPoE sessionsaccel_pppoe_delayed_pado: Number of delayed PADO packetsaccel_pppoe_recv_padi_total: Total received PADI packetsaccel_pppoe_drop_padi_total: Total dropped PADI packetsaccel_pppoe_sent_pado_total: Total sent PADO packetsaccel_pppoe_recv_padr_total: Total received PADR packetsaccel_pppoe_recv_padr_dup_total: Total received duplicate PADR packetsaccel_pppoe_sent_pads_total: Total sent PADS packetsaccel_pppoe_filtered_total: Total filtered PPPoE packets
RADIUS (Labels: server_id, server_ip):
accel_radius_state: State of RADIUS server (1 = active, 0 = inactive)accel_radius_fail_count_total: Total RADIUS server fail countaccel_radius_request_count: Current RADIUS server request countaccel_radius_queue_length: Current RADIUS server queue lengthaccel_radius_auth_sent_total: Total RADIUS auth packets sentaccel_radius_auth_lost_total: Total RADIUS auth packets lostaccel_radius_auth_lost_5m: RADIUS auth packets lost (5m window)accel_radius_auth_lost_1m: RADIUS auth packets lost (1m window)accel_radius_auth_avg_time_5m_seconds: Average auth response time (5m)accel_radius_auth_avg_time_1m_seconds: Average auth response time (1m)accel_radius_acct_sent_total: Total accounting packets sentaccel_radius_acct_lost_total: Total accounting packets lostaccel_radius_acct_lost_5m: Accounting packets lost (5m window)accel_radius_acct_lost_1m: Accounting packets lost (1m window)accel_radius_acct_avg_time_5m_seconds: Average accounting response (5m)accel_radius_acct_avg_time_1m_seconds: Average accounting response (1m)accel_radius_interim_sent_total: Total interim accounting packets sentaccel_radius_interim_lost_total: Total interim accounting packets lostaccel_radius_interim_lost_5m: Interim packets lost (5m window)accel_radius_interim_lost_1m: Interim packets lost (1m window)accel_radius_interim_avg_time_5m_seconds: Avg interim response (5m)accel_radius_interim_avg_time_1m_seconds: Avg interim response (1m)
MIT
