@libp2p/prometheus-metrics 1.1.4 → 1.1.5-05abd49f
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/README.md +3 -3
- package/dist/src/counter-group.d.ts +1 -1
- package/dist/src/counter.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/metric-group.d.ts +1 -1
- package/dist/src/metric.d.ts +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/package.json +15 -107
- package/src/counter-group.ts +1 -1
- package/src/counter.ts +1 -1
- package/src/index.ts +2 -2
- package/src/metric-group.ts +1 -1
- package/src/metric.ts +1 -1
- package/src/utils.ts +1 -1
- package/dist/typedoc-urls.json +0 -5
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[](http://libp2p.io/)
|
|
4
4
|
[](https://discuss.libp2p.io)
|
|
5
|
-
[](https://codecov.io/gh/libp2p/js-libp2p)
|
|
6
|
+
[](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amaster)
|
|
7
7
|
|
|
8
8
|
> Collect libp2p metrics for scraping by Prometheus or Graphana
|
|
9
9
|
|
|
@@ -83,7 +83,7 @@ or
|
|
|
83
83
|
|
|
84
84
|
## API Docs
|
|
85
85
|
|
|
86
|
-
- <https://libp2p.github.io/js-libp2p
|
|
86
|
+
- <https://libp2p.github.io/js-libp2p/modules/_libp2p_prometheus_metrics.html>
|
|
87
87
|
|
|
88
88
|
## License
|
|
89
89
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CalculatedMetric } from './utils.js';
|
|
2
2
|
import type { PrometheusCalculatedMetricOptions } from './index.js';
|
|
3
|
-
import type { CounterGroup, CalculateMetric } from '@libp2p/interface
|
|
3
|
+
import type { CounterGroup, CalculateMetric } from '@libp2p/interface/metrics';
|
|
4
4
|
export declare class PrometheusCounterGroup implements CounterGroup, CalculatedMetric<Record<string, number>> {
|
|
5
5
|
private readonly counter;
|
|
6
6
|
private readonly label;
|
package/dist/src/counter.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CalculatedMetric } from './utils.js';
|
|
2
2
|
import type { PrometheusCalculatedMetricOptions } from './index.js';
|
|
3
|
-
import type { CalculateMetric, Counter } from '@libp2p/interface
|
|
3
|
+
import type { CalculateMetric, Counter } from '@libp2p/interface/metrics';
|
|
4
4
|
export declare class PrometheusCounter implements Counter, CalculatedMetric {
|
|
5
5
|
private readonly counter;
|
|
6
6
|
private readonly calculators;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
96
96
|
import { type DefaultMetricsCollectorConfiguration, type Registry } from 'prom-client';
|
|
97
|
-
import type { CalculatedMetricOptions, Metrics } from '@libp2p/interface
|
|
97
|
+
import type { CalculatedMetricOptions, Metrics } from '@libp2p/interface/metrics';
|
|
98
98
|
export interface PrometheusMetricsInit {
|
|
99
99
|
/**
|
|
100
100
|
* Use a custom registry to register metrics.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CalculatedMetric } from './utils.js';
|
|
2
2
|
import type { PrometheusCalculatedMetricOptions } from './index.js';
|
|
3
|
-
import type { CalculateMetric, MetricGroup, StopTimer } from '@libp2p/interface
|
|
3
|
+
import type { CalculateMetric, MetricGroup, StopTimer } from '@libp2p/interface/metrics';
|
|
4
4
|
export declare class PrometheusMetricGroup implements MetricGroup, CalculatedMetric<Record<string, number>> {
|
|
5
5
|
private readonly gauge;
|
|
6
6
|
private readonly label;
|
package/dist/src/metric.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PrometheusCalculatedMetricOptions } from './index.js';
|
|
2
|
-
import type { Metric, StopTimer, CalculateMetric } from '@libp2p/interface
|
|
2
|
+
import type { Metric, StopTimer, CalculateMetric } from '@libp2p/interface/metrics';
|
|
3
3
|
export declare class PrometheusMetric implements Metric {
|
|
4
4
|
private readonly gauge;
|
|
5
5
|
private readonly calculators;
|
package/dist/src/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/prometheus-metrics",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-05abd49f",
|
|
4
4
|
"description": "Collect libp2p metrics for scraping by Prometheus or Graphana",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "Apache-2.0 OR MIT",
|
|
7
|
-
"homepage": "https://github.com/libp2p/js-libp2p-prometheus
|
|
7
|
+
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/metrics-prometheus#readme",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/libp2p/js-libp2p
|
|
10
|
+
"url": "git+https://github.com/libp2p/js-libp2p.git"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
|
-
"url": "https://github.com/libp2p/js-libp2p
|
|
14
|
-
},
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=18.0.0",
|
|
17
|
-
"npm": ">=8.6.0"
|
|
13
|
+
"url": "https://github.com/libp2p/js-libp2p/issues"
|
|
18
14
|
},
|
|
19
15
|
"type": "module",
|
|
20
16
|
"types": "./dist/src/index.d.ts",
|
|
@@ -36,91 +32,6 @@
|
|
|
36
32
|
"sourceType": "module"
|
|
37
33
|
}
|
|
38
34
|
},
|
|
39
|
-
"release": {
|
|
40
|
-
"branches": [
|
|
41
|
-
"main"
|
|
42
|
-
],
|
|
43
|
-
"plugins": [
|
|
44
|
-
[
|
|
45
|
-
"@semantic-release/commit-analyzer",
|
|
46
|
-
{
|
|
47
|
-
"preset": "conventionalcommits",
|
|
48
|
-
"releaseRules": [
|
|
49
|
-
{
|
|
50
|
-
"breaking": true,
|
|
51
|
-
"release": "major"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"revert": true,
|
|
55
|
-
"release": "patch"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"type": "feat",
|
|
59
|
-
"release": "minor"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"type": "fix",
|
|
63
|
-
"release": "patch"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"type": "docs",
|
|
67
|
-
"release": "patch"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"type": "test",
|
|
71
|
-
"release": "patch"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"type": "deps",
|
|
75
|
-
"release": "patch"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"scope": "no-release",
|
|
79
|
-
"release": false
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
[
|
|
85
|
-
"@semantic-release/release-notes-generator",
|
|
86
|
-
{
|
|
87
|
-
"preset": "conventionalcommits",
|
|
88
|
-
"presetConfig": {
|
|
89
|
-
"types": [
|
|
90
|
-
{
|
|
91
|
-
"type": "feat",
|
|
92
|
-
"section": "Features"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"type": "fix",
|
|
96
|
-
"section": "Bug Fixes"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"type": "chore",
|
|
100
|
-
"section": "Trivial Changes"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"type": "docs",
|
|
104
|
-
"section": "Documentation"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"type": "deps",
|
|
108
|
-
"section": "Dependencies"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"type": "test",
|
|
112
|
-
"section": "Tests"
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
"@semantic-release/changelog",
|
|
119
|
-
"@semantic-release/npm",
|
|
120
|
-
"@semantic-release/github",
|
|
121
|
-
"@semantic-release/git"
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
35
|
"scripts": {
|
|
125
36
|
"clean": "aegir clean",
|
|
126
37
|
"lint": "aegir lint",
|
|
@@ -128,28 +39,25 @@
|
|
|
128
39
|
"build": "aegir build",
|
|
129
40
|
"test": "aegir test -t node",
|
|
130
41
|
"test:node": "aegir test -t node --cov",
|
|
131
|
-
"test:electron-main": "aegir test -t electron-main --cov"
|
|
132
|
-
"release": "aegir release",
|
|
133
|
-
"docs": "aegir docs"
|
|
42
|
+
"test:electron-main": "aegir test -t electron-main --cov"
|
|
134
43
|
},
|
|
135
44
|
"dependencies": {
|
|
136
|
-
"@libp2p/interface
|
|
137
|
-
"@libp2p/
|
|
138
|
-
"@libp2p/logger": "^2.0.2",
|
|
45
|
+
"@libp2p/interface": "0.0.1-05abd49f",
|
|
46
|
+
"@libp2p/logger": "2.1.1-05abd49f",
|
|
139
47
|
"it-foreach": "^2.0.3",
|
|
140
|
-
"it-stream-types": "^2.0.1"
|
|
48
|
+
"it-stream-types": "^2.0.1",
|
|
49
|
+
"prom-client": "^14.1.0"
|
|
141
50
|
},
|
|
142
51
|
"devDependencies": {
|
|
143
|
-
"@libp2p/interface-
|
|
144
|
-
"@libp2p/peer-id-factory": "
|
|
52
|
+
"@libp2p/interface-compliance-tests": "3.0.7-05abd49f",
|
|
53
|
+
"@libp2p/peer-id-factory": "2.0.3-05abd49f",
|
|
145
54
|
"@multiformats/multiaddr": "^12.1.3",
|
|
146
|
-
"aegir": "^39.0.
|
|
55
|
+
"aegir": "^39.0.10",
|
|
147
56
|
"it-drain": "^3.0.2",
|
|
148
57
|
"it-pipe": "^3.0.1",
|
|
149
|
-
"p-defer": "^4.0.0"
|
|
150
|
-
"prom-client": "^14.1.0"
|
|
58
|
+
"p-defer": "^4.0.0"
|
|
151
59
|
},
|
|
152
|
-
"
|
|
153
|
-
"
|
|
60
|
+
"typedoc": {
|
|
61
|
+
"entryPoint": "./src/index.ts"
|
|
154
62
|
}
|
|
155
63
|
}
|
package/src/counter-group.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Counter as PromCounter, type CollectFunction } from 'prom-client'
|
|
2
2
|
import { normaliseString, type CalculatedMetric } from './utils.js'
|
|
3
3
|
import type { PrometheusCalculatedMetricOptions } from './index.js'
|
|
4
|
-
import type { CounterGroup, CalculateMetric } from '@libp2p/interface
|
|
4
|
+
import type { CounterGroup, CalculateMetric } from '@libp2p/interface/metrics'
|
|
5
5
|
|
|
6
6
|
export class PrometheusCounterGroup implements CounterGroup, CalculatedMetric<Record<string, number>> {
|
|
7
7
|
private readonly counter: PromCounter
|
package/src/counter.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CollectFunction, Counter as PromCounter } from 'prom-client'
|
|
2
2
|
import { normaliseString, type CalculatedMetric } from './utils.js'
|
|
3
3
|
import type { PrometheusCalculatedMetricOptions } from './index.js'
|
|
4
|
-
import type { CalculateMetric, Counter } from '@libp2p/interface
|
|
4
|
+
import type { CalculateMetric, Counter } from '@libp2p/interface/metrics'
|
|
5
5
|
|
|
6
6
|
export class PrometheusCounter implements Counter, CalculatedMetric {
|
|
7
7
|
private readonly counter: PromCounter
|
package/src/index.ts
CHANGED
|
@@ -101,8 +101,8 @@ import { PrometheusCounterGroup } from './counter-group.js'
|
|
|
101
101
|
import { PrometheusCounter } from './counter.js'
|
|
102
102
|
import { PrometheusMetricGroup } from './metric-group.js'
|
|
103
103
|
import { PrometheusMetric } from './metric.js'
|
|
104
|
-
import type { MultiaddrConnection, Stream, Connection } from '@libp2p/interface
|
|
105
|
-
import type { CalculatedMetricOptions, Counter, CounterGroup, Metric, MetricGroup, MetricOptions, Metrics } from '@libp2p/interface
|
|
104
|
+
import type { MultiaddrConnection, Stream, Connection } from '@libp2p/interface/connection'
|
|
105
|
+
import type { CalculatedMetricOptions, Counter, CounterGroup, Metric, MetricGroup, MetricOptions, Metrics } from '@libp2p/interface/metrics'
|
|
106
106
|
import type { Duplex, Source } from 'it-stream-types'
|
|
107
107
|
|
|
108
108
|
const log = logger('libp2p:prometheus-metrics')
|
package/src/metric-group.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CollectFunction, Gauge } from 'prom-client'
|
|
2
2
|
import { normaliseString, type CalculatedMetric } from './utils.js'
|
|
3
3
|
import type { PrometheusCalculatedMetricOptions } from './index.js'
|
|
4
|
-
import type { CalculateMetric, MetricGroup, StopTimer } from '@libp2p/interface
|
|
4
|
+
import type { CalculateMetric, MetricGroup, StopTimer } from '@libp2p/interface/metrics'
|
|
5
5
|
|
|
6
6
|
export class PrometheusMetricGroup implements MetricGroup, CalculatedMetric<Record<string, number>> {
|
|
7
7
|
private readonly gauge: Gauge
|
package/src/metric.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CollectFunction, Gauge } from 'prom-client'
|
|
2
2
|
import { normaliseString } from './utils.js'
|
|
3
3
|
import type { PrometheusCalculatedMetricOptions } from './index.js'
|
|
4
|
-
import type { Metric, StopTimer, CalculateMetric } from '@libp2p/interface
|
|
4
|
+
import type { Metric, StopTimer, CalculateMetric } from '@libp2p/interface/metrics'
|
|
5
5
|
|
|
6
6
|
export class PrometheusMetric implements Metric {
|
|
7
7
|
private readonly gauge: Gauge
|
package/src/utils.ts
CHANGED
package/dist/typedoc-urls.json
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"PrometheusCalculatedMetricOptions": "https://libp2p.github.io/js-libp2p-prometheus-metrics/interfaces/PrometheusCalculatedMetricOptions.html",
|
|
3
|
-
"PrometheusMetricsInit": "https://libp2p.github.io/js-libp2p-prometheus-metrics/interfaces/PrometheusMetricsInit.html",
|
|
4
|
-
"prometheusMetrics": "https://libp2p.github.io/js-libp2p-prometheus-metrics/functions/prometheusMetrics.html"
|
|
5
|
-
}
|