Browse Source

Adds documentation and drops `usage` from total_bytes metrics

tests
Nemo 3 years ago
parent
commit
6a74d9d565
  1. 102
      METRICS.md
  2. 43
      README.md
  3. 2
      prom.js

102
METRICS.md

@ -1,15 +1,36 @@
# METRICS
Below are an example of the metrics as exposed by this exporter.
Metrics are reported in the format:
- `act_fup_${category}_usage_bytes`
- `act_fup_${category}_total_bytes`
Where $category is one of `live` (normal usage), `flexibytes` (FlexiByte only usage), or `aggregate` (combined usage).
```
# HELP act_fup_usage_bytes ACT current usage in bytes (precision GB)
# TYPE act_fup_usage_bytes gauge
act_fup_usage_bytes 41.42
# 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_max_bytes ACT FUP limit in bytes (precision GB)
# TYPE act_fup_max_bytes gauge
act_fup_max_bytes 500
# 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
```
It also exposes some nodeJS metrics:
@ -17,89 +38,88 @@ It also exposes some nodeJS metrics:
```
# HELP process_cpu_user_seconds_total Total user CPU time spent in seconds.
# TYPE process_cpu_user_seconds_total counter
process_cpu_user_seconds_total 0.001233 1528092827015
process_cpu_user_seconds_total 0.001487 1530394613092
# HELP process_cpu_system_seconds_total Total system CPU time spent in seconds.
# TYPE process_cpu_system_seconds_total counter
process_cpu_system_seconds_total 0.000114 1528092827015
process_cpu_system_seconds_total 0 1530394613092
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.001347 1528092827015
process_cpu_seconds_total 0.001487 1530394613092
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1528092827
process_start_time_seconds 1530394613
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 39550976 1528092827028
process_resident_memory_bytes 38600704 1530394613106
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 1074991104 1528092827028
process_virtual_memory_bytes 1075826688 1530394613106
# HELP process_heap_bytes Process heap size in bytes.
# TYPE process_heap_bytes gauge
process_heap_bytes 88317952 1528092827028
process_heap_bytes 87396352 1530394613106
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 13 1528092827026
process_open_fds 13 1530394613105
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 358146
process_max_fds 358178
# HELP nodejs_eventloop_lag_seconds Lag of event loop in seconds.
# TYPE nodejs_eventloop_lag_seconds gauge
nodejs_eventloop_lag_seconds 0.011319479 1528092827027
nodejs_eventloop_lag_seconds 0.011130566 1530394613105
# HELP nodejs_active_handles_total Number of active handles.
# TYPE nodejs_active_handles_total gauge
nodejs_active_handles_total 2 1528092827016
nodejs_active_handles_total 2 1530394613094
# HELP nodejs_active_requests_total Number of active requests.
# TYPE nodejs_active_requests_total gauge
nodejs_active_requests_total 4 1528092827016
nodejs_active_requests_total 4 1530394613094
# HELP nodejs_heap_size_total_bytes Process heap size from node.js in bytes.
# TYPE nodejs_heap_size_total_bytes gauge
nodejs_heap_size_total_bytes 19193856 1528092827016
nodejs_heap_size_total_bytes 19693568 1530394613094
# HELP nodejs_heap_size_used_bytes Process heap size used from node.js in bytes.
# TYPE nodejs_heap_size_used_bytes gauge
nodejs_heap_size_used_bytes 8858072 1528092827016
nodejs_heap_size_used_bytes 9105080 1530394613094
# HELP nodejs_external_memory_bytes Nodejs external memory size in bytes.
# TYPE nodejs_external_memory_bytes gauge
nodejs_external_memory_bytes 42604 1528092827016
nodejs_external_memory_bytes 99117 1530394613094
# HELP nodejs_heap_space_size_total_bytes Process heap space size total from node.js in bytes.
# TYPE nodejs_heap_space_size_total_bytes gauge
nodejs_heap_space_size_total_bytes{space="new"} 8388608 1528092827016
nodejs_heap_space_size_total_bytes{space="old"} 7639040 1528092827016
nodejs_heap_space_size_total_bytes{space="code"} 1048576 1528092827016
nodejs_heap_space_size_total_bytes{space="map"} 544768 1528092827016
nodejs_heap_space_size_total_bytes{space="large_object"} 1572864 1528092827016
nodejs_heap_space_size_total_bytes{space="read_only"} 0 1530394613094
nodejs_heap_space_size_total_bytes{space="new"} 8388608 1530394613094
nodejs_heap_space_size_total_bytes{space="old"} 7610368 1530394613094
nodejs_heap_space_size_total_bytes{space="code"} 1048576 1530394613094
nodejs_heap_space_size_total_bytes{space="map"} 1073152 1530394613094
nodejs_heap_space_size_total_bytes{space="large_object"} 1572864 1530394613094
# HELP nodejs_heap_space_size_used_bytes Process heap space size used from node.js in bytes.
# TYPE nodejs_heap_space_size_used_bytes gauge
nodejs_heap_space_size_used_bytes{space="new"} 1038624 1528092827016
nodejs_heap_space_size_used_bytes{space="old"} 6219304 1528092827016
nodejs_heap_space_size_used_bytes{space="code"} 883776 1528092827016
nodejs_heap_space_size_used_bytes{space="map"} 474400 1528092827016
nodejs_heap_space_size_used_bytes{space="large_object"} 249120 1528092827016
nodejs_heap_space_size_used_bytes{space="read_only"} 0 1530394613094
nodejs_heap_space_size_used_bytes{space="new"} 1378008 1530394613094
nodejs_heap_space_size_used_bytes{space="old"} 6093664 1530394613094
nodejs_heap_space_size_used_bytes{space="code"} 837056 1530394613094
nodejs_heap_space_size_used_bytes{space="map"} 555104 1530394613094
nodejs_heap_space_size_used_bytes{space="large_object"} 249024 1530394613094
# HELP nodejs_heap_space_size_available_bytes Process heap space size available from node.js in bytes.
# TYPE nodejs_heap_space_size_available_bytes gauge
nodejs_heap_space_size_available_bytes{space="new"} 3086048 1528092827016
nodejs_heap_space_size_available_bytes{space="old"} 845168 1528092827016
nodejs_heap_space_size_available_bytes{space="code"} 0 1528092827016
nodejs_heap_space_size_available_bytes{space="map"} 0 1528092827016
nodejs_heap_space_size_available_bytes{space="large_object"} 1481833984 1528092827016
# HELP nodejs_version_info Node.js version info.
# TYPE nodejs_version_info gauge
nodejs_version_info{version="v10.3.0",major="10",minor="3",patch="0"} 1
nodejs_heap_space_size_available_bytes{space="read_only"} 0 1530394613094
nodejs_heap_space_size_available_bytes{space="new"} 2746664 1530394613094
nodejs_heap_space_size_available_bytes{space="old"} 1080240 1530394613094
nodejs_heap_space_size_available_bytes{space="code"} 0 1530394613094
nodejs_heap_space_size_available_bytes{space="map"} 80 1530394613094
nodejs_heap_space_size_available_bytes{space="large_object"} 1507024384 1530394613094
```

