Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <[email protected]>
  • Loading branch information
gaiksaya committed Dec 15, 2023
1 parent bdd2be6 commit e790c8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/infra/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { dump, load } from 'js-yaml';
import { join } from 'path';
import { CloudwatchAgent } from '../cloudwatch/cloudwatch-agent';
import { ProcstatMetricDefinition } from '../cloudwatch/metrics-section';
import { Monitoring } from '../monitoring/alarms';
import { InfraStackMonitoring } from '../monitoring/alarms';
import { nodeConfig } from '../opensearch-config/node-config';
import { RemoteStoreResources } from './remote-store-resources';

Expand Down Expand Up @@ -396,7 +396,7 @@ export class InfraStack extends Stack {
value: nlb.loadBalancerDnsName,
});

const monitoring = new Monitoring(this, props);
const monitoring = new InfraStackMonitoring(this, props.dashboardsUrl);
}

private static getCfnInitElement(scope: Stack, logGroup: LogGroup, props: infraProps, nodeType?: string): InitElement[] {
Expand Down
10 changes: 5 additions & 5 deletions lib/monitoring/alarms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*/

import {
Alarm, AlarmWidget, ComparisonOperator, Dashboard, TreatMissingData,
Alarm, AlarmWidget, ComparisonOperator, Dashboard, TreatMissingData,
} from 'aws-cdk-lib/aws-cloudwatch';
import { InfraStack, infraProps } from '../infra/infra-stack';
import { InfraStack } from '../infra/infra-stack';

export class Monitoring {
export class InfraStackMonitoring {
public readonly alarms: Alarm[] = []

constructor(infraStack: InfraStack, infraprops: infraProps) {
constructor(infraStack: InfraStack, dashboardsUrl: string) {
const alarmDashboard = new Dashboard(infraStack, 'AlarmDashboard');
this.alarms.push(new Alarm(infraStack, 'OpenSearchProcessNotFound', {
alarmDescription: 'OpenSearch Process not found',
Expand All @@ -26,7 +26,7 @@ export class Monitoring {
treatMissingData: TreatMissingData.IGNORE,
}));

if (infraprops.dashboardsUrl !== 'undefined' && infraStack.alarmMetrics.openSearchDashboardsProcessNotFound !== undefined) {
if (dashboardsUrl !== 'undefined' && infraStack.alarmMetrics.openSearchDashboardsProcessNotFound !== undefined) {
this.alarms.push(new Alarm(infraStack, 'OpenSearchDashboardsProcessNotFound', {
alarmDescription: 'OpenSearch Dashboards Process not found',
metric: infraStack.alarmMetrics.openSearchDashboardsProcessNotFound.with({ statistic: 'avg' }),
Expand Down

0 comments on commit e790c8d

Please sign in to comment.