Go to file
Nemo 631d7bfd7d run all tests on self-hosted 2022-09-07 17:23:16 +05:30
.github run all tests on self-hosted 2022-09-07 17:23:16 +05:30
hooks Update Dockerfile to include labels 2018-07-01 03:24:35 +05:30
.dockerignore Prepare for npm publish 2018-06-04 13:23:04 +05:30
.editorconfig [deps] Bumps puppeteer to 1.8 2019-03-14 08:07:19 +05:30
.gitignore container stuff 2022-06-28 17:20:52 +05:30
.npmignore Update npm ignore 2021-12-19 15:36:54 +05:30
CHANGELOG.md Version Bump 2021-08-12 10:11:24 +05:30
COPYING New release 2021-12-19 15:36:03 +05:30
Dockerfile Bump schliflo/docker-puppeteer from 16.2.0 to 17.0.0 2022-09-05 23:12:10 +00:00
METRICS.md Adds documentation and drops `usage` from total_bytes metrics 2018-07-01 03:13:48 +05:30
README.md container stuff 2022-06-28 17:20:52 +05:30
SECURITY.md Multiple changes for v3 2021-07-03 23:04:24 +05:30
index.js container stuff 2022-06-28 17:20:52 +05:30
package-lock.json Merge branch 'master' into tests 2022-09-07 17:11:49 +05:30
package.json Merge branch 'master' into tests 2022-09-07 17:11:49 +05:30
prom.js New release 2021-12-19 15:36:03 +05:30
server.js container stuff 2022-06-28 17:20:52 +05:30
test.js Add tests and CI 2022-06-28 17:19:22 +05:30

README.md

prometheus-act-exporter

Docker Image Version (latest semver) Docker Image Size (latest semver) npm version License: WTFPL CI

Exposes your current ACT FUP usage as prometheus metrics. Scrapes the data from the ACT Portal website by using puppeteer. This only supports ACT Fibernet in India.

  • Supports flexibytes
  • Reports aggregate metrics as well
  • Only tested for ACT Bangalore connections.

Metrics

Sample:

# HELP act_fup_live_usage_bytes ACT live usage in bytes (precision GB)
# TYPE act_fup_live_usage_bytes gauge
act_fup_live_usage_bytes 0

# HELP act_fup_live_total_bytes ACT live usage in bytes (precision GB)
# TYPE act_fup_live_total_bytes gauge
act_fup_live_total_bytes 800000000

# HELP act_fup_flexibytes_usage_bytes ACT flexibytes usage in bytes (precision GB)
# TYPE act_fup_flexibytes_usage_bytes gauge
act_fup_flexibytes_usage_bytes 102580000

# HELP act_fup_flexibytes_total_bytes ACT flexibytes usage in bytes (precision GB)
# TYPE act_fup_flexibytes_total_bytes gauge
act_fup_flexibytes_total_bytes 100000000

# HELP act_fup_aggregate_usage_bytes ACT aggregate usage in bytes (precision GB)
# TYPE act_fup_aggregate_usage_bytes gauge
act_fup_aggregate_usage_bytes 102580000

# HELP act_fup_aggregate_total_bytes ACT aggregate usage in bytes (precision GB)
# TYPE act_fup_aggregate_total_bytes gauge
act_fup_aggregate_total_bytes 900000000

Using as a npm package

Install it with npm i prometheus-act-exporter.

See test.js for sample usage.

Configuration

You can pass the following environment variables:

  1. PROXY_SERVER: Use a proxy server to connect to ACT. Use a socks5 proxy, since ACT returns a 403 if you try to use a CONNECT proxy. export PROXY_SERVER="socks5://10.8.0.14:1080"
  2. CHROME_BIN: Set Chrome/Chromium executable path. Helpful if you have chromium already installed and don't want puppeteer to download it again. You can set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 before running npm install to disable puppeteer's chromium download.
  3. DISABLE_HEADLESS: If set, chrome will not launch in headless mode.

Usage

Docker

If running via Docker, here are some simple cookbook configurations:

wget https://github.com/tkp1n/chromium-ci/raw/41510dc154c4184f7e09461ba76f86f61c460070/seccomp/chromium.json
docker run --security-opt seccomp=chromium.json -it -p 3000:3000 -e captn3m0/prometheus-act-exporter

Note that the above uses a minimal secure seccomp profile for running Chromium inside Docker.

Warning: You should not be running this using --privileged or --cap-add=SYS_ADMIN, or --no-sandbox.

LICENSE

This is licensed under WTFPL. See COPYING file for the full text.