Skip to content

Commit

Permalink
Merge pull request #944 from humanmade/backport-940-to-v21-branch
Browse files Browse the repository at this point in the history
[Backport v21-branch] Remove job level cavalcade metrics
  • Loading branch information
mikelittle authored Feb 28, 2025
2 parents 55dc679 + 1a22969 commit 55c8cf8
Showing 1 changed file with 1 addition and 58 deletions.
59 changes: 1 addition & 58 deletions inc/cavalcade_runner_to_cloudwatch/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function on_job_completed( Worker $worker, Job $job ) {
}

/**
* Called when a job completed or failed via Cavalcade, and sends a Dureaction metric to CloudWatch.
* Called when a job completed or failed via Cavalcade, and sends a Duration metric to CloudWatch.
*
* @param Worker $worker The Cavalcade runner process.
* @param Job $job The current Cavalcade cron job.
Expand All @@ -74,20 +74,6 @@ function on_end_job( Worker $worker, Job $job, string $status ) {

// Batch all the metrics together to avoid many API calls.
$data = [];
$data[] = [
'MetricName' => $status_metric,
'Dimensions' => [
[
'Name' => 'Application',
'Value' => HM_ENV,
],
[
'Name' => 'Job',
'Value' => $job->hook,
],
],
'Value' => 1,
];
$data[] = [
'MetricName' => $status_metric,
'Dimensions' => [
Expand All @@ -103,20 +89,6 @@ function on_end_job( Worker $worker, Job $job, string $status ) {
'Value' => 1,
];

$data[] = [
'MetricName' => 'Invocations',
'Dimensions' => [
[
'Name' => 'Application',
'Value' => HM_ENV,
],
[
'Name' => 'Job',
'Value' => $job->hook,
],
],
'Value' => 1,
];
$data[] = [
'MetricName' => 'Invocations',
'Dimensions' => [
Expand All @@ -131,35 +103,6 @@ function on_end_job( Worker $worker, Job $job, string $status ) {
'MetricName' => 'Invocations',
'Value' => 1,
];
$data[] = [
'MetricName' => 'Duration',
'Dimensions' => [
[
'Name' => 'Application',
'Value' => HM_ENV,
],
[
'Name' => 'Job',
'Value' => $job->hook,
],
],
'Value' => $duration,
];
$data[] = [
'MetricName' => 'Duration',
'Unit' => 'Seconds',
'Dimensions' => [
[
'Name' => 'Application',
'Value' => HM_ENV,
],
[
'Name' => 'Job',
'Value' => $job->hook,
],
],
'Value' => $duration,
];
$data[] = [
'MetricName' => 'Duration',
'Unit' => 'Seconds',
Expand Down

0 comments on commit 55c8cf8

Please sign in to comment.