From e2744ea5e1a7033344721d8398fee8b7e4067079 Mon Sep 17 00:00:00 2001 From: Mario Castro Date: Fri, 26 Jun 2020 22:56:09 +0200 Subject: [PATCH] Cherry-pick #19055 to 7.x: [Metricbeat] Update Couchbase module to 6.5 version (#19460) --- CHANGELOG.next.asciidoc | 2 ++ metricbeat/docs/fields.asciidoc | 10 +++---- metricbeat/docs/modules/couchbase.asciidoc | 2 +- metricbeat/module/couchbase/_meta/Dockerfile | 2 +- .../module/couchbase/_meta/docs.asciidoc | 2 +- .../module/couchbase/bucket/_meta/fields.yml | 4 +-- metricbeat/module/couchbase/bucket/data.go | 2 +- .../module/couchbase/cluster/_meta/fields.yml | 4 +-- metricbeat/module/couchbase/cluster/data.go | 4 +-- .../module/couchbase/docker-compose.yml | 4 +-- metricbeat/module/couchbase/fields.go | 2 +- .../module/couchbase/node/_meta/fields.yml | 2 +- metricbeat/module/couchbase/node/data.go | 28 +++++++++---------- metricbeat/module/couchbase/test_couchbase.py | 3 ++ 14 files changed, 38 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 0fcc99264e7..ba418cb45f7 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -300,6 +300,7 @@ field. You can revert this change by configuring tags for the module and omittin - Fix incorrect usage of hints builder when exposed port is a substring of the hint {pull}19052[19052] - Stop counterCache only when already started {pull}19103[19103] - Remove dedot for tag values in aws module. {issue}19112[19112] {pull}19221[19221] +- Fix bug incorrect parsing of float numbers as integers in Couchbase module {issue}18949[18949] {pull}19055[19055] *Packetbeat* @@ -588,6 +589,7 @@ field. You can revert this change by configuring tags for the module and omittin - Add memory metrics into compute googlecloud. {pull}18802[18802] - Add new fields to HAProxy module. {issue}18523[18523] - Add Tomcat overview dashboard {pull}14026[14026] +- Update Couchbase to version 6.5 {issue}18595[18595] {pull}19055[19055] - Add support for v1 consumer API in Cloud Foundry module, use it by default. {pull}19268[19268] *Packetbeat* diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index c49f7029b42..eb81dfff846 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -6650,7 +6650,7 @@ format: bytes Number of disk fetches. -type: long +type: double -- @@ -6708,7 +6708,7 @@ format: percent Number of operations per second. -type: long +type: double -- @@ -6805,7 +6805,7 @@ type: long Memory quota setting for the Index service (Mbyte). -type: long +type: double -- @@ -6815,7 +6815,7 @@ type: long Memory quota setting for the cluster (Mbyte). -type: long +type: double -- @@ -6916,7 +6916,7 @@ Couchbase node metrics. Number of get commands -type: long +type: double -- diff --git a/metricbeat/docs/modules/couchbase.asciidoc b/metricbeat/docs/modules/couchbase.asciidoc index b2520c45f7b..310e45a356e 100644 --- a/metricbeat/docs/modules/couchbase.asciidoc +++ b/metricbeat/docs/modules/couchbase.asciidoc @@ -11,7 +11,7 @@ servers. The default metricsets are `bucket`, `cluster`, `node`. [float] === Compatibility -The Couchbase module is tested with Couchbase 4.5.1. +The Couchbase module is tested with Couchbase 6.5.1. [float] diff --git a/metricbeat/module/couchbase/_meta/Dockerfile b/metricbeat/module/couchbase/_meta/Dockerfile index 7922b1b1c6d..40a746ca21e 100644 --- a/metricbeat/module/couchbase/_meta/Dockerfile +++ b/metricbeat/module/couchbase/_meta/Dockerfile @@ -1,6 +1,6 @@ ARG COUCHBASE_VERSION FROM couchbase:${COUCHBASE_VERSION} -HEALTHCHECK --interval=1s --retries=90 CMD [ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8091/pools/default/buckets/beer-sample)" -eq "200" ] +HEALTHCHECK --interval=1s --retries=90 CMD [ "$(curl -s -o /dev/null -w ''%{http_code}'' -u Administrator:password http://localhost:8091/pools/default/buckets/beer-sample)" -eq "200" ] COPY configure-node.sh /opt/couchbase CMD ["/opt/couchbase/configure-node.sh"] diff --git a/metricbeat/module/couchbase/_meta/docs.asciidoc b/metricbeat/module/couchbase/_meta/docs.asciidoc index ade58fd9d45..6499a83b749 100644 --- a/metricbeat/module/couchbase/_meta/docs.asciidoc +++ b/metricbeat/module/couchbase/_meta/docs.asciidoc @@ -4,7 +4,7 @@ servers. The default metricsets are `bucket`, `cluster`, `node`. [float] === Compatibility -The Couchbase module is tested with Couchbase 4.5.1. +The Couchbase module is tested with Couchbase 6.5.1. [float] diff --git a/metricbeat/module/couchbase/bucket/_meta/fields.yml b/metricbeat/module/couchbase/bucket/_meta/fields.yml index 927d8275bec..12c5d6e8432 100644 --- a/metricbeat/module/couchbase/bucket/_meta/fields.yml +++ b/metricbeat/module/couchbase/bucket/_meta/fields.yml @@ -18,7 +18,7 @@ description: > Size of user data within buckets of the specified state that are resident in RAM. - name: disk.fetches - type: long + type: double description: > Number of disk fetches. - name: disk.used.bytes @@ -42,7 +42,7 @@ description: > Percentage of RAM used (for active objects) against the configured bucket size (%). - name: ops_per_sec - type: long + type: double description: > Number of operations per second. - name: item_count diff --git a/metricbeat/module/couchbase/bucket/data.go b/metricbeat/module/couchbase/bucket/data.go index 2aa6ab328c8..ec8f4757430 100644 --- a/metricbeat/module/couchbase/bucket/data.go +++ b/metricbeat/module/couchbase/bucket/data.go @@ -31,7 +31,7 @@ type BucketQuota struct { type BucketBasicStats struct { QuotaPercentUsed float64 `json:"quotaPercentUsed"` - OpsPerSec int64 `json:"opsPerSec"` + OpsPerSec float64 `json:"opsPerSec"` DiskFetches int64 `json:"diskFetches"` ItemCount int64 `json:"itemCount"` DiskUsed int64 `json:"diskUsed"` diff --git a/metricbeat/module/couchbase/cluster/_meta/fields.yml b/metricbeat/module/couchbase/cluster/_meta/fields.yml index 7ed3a9c87c8..e787d80a7ca 100644 --- a/metricbeat/module/couchbase/cluster/_meta/fields.yml +++ b/metricbeat/module/couchbase/cluster/_meta/fields.yml @@ -34,11 +34,11 @@ description: > Max bucket count setting. - name: quota.index_memory.mb - type: long + type: double description: > Memory quota setting for the Index service (Mbyte). - name: quota.memory.mb - type: long + type: double description: > Memory quota setting for the cluster (Mbyte). - name: ram.quota.total.value.bytes diff --git a/metricbeat/module/couchbase/cluster/data.go b/metricbeat/module/couchbase/cluster/data.go index 5195f6d708c..d106be8ff8f 100644 --- a/metricbeat/module/couchbase/cluster/data.go +++ b/metricbeat/module/couchbase/cluster/data.go @@ -48,8 +48,8 @@ type StorageTotals struct { type Data struct { StorageTotals StorageTotals `json:"storageTotals"` - IndexMemoryQuota int64 `json:"indexMemoryQuota"` - MemoryQuota int64 `json:"memoryQuota"` + IndexMemoryQuota float64 `json:"indexMemoryQuota"` + MemoryQuota float64 `json:"memoryQuota"` RebalanceStatus string `json:"rebalanceStatus"` RebalanceProgressURI string `json:"rebalanceProgressUri"` StopRebalanceURI string `json:"stopRebalanceUri"` diff --git a/metricbeat/module/couchbase/docker-compose.yml b/metricbeat/module/couchbase/docker-compose.yml index baeeac03eb6..e1ab57a562d 100644 --- a/metricbeat/module/couchbase/docker-compose.yml +++ b/metricbeat/module/couchbase/docker-compose.yml @@ -2,10 +2,10 @@ version: '2.3' services: couchbase: - image: docker.elastic.co/integrations-ci/beats-couchbase:${COUCHBASE_VERSION:-4.5.1}-1 + image: docker.elastic.co/integrations-ci/beats-couchbase:${COUCHBASE_VERSION:-6.5.1}-1 build: context: ./_meta args: - COUCHBASE_VERSION: ${COUCHBASE_VERSION:-4.5.1} + COUCHBASE_VERSION: ${COUCHBASE_VERSION:-6.5.1} ports: - 8091 diff --git a/metricbeat/module/couchbase/fields.go b/metricbeat/module/couchbase/fields.go index 8ddf5d937fd..e283a53e038 100644 --- a/metricbeat/module/couchbase/fields.go +++ b/metricbeat/module/couchbase/fields.go @@ -32,5 +32,5 @@ func init() { // AssetCouchbase returns asset data. // This is the base64 encoded gzipped contents of module/couchbase. func AssetCouchbase() string { - return "eJzMmVFv28YPwN/zKYgAfyAF/tXe/TCg6DB0DymKLnsaBpW+o61bJJ12pOK6n37gnWTLruXYiWpPD3mwFPLHI4/k8d7CI61nYHxrijky3QCIk5JmcPu+/+32BsASm+Aacb6ewc83A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hx8GLNSljUsysSXxDjtNl2SQP7O8TGBJ6EL2gyhHeSzYWRN5/kDBoi2gtVoo5BrOOas3ue7LblZZR2aa6lYLm6a8pVJGK0N0sw30qyGCFI0EaTjqbImCOHv7aKtNO7mJGDlsJKcdZjcj/3yA9urBq2dVl7HflvrJQ75acNygyjDJCJy+DN9XiA1m1e1i5nOXvp13LwNPdrHvcv4X6L7huST0c3yJQ46ZNLUt8aXJ7l5sc6w4VcRUIeklrruGPJks2S9DJxB2WM2x32O/sVJ/RlKC4GHJa3Wy1N6Yb+/EU2TcrrTz1233Epf+q9NXF50rfaHlPeiPUkBlDJ8BGOWi/XSw5w5ZbcCWK7hv7wbMr3PDoDX3KIrsgKM6OHrt7xQtV8XJXcpel3ZUpduPXLSkaVplH4mT9Mkil/Ga+gvu2840a1918xwLaftVszmR1MJGfJaP+QB2rznCcQ/jFxqY7HQYti1Ah7e14BcOPVvPmVrE3fMbhmgZYYgt0SnMztjy1pFYOI6HncNFutYKG0XbUeu9xzwZNO8SGBez+g/vQRoC4lLOmzp+PGJZxZVTmfruZySxQdc3aHrrKOkpJfj05U9oqQJWNTwUqhuD2A9OQt2cfCjTNB9BxwgM33FM2k8UIyZEvk3rpaMyTtZxGCN35/tvX572jBpKMpxpSYJVhaAwYfcXT7BFC9ahcTQwV1uTi1Plpgr64zrIggcO8Nq6aa9iOIwbqc01w7B3ciGbwy5mmRbs1fvMyQVygDQT8z3MmcHBAd+Qd3U//TsQNvpGXT8MjiInu2JgDftD7/mKX3MNH0/eljIaL3ancaPBBu9rrp4Fvb6JOQ+jy+nzwfGsv85Xunh9o3yMYrdYvpu7WHjoJUfuO08zuY8OQR2ADh3NSZiqdCqnaOhq5opFUTmBrIwq1rBNlTiUOF9HVHFwIjxYEgNcmyQ2VGZKYMwlOtTnyePJS/1JalHlVDjbvkL2um00+y8AAP//ab0SFw==" } diff --git a/metricbeat/module/couchbase/node/_meta/fields.yml b/metricbeat/module/couchbase/node/_meta/fields.yml index 360fcc25850..95f6613e4cc 100644 --- a/metricbeat/module/couchbase/node/_meta/fields.yml +++ b/metricbeat/module/couchbase/node/_meta/fields.yml @@ -5,7 +5,7 @@ release: ga fields: - name: cmd_get - type: long + type: double description: > Number of get commands - name: couch.docs.disk_size.bytes diff --git a/metricbeat/module/couchbase/node/data.go b/metricbeat/module/couchbase/node/data.go index b4a2d107e3f..e1f797ed1bb 100644 --- a/metricbeat/module/couchbase/node/data.go +++ b/metricbeat/module/couchbase/node/data.go @@ -35,20 +35,20 @@ type NodeSystemStats struct { } type NodeInterestingStats struct { - CmdGet int64 `json:"cmd_get"` - CouchDocsActualDiskSize int64 `json:"couch_docs_actual_disk_size"` - CouchDocsDataSize int64 `json:"couch_docs_data_size"` - CouchSpatialDataSize int64 `json:"couch_spatial_data_size"` - CouchSpatialDiskSize int64 `json:"couch_spatial_disk_size"` - CouchViewsActualDiskSize int64 `json:"couch_views_actual_disk_size"` - CouchViewsDataSize int64 `json:"couch_views_data_size"` - CurrItems int64 `json:"curr_items"` - CurrItemsTot int64 `json:"curr_items_tot"` - EpBgFetched int64 `json:"ep_bg_fetched"` - GetHits int64 `json:"get_hits"` - MemUsed int64 `json:"mem_used"` - Ops int64 `json:"ops"` - VbReplicaCurrItems int64 `json:"vb_replica_curr_items"` + CmdGet float64 `json:"cmd_get"` + CouchDocsActualDiskSize int64 `json:"couch_docs_actual_disk_size"` + CouchDocsDataSize int64 `json:"couch_docs_data_size"` + CouchSpatialDataSize int64 `json:"couch_spatial_data_size"` + CouchSpatialDiskSize int64 `json:"couch_spatial_disk_size"` + CouchViewsActualDiskSize int64 `json:"couch_views_actual_disk_size"` + CouchViewsDataSize int64 `json:"couch_views_data_size"` + CurrItems int64 `json:"curr_items"` + CurrItemsTot int64 `json:"curr_items_tot"` + EpBgFetched int64 `json:"ep_bg_fetched"` + GetHits int64 `json:"get_hits"` + MemUsed int64 `json:"mem_used"` + Ops int64 `json:"ops"` + VbReplicaCurrItems int64 `json:"vb_replica_curr_items"` } type Node struct { diff --git a/metricbeat/module/couchbase/test_couchbase.py b/metricbeat/module/couchbase/test_couchbase.py index 7b8ac868e7d..82ddad02427 100644 --- a/metricbeat/module/couchbase/test_couchbase.py +++ b/metricbeat/module/couchbase/test_couchbase.py @@ -27,3 +27,6 @@ def test_couchbase(self, metricset): couchbase metricsets tests """ self.check_metricset("couchbase", metricset, self.get_hosts(), self.FIELDS) + + def get_hosts(self): + return ["http://Administrator:password@" + self.compose_host()]