aws-xray icon indicating copy to clipboard operation
aws-xray copied to clipboard

Special trace for cron / cavalcade jobs

Open joehoyle opened this issue 6 years ago • 2 comments

When a cavalcade job is running, we probably want to track it as a new service "$site_name-cavalcade" so metrics are not shared with web requests. We'd also want to change a lot of the metadata to be about the job being run. I can't find a way to actually hook before / after a cavalcade job is run though. Unless there's a special before / after WP CLI command hook - Cavalcade plugin doesn't provide any hooks for this.

This would possibly work at the Cavalcade-Runner level too, which is how we capture the data for CloudWatch, but this wouldn't let us get a xhprof trace of the job, or many other in-process data that we get for web requests.

@rmccue am I missing a way to be able to hook before a Cavalcade job is run? Aside from hook all and check defined( 'CAVALCADE_JOB_ID' ); perhaps.

joehoyle avatar May 18 '18 16:05 joehoyle

@joehoyle what about WP CLI's command hooks? Could you add some to the command the runner runs? Similar to how we run the ElasticPress indexing after WP is installed.

roborourke avatar Jun 22 '20 14:06 roborourke

@roborourke mm yeha that would probably work actually!

joehoyle avatar Jun 22 '20 15:06 joehoyle