Skip to content

Commit b94319b

Browse files
authored
fix(stepfunctions): specify line colors for Step Functions Executions graph to ensure failed executions don't show as green (#562)
The Step Functions Executions graph doesn't specify line colors for the various metrics, which may lead to failed executions displaying as a green line, and succeeded executions displaying as an orange line, as in the screenshot below. This PR specifies line colors to avoid that anomaly. ![Screenshot 2024-08-20 at 11 00 05 AM](https://github.com/user-attachments/assets/56411be6-f20a-4d34-ac3b-da128c587dd4) --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent ba66f8a commit b94319b

File tree

4 files changed

+76
-58
lines changed

4 files changed

+76
-58
lines changed

lib/common/widget/color.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,15 @@ export const ErrorColor = "#d13212";
1818
* color to indicate neutral information
1919
*/
2020
export const NeutralColor = "#999999";
21+
/**
22+
* color to indicate throttled state
23+
*/
24+
export const ThrottledColor = "#5928ed";
25+
/**
26+
* color to indicate a started state (e.g. Step Function executions)
27+
*/
28+
export const StartedColor = "#0073e6";
29+
/**
30+
* color to indicate a timed out state
31+
*/
32+
export const TimedOutColor = "#333333";

lib/monitoring/aws-step-functions/StepFunctionMetricFactory.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ import { IStateMachine } from "aws-cdk-lib/aws-stepfunctions";
44
import {
55
BaseMetricFactory,
66
BaseMetricFactoryProps,
7+
ErrorColor,
8+
HealthyMetricColor,
79
MetricFactory,
810
MetricStatistic,
911
RateComputationMethod,
12+
StartedColor,
13+
ThrottledColor,
14+
TimedOutColor,
15+
WarningColor,
1016
} from "../../common";
1117

1218
const Namespace = "AWS/States";
@@ -83,7 +89,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
8389
MetricStatistic.SUM,
8490
"Failed",
8591
this.dimensionsMap,
86-
undefined,
92+
ErrorColor,
8793
Namespace,
8894
undefined,
8995
this.region,
@@ -106,7 +112,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
106112
MetricStatistic.SUM,
107113
"Timeout",
108114
this.dimensionsMap,
109-
undefined,
115+
TimedOutColor,
110116
Namespace,
111117
undefined,
112118
this.region,
@@ -120,7 +126,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
120126
MetricStatistic.SUM,
121127
"Throttled",
122128
this.dimensionsMap,
123-
undefined,
129+
ThrottledColor,
124130
Namespace,
125131
undefined,
126132
this.region,
@@ -134,7 +140,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
134140
MetricStatistic.SUM,
135141
"Aborted",
136142
this.dimensionsMap,
137-
undefined,
143+
WarningColor,
138144
Namespace,
139145
undefined,
140146
this.region,
@@ -148,7 +154,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
148154
MetricStatistic.SUM,
149155
"Started",
150156
this.dimensionsMap,
151-
undefined,
157+
StartedColor,
152158
Namespace,
153159
undefined,
154160
this.region,
@@ -162,7 +168,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
162168
MetricStatistic.SUM,
163169
"Succeeded",
164170
this.dimensionsMap,
165-
undefined,
171+
HealthyMetricColor,
166172
Namespace,
167173
undefined,
168174
this.region,

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

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

0 commit comments

Comments
 (0)