Skip to content

Commit

Permalink
chore: add metrics for mailjet (#3917)
Browse files Browse the repository at this point in the history
  • Loading branch information
utsabc authored Dec 6, 2024
1 parent 4a77eda commit f44f148
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: ['group'],
},
{
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 f44f148

Please sign in to comment.