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

Added canary url and stepfunction monitoring with sns email and slack… #40

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

bshien
Copy link
Collaborator

@bshien bshien commented Jun 6, 2024

… integration

Description

Creates a Cloudwatch Synthetic Canary to monitor the metrics.opensearch.org url and monitors the step functions for failure. If either of these fail, a message will be published to SNS, and will send email and slack notifications.

Issues Resolved

#37

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 92.50000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 76.64%. Comparing base (c0dbd62) to head (dc97672).

Current head dc97672 differs from pull request most recent head c597361

Please upload reports for the commit c597361 to get more accurate results.

Files Patch % Lines
...ava/org/opensearchmetrics/dagger/CommonModule.java 0.00% 5 Missing ⚠️
...java/org/opensearchmetrics/lambda/SlackLambda.java 92.45% 3 Missing and 1 partial ⚠️
...org/opensearchmetrics/util/SecretsManagerUtil.java 85.71% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #40      +/-   ##
============================================
+ Coverage     73.49%   76.64%   +3.15%     
- Complexity      163      174      +11     
============================================
  Files            43       51       +8     
  Lines           962     1122     +160     
  Branches         47       50       +3     
============================================
+ Hits            707      860     +153     
- Misses          234      239       +5     
- Partials         21       23       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


// The email list for receiving alerts
this.emailList = [
'[email protected]'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to project.ts

constructor(scope: Construct, id: string) {
super(scope, id);
this.secretsObject = new Secret(this, 'MetricsCreds', {
secretName: 'metrics-creds',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input from project.ts

import {Secret} from "aws-cdk-lib/aws-secretsmanager";

export class OpenSearchMetricsSecrets extends Stack {
readonly secretsObject: Secret;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name it secret

package org.opensearchmetrics.datasource;

public enum DataSourceType {
SLACK_WEBHOOK_URL,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add unit tests

@JsonProperty("AlarmName")
private String alarmName;
@JsonProperty("AlarmDescription")
private String alarmDescription;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to model

private String region;
@JsonProperty("AlarmArn")
private String alarmArn;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this AlarmObject to model/alarm package.

@bshien bshien force-pushed the monitoring-6 branch 2 times, most recently from fe78734 to ddc3fe3 Compare June 7, 2024 22:51
@bshien bshien self-assigned this Jun 10, 2024
build.gradle Outdated
@@ -28,6 +28,7 @@ dependencies {
implementation 'io.github.acm19:aws-request-signing-apache-interceptor:2.3.1'

implementation 'com.amazonaws:aws-lambda-java-core:1.2.3'
implementation 'com.amazonaws:aws-lambda-java-events:3.7.0'
Copy link
Member

@prudhvigodithi prudhvigodithi Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest one is 3.11.5, can you please update ?

@prudhvigodithi
Copy link
Member

LGTM, thanks @bshien.

@prudhvigodithi prudhvigodithi merged commit 781704c into opensearch-project:main Jun 10, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

[FEATURE] Adding SNS email and slack notifications on stepfunction and canary failure
2 participants