npm.io
1.0.10 • Published 1 week ago

@forge/metrics

Licence
SEE LICENSE IN LICENSE.txt
Version
1.0.10
Deps
2
Size
55 kB
Vulns
0
Weekly
0

Forge custom metrics

See Forge custom metrics for details on setup, use and viewing custom metrics instrumented in your forge app on developer console

Requirements

See Set up Forge for details of the software required to develop Forge apps.

Usage

In your Forge app, include the following:


import { internalMetrics } from '@forge/metrics';

export const run = async (payload, context) => {
+  const counter = internalMetrics.counter('jiraActions'); // Name should exactly match as registered in developer console
+
+  const jiraIssues = fetch(...);
+  
+  for (const issue of jiraIssues) {
+    counter.incr(); // Increment by 1
+    // Or increment by a specific value
+    counter.incrBy(value);
+  }
+};

Support

See Get help for how to get help and provide feedback.