Skip to content

Commit a4f867d

Browse files
fix(glue): Fix incorrect dimensions on glue metrics (#178)
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_
1 parent 0fd2015 commit a4f867d

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

lib/monitoring/aws-glue/GlueJobMetricFactory.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class GlueJobMetricFactory {
2020
protected readonly metricFactory: MetricFactory;
2121
protected readonly rateComputationMethod: RateComputationMethod;
2222
protected readonly dimensionsMap: DimensionsMap;
23+
protected readonly typeCountDimensionsMap: DimensionsMap;
2324

2425
constructor(metricFactory: MetricFactory, props: GlueJobMetricFactoryProps) {
2526
this.metricFactory = metricFactory;
@@ -30,6 +31,10 @@ export class GlueJobMetricFactory {
3031
JobRunId: "ALL",
3132
JobName: props.jobName,
3233
};
34+
this.typeCountDimensionsMap = {
35+
...this.dimensionsMap,
36+
Type: "count",
37+
};
3338
}
3439

3540
metricTotalReadBytesFromS3() {
@@ -96,7 +101,7 @@ export class GlueJobMetricFactory {
96101
"glue.driver.aggregate.numCompletedStages",
97102
MetricStatistic.SUM,
98103
"Completed Stages",
99-
this.dimensionsMap,
104+
this.typeCountDimensionsMap,
100105
undefined,
101106
GlueNamespace
102107
);
@@ -107,7 +112,7 @@ export class GlueJobMetricFactory {
107112
"glue.driver.aggregate.numCompletedTasks",
108113
MetricStatistic.SUM,
109114
"Completed Tasks",
110-
this.dimensionsMap,
115+
this.typeCountDimensionsMap,
111116
undefined,
112117
GlueNamespace
113118
);
@@ -118,7 +123,7 @@ export class GlueJobMetricFactory {
118123
"glue.driver.aggregate.numFailedTasks",
119124
MetricStatistic.SUM,
120125
"Failed Tasks",
121-
this.dimensionsMap,
126+
this.typeCountDimensionsMap,
122127
undefined,
123128
GlueNamespace
124129
);
@@ -139,7 +144,7 @@ export class GlueJobMetricFactory {
139144
"glue.driver.aggregate.numKilledTasks",
140145
MetricStatistic.SUM,
141146
"Killed Tasks",
142-
this.dimensionsMap,
147+
this.typeCountDimensionsMap,
143148
undefined,
144149
GlueNamespace
145150
);

test/facade/__snapshots__/MonitoringAspect.test.ts.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)