Skip to content

Commit

Permalink
Merge pull request #694 from telefonicaid/task/add_log_batchupdate_er…
Browse files Browse the repository at this point in the history
…ror_detail

add full detail about batchupdate
  • Loading branch information
fgalan committed Jun 23, 2022
2 parents 120999c + 1cbd2e0 commit 9131539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Add: full detail about batch update error or success in logs
- Fix: expanding an object variable in action of rule (#692)
- Fix: for EPL with context + insert + select rule (without expression) (#652)
- Fix: format of internalCurrentTime fixed to ISO 8601
Expand Down
8 changes: 6 additions & 2 deletions lib/models/updateAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ function doUpdateActionWithFilter(queryOptions, action, event, token, connection
// If the error was reported by Orion, error.correlator will be
// filled with the associated transaction id
metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate);
logger.warn('error batchUpdate: %j', error);
logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j',
error, changes, event);
alarm.raise(alarm.ORION, null, error);
}
); // batchUpdate
Expand All @@ -500,7 +501,7 @@ function doUpdateActionWithFilter(queryOptions, action, event, token, connection
// If the error was reported by Orion, error.correlator will be
// filled with the associated transaction id
metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate);
logger.warn('error filtering %j', error);
logger.warn('error filtering %j with queryOptions: %j', error, queryOptions);
alarm.raise(alarm.ORION, null, error);
callback(error, null);
}
Expand Down Expand Up @@ -530,12 +531,15 @@ function doUpdateAction(action, event, token, connection, callback) {
connection.v2.batchUpdate(changes).then(
(response) => {
// response.correlator transaction id associated with the server response
logger.info('response OK v2.batchUpdate entities: %j', response);
metrics.IncMetrics(event.service, event.subservice, metrics.okActionEntityUpdate);
alarm.release(alarm.ORION);
callback(null, response);
},
(error) => {
metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate);
logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j',
error, changes, event);
alarm.raise(alarm.ORION, null, error);
callback(error, null);
}
Expand Down

0 comments on commit 9131539

Please sign in to comment.