Skip to content

Commit

Permalink
add missing . when constructing aws.*.metrics.*.*
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiyan-sheng committed Apr 8, 2021
1 parent e68e4df commit bd7784b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
10 changes: 10 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,16 @@ type: keyword
Metric dimensions.


type: object

--

*`aws.*.metrics.*.*`*::
+
--
Metrics that returned from Cloudwatch API query.


type: object

--
Expand Down
6 changes: 3 additions & 3 deletions metricbeat/mb/testing/testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func TestMetricsetFieldsDocumented(t *testing.T, metricSet mb.MetricSet, events
}

if err := checkDocumented(data, nil); err != nil {
t.Errorf("%v: check if fields are documented in `metricbeat/%s/%s/_meta/fields.yml` "+
t.Errorf("%v: check if fields are documented in `metricbeat/module/%s/%s/_meta/fields.yml` "+
"file or run 'make update' on Metricbeat folder to update fields in `metricbeat/fields.yml`",
err, metricSet.Module().Name(), metricSet.Name())
}
Expand Down Expand Up @@ -232,7 +232,7 @@ func runTest(t *testing.T, file string, module, metricSetName string, config Dat
})

if err := checkDocumented(data, config.OmitDocumentedFieldsCheck); err != nil {
t.Errorf("%v: check if fields are documented in `metricbeat/%s/%s/_meta/fields.yml` "+
t.Errorf("%v: check if fields are documented in `metricbeat/module/%s/%s/_meta/fields.yml` "+
"file or run 'make update' on Metricbeat folder to update fields in `metricbeat/fields.yml`",
err, module, metricSetName)
}
Expand Down Expand Up @@ -380,7 +380,7 @@ func documentedFieldCheck(foundKeys common.MapStr, knownKeys map[string]interfac

// case `aws.*.metrics.*.*`:
if len(splits) == 5 {
if _, ok := knownKeys[splits[0]+".*"+splits[2]+".*.*"]; ok {
if _, ok := knownKeys[splits[0]+".*."+splits[2]+".*.*"]; ok {
continue
}
}
Expand Down
6 changes: 6 additions & 0 deletions x-pack/metricbeat/module/aws/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@
object_type_mapping_type: "*"
description: >
Metric dimensions.
- name: '*.metrics.*.*'
type: object
object_type: double
object_type_mapping_type: "*"
description: >
Metrics that returned from Cloudwatch API query.
Loading

0 comments on commit bd7784b

Please sign in to comment.