Skip to content

Commit

Permalink
fix(stepfunctions): specify graph line colors to ensure failed execut…
Browse files Browse the repository at this point in the history
…ions don't show as green
  • Loading branch information
kamalgill committed Aug 23, 2024
1 parent ba66f8a commit 838514d
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 838514d

Please sign in to comment.