Skip to content

Commit

Permalink
fix(glue): Fix incorrect dimensions on glue metrics (#178)
Browse files Browse the repository at this point in the history
Fixes #177 

Ref: https://docs.aws.amazon.com/glue/latest/dg/monitoring-awsglue-with-cloudwatch-metrics.html

---

_By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
  • Loading branch information
ayush987goyal authored Jun 23, 2022
1 parent 0fd2015 commit a4f867d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
13 changes: 9 additions & 4 deletions lib/monitoring/aws-glue/GlueJobMetricFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class GlueJobMetricFactory {
protected readonly metricFactory: MetricFactory;
protected readonly rateComputationMethod: RateComputationMethod;
protected readonly dimensionsMap: DimensionsMap;
protected readonly typeCountDimensionsMap: DimensionsMap;

constructor(metricFactory: MetricFactory, props: GlueJobMetricFactoryProps) {
this.metricFactory = metricFactory;
Expand All @@ -30,6 +31,10 @@ export class GlueJobMetricFactory {
JobRunId: "ALL",
JobName: props.jobName,
};
this.typeCountDimensionsMap = {
...this.dimensionsMap,
Type: "count",
};
}

metricTotalReadBytesFromS3() {
Expand Down Expand Up @@ -96,7 +101,7 @@ export class GlueJobMetricFactory {
"glue.driver.aggregate.numCompletedStages",
MetricStatistic.SUM,
"Completed Stages",
this.dimensionsMap,
this.typeCountDimensionsMap,
undefined,
GlueNamespace
);
Expand All @@ -107,7 +112,7 @@ export class GlueJobMetricFactory {
"glue.driver.aggregate.numCompletedTasks",
MetricStatistic.SUM,
"Completed Tasks",
this.dimensionsMap,
this.typeCountDimensionsMap,
undefined,
GlueNamespace
);
Expand All @@ -118,7 +123,7 @@ export class GlueJobMetricFactory {
"glue.driver.aggregate.numFailedTasks",
MetricStatistic.SUM,
"Failed Tasks",
this.dimensionsMap,
this.typeCountDimensionsMap,
undefined,
GlueNamespace
);
Expand All @@ -139,7 +144,7 @@ export class GlueJobMetricFactory {
"glue.driver.aggregate.numKilledTasks",
MetricStatistic.SUM,
"Killed Tasks",
this.dimensionsMap,
this.typeCountDimensionsMap,
undefined,
GlueNamespace
);
Expand Down
8 changes: 4 additions & 4 deletions test/facade/__snapshots__/MonitoringAspect.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a4f867d

Please sign in to comment.