@@ -19,6 +19,22 @@ export class ActivityMonitoringInterceptor implements ActivityInboundCallsInterc
1919 attempts : this . ctx . info . attempt ,
2020 }
2121
22+ const log = getServiceChildLogger ( 'activity-interceptor' , {
23+ activityType : this . ctx . info . activityType ,
24+ activityId : this . ctx . info . activityId ,
25+ workflowType : this . ctx . info . workflowType ,
26+ taskQueue : this . ctx . info . taskQueue ,
27+ workflowId : this . ctx . info . workflowExecution . workflowId ,
28+ runId : this . ctx . info . workflowExecution . runId ,
29+ } )
30+
31+ if ( this . ctx . info . attempt > 10 ) {
32+ log . warn (
33+ { slackNotify : true } ,
34+ `Activity ${ this . ctx . info . activityType } with id ${ this . ctx . info . activityId } was retried ${ this . ctx . info . attempt } times!` ,
35+ )
36+ }
37+
2238 telemetry . increment ( 'temporal.activity_execution' , 1 , tags )
2339
2440 const start = new Date ( )
@@ -27,15 +43,6 @@ export class ActivityMonitoringInterceptor implements ActivityInboundCallsInterc
2743 const res = await next ( input )
2844 return res
2945 } catch ( err ) {
30- const log = getServiceChildLogger ( 'activity-interceptor' , {
31- activityType : this . ctx . info . activityType ,
32- activityId : this . ctx . info . activityId ,
33- workflowType : this . ctx . info . workflowType ,
34- taskQueue : this . ctx . info . taskQueue ,
35- workflowId : this . ctx . info . workflowExecution . workflowId ,
36- runId : this . ctx . info . workflowExecution . runId ,
37- } )
38-
3946 log . error ( err , 'Error while processing an activity!' )
4047 throw err
4148 } finally {
0 commit comments