Skip to content

Commit 1f70143

Browse files
author
Eugene Cheung
committed
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_ (cherry picked from commit b66685e)
1 parent 97fbcb8 commit 1f70143

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
@@ -43265,6 +43265,7 @@ new OpenSearchBackportedMetrics(domain: IDomain | CfnDomain | IDomain | CfnDomai
4326543265
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metric">metric</a></code> | Return the given named metric for this Domain. |
4326643266
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricAutomatedSnapshotFailure">metricAutomatedSnapshotFailure</a></code> | Metric for automated snapshot failures. |
4326743267
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWriteBlocked">metricClusterIndexWriteBlocked</a></code> | Metric for the cluster blocking index writes. |
43268+
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWritesBlocked">metricClusterIndexWritesBlocked</a></code> | Metric for the cluster blocking index writes. |
4326843269
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterStatusRed">metricClusterStatusRed</a></code> | Metric for the time the cluster status is red. |
4326943270
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterStatusYellow">metricClusterStatusYellow</a></code> | Metric for the time the cluster status is yellow. |
4327043271
| <code><a href="#cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricCPUUtilization">metricCPUUtilization</a></code> | Metric for CPU utilization. |
@@ -43315,7 +43316,7 @@ Metric for automated snapshot failures.
4331543316

4331643317
---
4331743318

43318-
##### `metricClusterIndexWriteBlocked` <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWriteBlocked"></a>
43319+
##### ~~`metricClusterIndexWriteBlocked`~~ <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWriteBlocked"></a>
4331943320

4332043321
```typescript
4332143322
public metricClusterIndexWriteBlocked(props?: MetricOptions): Metric
@@ -43329,6 +43330,20 @@ Metric for the cluster blocking index writes.
4332943330

4333043331
---
4333143332

43333+
##### `metricClusterIndexWritesBlocked` <a name="metricClusterIndexWritesBlocked" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWritesBlocked"></a>
43334+
43335+
```typescript
43336+
public metricClusterIndexWritesBlocked(props?: MetricOptions): Metric
43337+
```
43338+
43339+
Metric for the cluster blocking index writes.
43340+
43341+
###### `props`<sup>Optional</sup> <a name="props" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterIndexWritesBlocked.parameter.props"></a>
43342+
43343+
- *Type:* monocdk.aws_cloudwatch.MetricOptions
43344+
43345+
---
43346+
4333243347
##### `metricClusterStatusRed` <a name="metricClusterStatusRed" id="cdk-monitoring-constructs.OpenSearchBackportedMetrics.metricClusterStatusRed"></a>
4333343348

4333443349
```typescript
@@ -43731,6 +43746,7 @@ new OpenSearchClusterMetricFactory(metricFactory: MetricFactory, props: OpenSear
4373143746
| --- | --- |
4373243747
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricAutomatedSnapshotFailure">metricAutomatedSnapshotFailure</a></code> | *No description.* |
4373343748
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWriteBlocked">metricClusterIndexWriteBlocked</a></code> | *No description.* |
43749+
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWritesBlocked">metricClusterIndexWritesBlocked</a></code> | *No description.* |
4373443750
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterStatusRed">metricClusterStatusRed</a></code> | *No description.* |
4373543751
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterStatusYellow">metricClusterStatusYellow</a></code> | *No description.* |
4373643752
| <code><a href="#cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricCpuUsage">metricCpuUsage</a></code> | *No description.* |
@@ -43759,12 +43775,18 @@ new OpenSearchClusterMetricFactory(metricFactory: MetricFactory, props: OpenSear
4375943775
public metricAutomatedSnapshotFailure(): Metric | MathExpression
4376043776
```
4376143777

43762-
##### `metricClusterIndexWriteBlocked` <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWriteBlocked"></a>
43778+
##### ~~`metricClusterIndexWriteBlocked`~~ <a name="metricClusterIndexWriteBlocked" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWriteBlocked"></a>
4376343779

4376443780
```typescript
4376543781
public metricClusterIndexWriteBlocked(): Metric | MathExpression
4376643782
```
4376743783

43784+
##### `metricClusterIndexWritesBlocked` <a name="metricClusterIndexWritesBlocked" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterIndexWritesBlocked"></a>
43785+
43786+
```typescript
43787+
public metricClusterIndexWritesBlocked(): Metric | MathExpression
43788+
```
43789+
4376843790
##### `metricClusterStatusRed` <a name="metricClusterStatusRed" id="cdk-monitoring-constructs.OpenSearchClusterMetricFactory.metricClusterStatusRed"></a>
4376943791

4377043792
```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)