Skip to content

Commit

Permalink
chore: add metrics for mailjet
Browse files Browse the repository at this point in the history
  • Loading branch information
utsabc committed Dec 6, 2024
1 parent d7f390c commit 7120740
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util/prometheus.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,12 @@ class Prometheus {
type: 'counter',
labelNames: ['destination_id'],
},
{
name: 'mailjet_packing_size',
help: 'mailjet_packing_size',
type: 'gauge',
labelNames: ['destination_id'],
},
{
name: 'hs_batch_size',
help: 'hs_batch_size',
Expand Down
4 changes: 4 additions & 0 deletions src/v0/destinations/mailjet/transform.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const lodash = require('lodash');
const { TransformationError, InstrumentationError } = require('@rudderstack/integrations-lib');
const stats = require('../../../util/stats');
const {
getSuccessRespEvents,
defaultRequestConfig,
Expand Down Expand Up @@ -105,6 +106,9 @@ const batchEvents = (successRespList) => {
const eventChunks = lodash.chunk(eventGroups[combination], MAX_BATCH_SIZE);
// eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..]
eventChunks.forEach((chunk) => {
stats.gauge('mailjet_packing_size', chunk.length, {
group: combination,
});
const batchEventResponse = generateBatchedPaylaodForArray(chunk, combination);
batchedResponseList.push(
getSuccessRespEvents(
Expand Down

0 comments on commit 7120740

Please sign in to comment.