@adalo/metrics 0.1.142 → 0.1.143

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adalo/metrics",
3
- "version": "0.1.142",
3
+ "version": "0.1.143",
4
4
  "description": "Reusable metrics utilities for Node.js and Laravel apps",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/scripts/README.md DELETED
@@ -1,43 +0,0 @@
1
- # This is utils for manage metrics
2
-
3
-
4
- ## Type envs to handling require metrics
5
- ```js
6
- BUILD_APP_NAME=
7
- HOSTNAME=
8
- BUILD_DYNO_PROCESS_TYPE=
9
- METRICS_ENABLED=
10
- METRICS_LOG_VALUES=
11
- METRICS_PUSHGATEWAY_URL=
12
- METRICS_PUSHGATEWAY_SECRET=
13
- METRICS_INTERVAL_SEC=
14
-
15
- ```
16
-
17
-
18
- ## Clear metriks for service
19
- ```
20
- node scripts/clearMetrics.js
21
- ```
22
-
23
- ## Publish metrics to VM-agent (example)
24
-
25
- Publishes built-in gauges (CPU, memory, uptime, etc.) and an example custom gauge to VM-agent.
26
-
27
- 1. Set env (or `.env`):
28
- - `METRICS_PUSHGATEWAY_URL` – VM-agent import URL, e.g. `https://vm-agent.staging.infradalogs.adalo.com/api/v1/import/prometheus`
29
- - `METRICS_PUSHGATEWAY_SECRET` – Base64 of `user:password` (same as VM-agent BASIC_USER / BASIC_PASSWORD)
30
- - `METRICS_ENABLED=true`
31
- - `METRICS_INTERVAL_SEC=15` (optional, default 15)
32
-
33
- 2. Generate secret:
34
- ```bash
35
- echo -n 'user:password' | base64
36
- ```
37
-
38
- 3. Run:
39
- ```bash
40
- node scripts/publish-metrics-example.js
41
- ```
42
-
43
- Metrics appear in VM-agent (and VictoriaMetrics) under names like `app_process_cpu_usage_percent`, `app_uptime_seconds`, `app_example_custom_total`, etc.
@@ -1,6 +0,0 @@
1
- const { BaseMetricsClient } = require('../src')
2
- require('dotenv').config()
3
-
4
- new BaseMetricsClient({
5
- removeOldMetrics: true,
6
- })