Skip to content

Commit ba42321

Browse files
author
kaiyan-sheng
authored
Check fields are documented for aws metricsets (#23887)
1 parent 342a845 commit ba42321

File tree

6 files changed

+7
-66
lines changed

6 files changed

+7
-66
lines changed

CHANGELOG.next.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
497497
- Add stack monitoring section to elasticsearch module documentation {pull}#23286[23286]
498498
- Fix metric grouping for windows/perfmon module {issue}23489[23489] {pull}23505[23505]
499499
- Add check for iis/application_pool metricset for nil worker process id values. {issue}23605[23605] {pull}23647[23647]
500+
- Unskip s3_request integration test. {pull}23887[23887]
500501
- Add system.hostfs configuration option for system module. {pull}23831[23831]
501502

502503
*Packetbeat*
@@ -959,6 +960,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
959960
- Apache: convert status.total_kbytes to status.total_bytes in fleet mode. {pull}23022[23022]
960961
- Release MSSQL as GA {pull}23146[23146]
961962
- Enrich events of `state_service` metricset with kubernetes services' metadata. {pull}23730[23730]
963+
- Check fields are documented in aws metricsets. {pull}23887[23887]
962964

963965
*Packetbeat*
964966

x-pack/metricbeat/module/aws/cloudwatch/cloudwatch_integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestFetch(t *testing.T) {
2727
}
2828

2929
assert.NotEmpty(t, events)
30+
mbtest.TestMetricsetFieldsDocumented(t, metricSet, events)
3031
}
3132

3233
func TestData(t *testing.T) {

x-pack/metricbeat/module/aws/rds/rds_integration_test.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,7 @@ func TestFetch(t *testing.T) {
2626
}
2727

2828
assert.NotEmpty(t, events)
29-
30-
for _, event := range events {
31-
t.Logf("%s/%s event: %+v", metricSet.Module().Name(), metricSet.Name(), event)
32-
33-
// RootField
34-
mtest.CheckEventField("service.name", "string", event, t)
35-
mtest.CheckEventField("cloud.provider", "string", event, t)
36-
mtest.CheckEventField("cloud.provider", "string", event, t)
37-
mtest.CheckEventField("cloud.region", "string", event, t)
38-
mtest.CheckEventField("cloud.availability_zone", "string", event, t)
39-
40-
// MetricSetField
41-
mtest.CheckEventField("db_instance.arn", "string", event, t)
42-
mtest.CheckEventField("db_instance.class", "string", event, t)
43-
mtest.CheckEventField("queries", "float", event, t)
44-
mtest.CheckEventField("latency.select", "float", event, t)
45-
mtest.CheckEventField("login_failures", "float", event, t)
46-
}
29+
mbtest.TestMetricsetFieldsDocumented(t, metricSet, events)
4730
}
4831

4932
func TestData(t *testing.T) {

x-pack/metricbeat/module/aws/s3_daily_storage/s3_daily_storage_integration_test.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@ func TestFetch(t *testing.T) {
2727
}
2828

2929
assert.NotEmpty(t, events)
30-
31-
for _, event := range events {
32-
mtest.CheckEventField("cloud.region", "string", event, t)
33-
mtest.CheckEventField("aws.dimensions.BucketName", "string", event, t)
34-
mtest.CheckEventField("aws.dimensions.StorageType", "string", event, t)
35-
mtest.CheckEventField("aws.s3.metrics.BucketSizeBytes.avg", "float", event, t)
36-
mtest.CheckEventField("aws.s3.metrics.NumberOfObjects.avg", "float", event, t)
37-
}
30+
mbtest.TestMetricsetFieldsDocumented(t, metricSet, events)
3831
}
3932

4033
func TestData(t *testing.T) {

x-pack/metricbeat/module/aws/s3_request/s3_request_integration_test.go

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
)
1919

2020
func TestFetch(t *testing.T) {
21-
t.Skip("flaky test: https://github.com/elastic/beats/issues/21826")
2221
config := mtest.GetConfigForTest(t, "s3_request", "60s")
2322

2423
metricSet := mbtest.NewReportingMetricSetV2Error(t, config)
@@ -28,28 +27,7 @@ func TestFetch(t *testing.T) {
2827
}
2928

3029
assert.NotEmpty(t, events)
31-
32-
for _, event := range events {
33-
mtest.CheckEventField("cloud.region", "string", event, t)
34-
mtest.CheckEventField("aws.dimensions.BucketName", "string", event, t)
35-
mtest.CheckEventField("aws.dimensions.StorageType", "string", event, t)
36-
mtest.CheckEventField("s3.metrics.AllRequests.avg", "int", event, t)
37-
mtest.CheckEventField("s3.metrics.GetRequests.avg", "int", event, t)
38-
mtest.CheckEventField("s3.metrics.PutRequests.avg", "int", event, t)
39-
mtest.CheckEventField("s3.metrics.DeleteRequests.avg", "int", event, t)
40-
mtest.CheckEventField("s3.metrics.HeadRequests.avg", "int", event, t)
41-
mtest.CheckEventField("s3.metrics.PostRequests.avg", "int", event, t)
42-
mtest.CheckEventField("s3.metrics.SelectRequests.avg", "int", event, t)
43-
mtest.CheckEventField("s3.metrics.SelectScannedBytes.avg", "float", event, t)
44-
mtest.CheckEventField("s3.metrics.SelectReturnedBytes.avg", "float", event, t)
45-
mtest.CheckEventField("s3.metrics.ListRequests.avg", "int", event, t)
46-
mtest.CheckEventField("s3.metrics.BytesDownloaded.avg", "float", event, t)
47-
mtest.CheckEventField("s3.metrics.BytesUploaded.avg", "float", event, t)
48-
mtest.CheckEventField("s3.metrics.4xxErrors.avg", "int", event, t)
49-
mtest.CheckEventField("s3.metrics.5xxErrors.avg", "int", event, t)
50-
mtest.CheckEventField("s3.metrics.FirstByteLatency.avg", "float", event, t)
51-
mtest.CheckEventField("s3.metrics.TotalRequestLatency.avg", "float", event, t)
52-
}
30+
mbtest.TestMetricsetFieldsDocumented(t, metricSet, events)
5331
}
5432

5533
func TestData(t *testing.T) {

x-pack/metricbeat/module/aws/sqs/sqs_integration_test.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,7 @@ func TestFetch(t *testing.T) {
2727
}
2828

2929
assert.NotEmpty(t, events)
30-
31-
for _, event := range events {
32-
// RootField
33-
mtest.CheckEventField("service.name", "string", event, t)
34-
mtest.CheckEventField("cloud.region", "string", event, t)
35-
// MetricSetField
36-
mtest.CheckEventField("empty_receives", "float", event, t)
37-
mtest.CheckEventField("messages.delayed", "float", event, t)
38-
mtest.CheckEventField("messages.deleted", "float", event, t)
39-
mtest.CheckEventField("messages.not_visible", "float", event, t)
40-
mtest.CheckEventField("messages.received", "float", event, t)
41-
mtest.CheckEventField("messages.sent", "float", event, t)
42-
mtest.CheckEventField("messages.visible", "float", event, t)
43-
mtest.CheckEventField("oldest_message_age.sec", "float", event, t)
44-
mtest.CheckEventField("sent_message_size", "float", event, t)
45-
mtest.CheckEventField("queue.name", "string", event, t)
46-
}
30+
mbtest.TestMetricsetFieldsDocumented(t, metricSet, events)
4731
}
4832

4933
func TestData(t *testing.T) {

0 commit comments

Comments
 (0)