Skip to content

Commit

Permalink
feat: add nop to metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenPJ committed Feb 5, 2024
1 parent b83b17a commit ca9dfcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const metrics = require("@operate-first/probot-metrics");
const counter = metrics.useCounter({
name: 'num_of_actions_total',
help: 'Total number of actions received',
labelNames: ['repository', 'result', 'action'],
labelNames: ['repository', 'result', 'action', 'nop'],
});

const meteredPlugin = async (plugin, fn) => {
Expand All @@ -12,6 +12,7 @@ const meteredPlugin = async (plugin, fn) => {
counter
.labels({
repository: plugin.repo.repo,
nop: plugin.nop,
result: "success",
action: plugin.constructor.name
})
Expand All @@ -23,6 +24,7 @@ const meteredPlugin = async (plugin, fn) => {
.labels({
repository: plugin.repo.repo,
result: "error",
nop: plugin.nop,
action: plugin.constructor.name
})
.inc();
Expand Down

0 comments on commit ca9dfcc

Please sign in to comment.