@tramvai/module-metrics 2.119.0 → 2.119.2

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.
Files changed (2) hide show
  1. package/README.md +30 -0
  2. package/package.json +11 -11
package/README.md CHANGED
@@ -18,6 +18,10 @@ Next labels are added to metrics:
18
18
 
19
19
  Name of the service calculates by comparing request urls with values in `MetricsServicesRegistry`. Initially the register is bootstrapped with the inverted content of env variables, e.g. if some url from env is a substring of the request url, then the name of the env become the service name. If several envs matches this logic then the env with the longest url is used.
20
20
 
21
+ ### Event Loop Lag
22
+
23
+ This module has their own implementation of Event Loop Lag metric - `nodejs_eventloop_setinterval_lag_seconds` histogram, this metric implemented with `setTimeout`.
24
+
21
25
  ### Client metrics
22
26
 
23
27
  Module implements feature to collect metrics from the clients and share it with Prometheus by sending metrics from the client to server papi-route.
@@ -65,6 +69,32 @@ provide({
65
69
  }),
66
70
  ```
67
71
 
72
+ ## Metrics list
73
+
74
+ ### Application metrics
75
+
76
+ - `http_requests_total` counter - application response count by status code
77
+ - `http_requests_execution_time` histogram - application response time
78
+ - `command_line_runner_execution_time` histogram - (measure application lifecycle)[03-features/06-app-lifecycle.md]
79
+
80
+ ### Outgoing requests
81
+
82
+ - `http_sent_requests_total` counter - request count from application to external APIs
83
+ - `http_sent_requests_duration` histogram - request time from application to external APIs
84
+ - `http_sent_requests_errors` counter - request from application to external APIs errors count
85
+ - `dns_resolve_duration` histogram - DNS resolve time
86
+ - `tcp_connect_duration` histogram - TCP connect time
87
+ - `tls_handshake_duration` histogram - TLS handshake time
88
+
89
+ ### Node.js metrics
90
+
91
+ - `nodejs_eventloop_lag_p90_seconds` gauge - event loop lag in 90 percentile from `prom-client`
92
+ - `nodejs_eventloop_setinterval_lag_seconds` histogram - event loop lag from custom `setTimeout` measurement
93
+ - `nodejs_heap_space_size_used_bytes` gauge - used memory size from `prom-client`
94
+ - `nodejs_gc_duration_seconds` histogram - GC duration from `prom-client`
95
+ - `nodejs_active_handles` gauge - total number of active handles from `prom-client`
96
+ - `nodejs_active_requests` gauge - total number of active requests from `prom-client`
97
+
68
98
  ## How to
69
99
 
70
100
  ### Usage Example
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-metrics",
3
- "version": "2.119.0",
3
+ "version": "2.119.2",
4
4
  "description": "",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -18,16 +18,16 @@
18
18
  "watch": "tsc -w"
19
19
  },
20
20
  "dependencies": {
21
- "@tramvai/core": "2.119.0",
22
- "@tramvai/tokens-common": "2.119.0",
23
- "@tramvai/tokens-core-private": "2.119.0",
24
- "@tramvai/tokens-server": "2.119.0",
25
- "@tramvai/tokens-server-private": "2.119.0",
26
- "@tramvai/tokens-metrics": "2.119.0",
27
- "@tramvai/tokens-router": "2.119.0",
28
- "@tramvai/tokens-http-client": "2.119.0",
29
- "@tramvai/state": "2.119.0",
30
- "@tramvai/papi": "2.119.0",
21
+ "@tramvai/core": "2.119.2",
22
+ "@tramvai/tokens-common": "2.119.2",
23
+ "@tramvai/tokens-core-private": "2.119.2",
24
+ "@tramvai/tokens-server": "2.119.2",
25
+ "@tramvai/tokens-server-private": "2.119.2",
26
+ "@tramvai/tokens-metrics": "2.119.2",
27
+ "@tramvai/tokens-router": "2.119.2",
28
+ "@tramvai/tokens-http-client": "2.119.2",
29
+ "@tramvai/state": "2.119.2",
30
+ "@tramvai/papi": "2.119.2",
31
31
  "@tinkoff/measure-fastify-requests": "0.1.9",
32
32
  "@tinkoff/monkeypatch": "2.0.5",
33
33
  "@tinkoff/url": "0.8.6",