43
README.md

@ -2,7 +2,8 @@
Exposes your current ACT FUP usage as prometheus metrics. Scrapes the data from the ACT Portal website by using puppeteer.
- Does not support flexibytes yet (PRs welcome)
- Supports flexibytes
- Reports aggregate metrics as well
- Only tested for ACT Bangalore connections.
## Metrics
@ -10,13 +11,29 @@ Exposes your current ACT FUP usage as prometheus metrics. Scrapes the data from
Sample:
```
# HELP act_fup_usage_bytes ACT current usage in bytes (precision GB)
# TYPE act_fup_usage_bytes gauge
act_fup_usage_bytes 41.42
# 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_max_bytes ACT FUP limit in bytes (precision GB)
# TYPE act_fup_max_bytes gauge
act_fup_max_bytes 500
# 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
@ -26,16 +43,12 @@ Install it with `npm i prometheus-act-exporter`.
```js
const act = require('prometheus-act-exporter')
let m = await act.getUsage();
console.log(m)
// Returns
//
// {
// used: 102.92,
// total: 500,
// usedBytes: 102920000,
// totalBytes: 500000000
// }
// used/total are in GB, other 2 are in bytes
// live: { usedBytes: 0, totalBytes: 800000000 },
// flexibytes: { usedBytes: 102580000, totalBytes: 100000000 },
// aggregate: { usedBytes: 102580000, totalBytes: 900000000 }
// }
// calculations made assuming ACT is using SI GB (exactly 1 billion bytes)
```

2
prom.js

@ -12,7 +12,7 @@ KEYS.map(key => {
});
gauges[`${key}_total`] = new pClient.Gauge({
name: `act_fup_${key}_total_usage_bytes`,
name: `act_fup_${key}_total_bytes`,
help: `ACT ${key} usage in bytes (precision GB)`,
});
});

Loading…
Cancel
Save