Skip to content

Commit b66685e

Browse files
author
Eugene Cheung
authored
fix(elasticsearch/opensearch): fix ClusterIndexWritesBlocked metric name (#135)
As reported internally. The correct metric name should be `ClusterIndexWritesBlocked` according to https://docs.aws.amazon.com/opensearch-service/latest/developerguide/cloudwatch-alarms.html --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 6a5f0e0 commit b66685e

File tree

5 files changed

+51
-11
lines changed

5 files changed

+51
-11
lines changed

API.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43333,6 +43333,7 @@ new OpenSearchBackportedMetrics(domain: IDomain | CfnDomain | IDomain | CfnDomai
4333343333
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metric">metric</a></code> | Return the given named metric for this Domain. |
4333443334
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricAutomatedSnapshotFailure">metricAutomatedSnapshotFailure</a></code> | Metric for automated snapshot failures. |
4333543335
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWriteBlocked">metricClusterIndexWriteBlocked</a></code> | Metric for the cluster blocking index writes. |
43336+
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWritesBlocked">metricClusterIndexWritesBlocked</a></code> | Metric for the cluster blocking index writes. |
4333643337
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterStatusRed">metricClusterStatusRed</a></code> | Metric for the time the cluster status is red. |
4333743338
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterStatusYellow">metricClusterStatusYellow</a></code> | Metric for the time the cluster status is yellow. |
4333843339
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricCPUUtilization">metricCPUUtilization</a></code> | Metric for CPU utilization. |
@@ -43383,7 +43384,7 @@ Metric for automated snapshot failures.
4338343384

4338443385
---
4338543386

43386-
##### `metricClusterIndexWriteBlocked` <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWriteBlocked"></a>
43387+
##### ~~`metricClusterIndexWriteBlocked`~~ <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWriteBlocked"></a>
4338743388

4338843389
```typescript
4338943390
public metricClusterIndexWriteBlocked(props?: MetricOptions): Metric
@@ -43397,6 +43398,20 @@ Metric for the cluster blocking index writes.
4339743398

4339843399
---
4339943400

43401+
##### `metricClusterIndexWritesBlocked` <a name="metricClusterIndexWritesBlocked" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWritesBlocked"></a>
43402+
43403+
```typescript
43404+
public metricClusterIndexWritesBlocked(props?: MetricOptions): Metric
43405+
```
43406+
43407+
Metric for the cluster blocking index writes.
43408+
43409+
###### `props`<sup>Optional</sup> <a name="props" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWritesBlocked.parameter.props"></a>
43410+
43411+
- *Type:* aws-cdk-lib.aws_cloudwatch.MetricOptions
43412+
43413+
---
43414+
4340043415
##### `metricClusterStatusRed` <a name="metricClusterStatusRed" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterStatusRed"></a>
4340143416

4340243417
```typescript
@@ -43799,6 +43814,7 @@ new OpenSearchClusterMetricFactory(metricFactory: MetricFactory, props: OpenSear
4379943814
| --- | --- |
4380043815
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricAutomatedSnapshotFailure">metricAutomatedSnapshotFailure</a></code> | *No description.* |
4380143816
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWriteBlocked">metricClusterIndexWriteBlocked</a></code> | *No description.* |
43817+
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWritesBlocked">metricClusterIndexWritesBlocked</a></code> | *No description.* |
4380243818
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterStatusRed">metricClusterStatusRed</a></code> | *No description.* |
4380343819
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterStatusYellow">metricClusterStatusYellow</a></code> | *No description.* |
4380443820
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricCpuUsage">metricCpuUsage</a></code> | *No description.* |
@@ -43827,12 +43843,18 @@ new OpenSearchClusterMetricFactory(metricFactory: MetricFactory, props: OpenSear
4382743843
public metricAutomatedSnapshotFailure(): Metric | MathExpression
4382843844
```
4382943845

43830-
##### `metricClusterIndexWriteBlocked` <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWriteBlocked"></a>
43846+
##### ~~`metricClusterIndexWriteBlocked`~~ <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWriteBlocked"></a>
4383143847

4383243848
```typescript
4383343849
public metricClusterIndexWriteBlocked(): Metric | MathExpression
4383443850
```
4383543851

43852+
##### `metricClusterIndexWritesBlocked` <a name="metricClusterIndexWritesBlocked" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWritesBlocked"></a>
43853+
43854+
```typescript
43855+
public metricClusterIndexWritesBlocked(): Metric | MathExpression
43856+
```
43857+
4383643858
##### `metricClusterStatusRed` <a name="metricClusterStatusRed" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterStatusRed"></a>
4383743859

4383843860
```typescript

lib/monitoring/aws-opensearch/OpenSearchBackportedMetrics.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,25 @@ export class OpenSearchBackportedMetrics {
8787
*
8888
* @default maximum over 1 minute
8989
*/
90-
metricClusterIndexWriteBlocked(props?: MetricOptions): Metric {
91-
return this.metric("ClusterIndexWriteBlocked", {
90+
metricClusterIndexWritesBlocked(props?: MetricOptions): Metric {
91+
return this.metric("ClusterIndexWritesBlocked", {
9292
statistic: Statistic.MAXIMUM,
9393
period: Duration.minutes(1),
9494
...props,
9595
});
9696
}
9797

98+
/**
99+
* Metric for the cluster blocking index writes.
100+
*
101+
* @default maximum over 1 minute
102+
*
103+
* @deprecated use metricClusterIndexWritesBlocked instead.
104+
*/
105+
metricClusterIndexWriteBlocked(props?: MetricOptions): Metric {
106+
return this.metricClusterIndexWritesBlocked(props);
107+
}
108+
98109
/**
99110
* Metric for the number of nodes.
100111
*

lib/monitoring/aws-opensearch/OpenSearchClusterMetricFactory.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,21 @@ export class OpenSearchClusterMetricFactory {
184184
);
185185
}
186186

187-
metricClusterIndexWriteBlocked() {
187+
metricClusterIndexWritesBlocked() {
188188
return this.metricFactory.adaptMetric(
189-
this.domainMetrics.metricClusterIndexWriteBlocked({
189+
this.domainMetrics.metricClusterIndexWritesBlocked({
190190
label: "Index Writes Blocked",
191191
})
192192
);
193193
}
194194

195+
/**
196+
* @deprecated use metricClusterIndexWritesBlocked instead
197+
*/
198+
metricClusterIndexWriteBlocked() {
199+
return this.metricClusterIndexWritesBlocked();
200+
}
201+
195202
metricNodes() {
196203
return this.metricFactory.adaptMetric(
197204
this.domainMetrics.metricNodes({

lib/monitoring/aws-opensearch/OpenSearchClusterMonitoring.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class OpenSearchClusterMonitoring extends Monitoring {
183183
this.masterJvmMemoryPressureMetric =
184184
metricFactory.metricMasterJvmMemoryPressure();
185185
this.indexWriteBlockedMetric =
186-
metricFactory.metricClusterIndexWriteBlocked();
186+
metricFactory.metricClusterIndexWritesBlocked();
187187
this.nodesMetric = metricFactory.metricNodes();
188188
this.automatedSnapshotFailureMetric =
189189
metricFactory.metricAutomatedSnapshotFailure();

test/facade/__snapshots__/MonitoringAspect.test.ts.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)