Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sre 484 test out aggregating metrics in a worker thread with worker #3504

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/util/prometheus.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
const prometheusClient = require('prom-client');
const logger = require('../logger');
const { MetricsAggregator } = require('./metricsAggregator');
const cluster = require('cluster');

const clusterEnabled = process.env.CLUSTER_ENABLED !== 'false';
const useMetricsAggregator = process.env.USE_METRICS_AGGREGATOR === 'true';
const instanceID = process.env.INSTANCE_ID || 'localhost';
const prefix = 'transformer';
const defaultLabels = { instanceName: instanceID };
const defaultLabels = {
instanceName: instanceID,
isMaster: cluster.isPrimary,
workerId: cluster.worker ? cluster.worker.id : 0,
};

function appendPrefix(name) {
return `${prefix}_${name}`;
Expand Down
Loading