Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish continuous metrics on blocked pipelines #7

Open
openwebsolns opened this issue Dec 17, 2022 · 0 comments
Open

Publish continuous metrics on blocked pipelines #7

openwebsolns opened this issue Dec 17, 2022 · 0 comments

Comments

@openwebsolns
Copy link
Owner

Problem

As a pipeline owner, I'd like metrics whenever my pipeline is blocked. The best built-in mechanism for this today in AWS is to publish an event on detail "CodePipeline Pipeline Execution State Changed" with state "FAILED"; then create an alarm around the AWS Events metrics for this rule. The problem is that this metric only exists when there is a state change, which means that the state of the alarm does not reflect the current state of the pipeline.

Solution

By having the enforcer emit metrics on every execution as to the state of the pipeline, we get a steady stream of metric values that can be used for continuous monitoring of the pipeline's health, without incurring AWS Events involvement.

Requirements

Ergonomics

  • DeploymentSafetyEnforcer should accept a new setting for "pipelineMetrics" that allows the customer to enable/disable the feature. Because we are publishing custom metrics, which are not free, we do not want to enable by default
  • The pipeline metrics configuration should allow the customer to override the CloudWatch metrics namespace, with default value DeploymentSafetyEnforcer.
  • Construct should expose a metricPipelineFailed() method, akin to CDK's DynamoDB Table construct, which exposes the metric value for easy alarm creation (alarm creation is outside the scope and better suited for cdk-monitoring-constructs).
  • Metric should use PipelineName as the dimension
  • To start, metric name should be PipelineBlocked

Potentially, in the future, we may enable more fine-grained metrics such as "StageBlocked", etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant