File tree Expand file tree Collapse file tree
services/archetypes/worker/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,11 @@ export class ActivityMonitoringInterceptor implements ActivityInboundCallsInterc
1616 workflow_type : this . ctx . info . workflowType ,
1717 task_queue : this . ctx . info . taskQueue ,
1818 activity_type : this . ctx . info . activityType ,
19+ attempts : this . ctx . info . attempt ,
1920 }
2021
22+ telemetry . increment ( 'temporal.activity_execution' , 1 , tags )
23+
2124 const start = new Date ( )
2225
2326 try {
Original file line number Diff line number Diff line change @@ -8,4 +8,12 @@ async function telemetryDistribution(
88 telemetry . distribution ( name , value , tags )
99}
1010
11- export { telemetryDistribution }
11+ async function telemetryIncrement (
12+ name : string ,
13+ value : number ,
14+ tags ?: Record < string , string | number > ,
15+ ) {
16+ telemetry . increment ( name , value , tags )
17+ }
18+
19+ export { telemetryDistribution , telemetryIncrement }
Original file line number Diff line number Diff line change @@ -24,13 +24,17 @@ export class WorkflowMonitoringInterceptor implements WorkflowInboundCallsInterc
2424 workflow_id : info . workflowId ,
2525 workflow_type : info . workflowType ,
2626 task_queue : info . taskQueue ,
27+ attempts : info . attempt ,
2728 }
2829
2930 const start = new Date ( )
3031
3132 try {
3233 const result = await next ( input )
3334 return result
35+ } catch ( err ) {
36+ await activity . telemetryIncrement ( 'temporal.workflow_execution_error' , 1 , tags )
37+ throw err
3438 } finally {
3539 const end = new Date ( )
3640 const duration = end . getTime ( ) - start . getTime ( )
You can’t perform that action at this time.
0 commit comments