Skip to content

Commit

Permalink
fix(stepfunctions): specify line colors for Step Functions Executions…
Browse files Browse the repository at this point in the history
… 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_
  • Loading branch information
kamalgill authored Aug 23, 2024
1 parent ba66f8a commit b94319b
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 58 deletions.
12 changes: 12 additions & 0 deletions lib/common/widget/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ export const ErrorColor = "#d13212";
* color to indicate neutral information
*/
export const NeutralColor = "#999999";
/**
* color to indicate throttled state
*/
export const ThrottledColor = "#5928ed";
/**
* color to indicate a started state (e.g. Step Function executions)
*/
export const StartedColor = "#0073e6";
/**
* color to indicate a timed out state
*/
export const TimedOutColor = "#333333";
18 changes: 12 additions & 6 deletions lib/monitoring/aws-step-functions/StepFunctionMetricFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ import { IStateMachine } from "aws-cdk-lib/aws-stepfunctions";
import {
BaseMetricFactory,
BaseMetricFactoryProps,
ErrorColor,
HealthyMetricColor,
MetricFactory,
MetricStatistic,
RateComputationMethod,
StartedColor,
ThrottledColor,
TimedOutColor,
WarningColor,
} from "../../common";

const Namespace = "AWS/States";
Expand Down Expand Up @@ -83,7 +89,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
MetricStatistic.SUM,
"Failed",
this.dimensionsMap,
undefined,
ErrorColor,
Namespace,
undefined,
this.region,
Expand All @@ -106,7 +112,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
MetricStatistic.SUM,
"Timeout",
this.dimensionsMap,
undefined,
TimedOutColor,
Namespace,
undefined,
this.region,
Expand All @@ -120,7 +126,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
MetricStatistic.SUM,
"Throttled",
this.dimensionsMap,
undefined,
ThrottledColor,
Namespace,
undefined,
this.region,
Expand All @@ -134,7 +140,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
MetricStatistic.SUM,
"Aborted",
this.dimensionsMap,
undefined,
WarningColor,
Namespace,
undefined,
this.region,
Expand All @@ -148,7 +154,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
MetricStatistic.SUM,
"Started",
this.dimensionsMap,
undefined,
StartedColor,
Namespace,
undefined,
this.region,
Expand All @@ -162,7 +168,7 @@ export class StepFunctionMetricFactory extends BaseMetricFactory<StepFunctionMet
MetricStatistic.SUM,
"Succeeded",
this.dimensionsMap,
undefined,
HealthyMetricColor,
Namespace,
undefined,
this.region,
Expand Down
26 changes: 13 additions & 13 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 b94319b

Please sign in to comment.