Skip to content

Commit

Permalink
Add sendCountMetric to logger (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethmv authored Dec 19, 2023
1 parent 449261c commit 0678191
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,25 @@ export const getLogger: GetLogger = memoize(() => {
url: loggerUrl,
});
});

export const sendCountMetric = ({
dimensions,
event,
name,
value = 1,
}: {|
event: string,
name: string,
value?: number,
dimensions: {
[string]: mixed,
},
// $FlowIssue return type
|}) =>
getLogger().metric({
dimensions,
metricEventName: event,
metricNamespace: name,
metricValue: value,
metricType: "counter",
});

0 comments on commit 0678191

Please sign in to comment.