@platformatic/metrics 2.6.1 → 2.8.0-alpha.1

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/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -5,14 +5,14 @@ const { eventLoopUtilization } = require('node:perf_hooks').performance
5
5
  const { Registry, Gauge, Counter, collectDefaultMetrics } = require('prom-client')
6
6
  const collectHttpMetrics = require('@platformatic/http-metrics')
7
7
 
8
- async function collectMetrics (serviceId, metricsConfig = {}) {
8
+ async function collectMetrics (serviceId, workerId, metricsConfig = {}) {
9
9
  const registry = new Registry()
10
10
 
11
11
  const httpRequestCallbacks = []
12
12
  const httpResponseCallbacks = []
13
13
 
14
14
  const labels = metricsConfig.labels ?? {}
15
- registry.setDefaultLabels({ ...labels, serviceId })
15
+ registry.setDefaultLabels({ ...labels, serviceId, workerId })
16
16
 
17
17
  if (metricsConfig.defaultMetrics) {
18
18
  collectDefaultMetrics({ register: registry })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/metrics",
3
- "version": "2.6.1",
3
+ "version": "2.8.0-alpha.1",
4
4
  "description": "Platformatic Stackable Metrics",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",