feedless/web/lib/metrics.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

const prometheus = require("prom-client");
const collectDefaultMetrics = prometheus.collectDefaultMetrics;
const register = prometheus.register;
collectDefaultMetrics({ register });
2020-04-15 20:02:13 +02:00
const { Gauge, Summary, Counter } = prometheus;
module.exports = {
register,
2020-04-15 20:02:13 +02:00
router: new Counter({
2020-04-15 20:33:09 +02:00
name: "social_router",
2020-04-15 20:02:13 +02:00
help: "Routes accessed by users",
labelNames: ["method", "path"],
}),
ssbProgressRate: new Gauge({
2020-04-15 20:33:09 +02:00
name: "social_ssb_progress_rate",
2020-04-15 20:02:13 +02:00
help: "Tracks ssb syncing progress rate",
}),
ssbProgressFeeds: new Gauge({
2020-04-15 20:33:09 +02:00
name: "social_ssb_progress_feeds",
2020-04-15 20:02:13 +02:00
help: "Tracks ssb syncing progress feeds",
}),
ssbProgressIncompleteFeeds: new Gauge({
2020-04-15 20:33:09 +02:00
name: "social_ssb_progress_incomplete_feeds",
2020-04-15 20:02:13 +02:00
help: "Tracks ssb syncing progress incomplete feeds",
}),
ssbProgressProgress: new Gauge({
2020-04-15 20:33:09 +02:00
name: "social_ssb_progress_progress",
2020-04-15 20:02:13 +02:00
help: "Tracks ssb syncing progress progress",
}),
ssbProgressTotal: new Gauge({
2020-04-15 20:33:09 +02:00
name: "social_ssb_progress_total",
2020-04-15 20:02:13 +02:00
help: "Tracks ssb syncing progress total",
}),
2020-04-21 08:13:33 +02:00
searchResultsPeople: new Summary({
name: "social_search_results_people",
help: "Amount of people results returned from search",
}),
searchResultsCommunities: new Summary({
name: "social_search_results_communities",
help: "Amount of communities results returned from search",
2020-04-15 20:02:13 +02:00
}),
};