Skip to content

Commit

Permalink
fix(elasticsearch): use correct latency metric names (#11175)
Browse files Browse the repository at this point in the history
Fixes #11174

As per the issue details, this uses the correct metric names as described in [the documentation](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains-cloudwatchmetrics.html).

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
arkon authored Nov 8, 2020
1 parent 51cd8af commit 7ab5ab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-elasticsearch/lib/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ abstract class DomainBase extends cdk.Resource implements IDomain {
* @default p99 over 5 minutes
*/
public metricSearchLatency(props?: MetricOptions): Metric {
return this.metric('SearchLatencyP99', { statistic: 'p99', ...props });
return this.metric('SearchLatency', { statistic: 'p99', ...props });
}

/**
Expand All @@ -1047,7 +1047,7 @@ abstract class DomainBase extends cdk.Resource implements IDomain {
* @default p99 over 5 minutes
*/
public metricIndexingLatency(props?: MetricOptions): Metric {
return this.metric('IndexingLatencyP99', { statistic: 'p99', ...props });
return this.metric('IndexingLatency', { statistic: 'p99', ...props });
}

private grant(
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-elasticsearch/test/domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,15 @@ describe('metrics', () => {
test('Can use metricSearchLatency on an Elasticsearch Domain', () => {
testMetric(
(domain) => domain.metricSearchLatency(),
'SearchLatencyP99',
'SearchLatency',
'p99',
);
});

test('Can use metricIndexingLatency on an Elasticsearch Domain', () => {
testMetric(
(domain) => domain.metricIndexingLatency(),
'IndexingLatencyP99',
'IndexingLatency',
'p99',
);
});
Expand Down

0 comments on commit 7ab5ab8

Please sign in to comment.