Skip to content

Couchbase module throws json parse exception on basicStats.opsPerSec #18949

@amrishraje

Description

@amrishraje

Please refer to below post:
https://discuss.elastic.co/t/couchbase-module-throws-json-parse-exception-on-basicstats-opspersec/235455

Issue: Metricbeat Couchbase module throws the below error
Error: %!(EXTRA *json.UnmarshalTypeError=json: cannot unmarshal number 790.2097902097902 into Go struct field BucketBasicStats.opsPerSec of type int64)

Issue is in the data.go file. The code makes an assumption that couchbase API pools/default/buckets returns an int where as it actually returns a float. I have checked this with version 5.x and 6.x of couchbase.

I see this issue with metricbeat version 6.8.3 (amd64), libbeat 6.8.3 running on RHEL 7.7

Error Details:

2020-06-02T22:19:20.396-0500    DEBUG   [cfgfile]       cfgfile/reload.go:195   Number of module configs found: 1
2020-06-02T22:19:20.396-0500    DEBUG   [reload]        cfgfile/list.go:62      Starting reload procedure, current runners: 0
2020-06-02T22:19:20.396-0500    DEBUG   [reload]        cfgfile/list.go:80      Start list: 1, Stop list: 0
2020-06-02T22:19:20.396-0500    DEBUG   [processors]    processors/processor.go:66      Processors:
2020-06-02T22:19:20.396-0500    DEBUG   [reload]        cfgfile/list.go:101     Starting runner: couchbase [metricsets=1]
2020-06-02T22:19:20.396-0500    DEBUG   [module]        module/wrapper.go:117   Starting Wrapper[name=couchbase, len(metricSetWrappers)=1]
2020-06-02T22:19:20.396-0500    INFO    cfgfile/reload.go:205   Loading of config files completed.
2020-06-02T22:19:20.396-0500    DEBUG   [module]        module/wrapper.go:179   Starting metricSetWrapper[module=couchbase, name=bucket, host=localhost:8091]
2020-06-02T22:19:20.425-0500    ERROR   bucket/data.go:53       Error: %!(EXTRA *json.UnmarshalTypeError=json: cannot unmarshal number 790.2097902097902 into Go struct field BucketBasicStats.opsPerSec of type int64)
2020-06-02T22:19:20.425-0500    DEBUG   [publish]       pipeline/processor.go:309       Publish event: {
  "@timestamp": "2020-06-03T03:19:20.396Z",
  "@metadata": {
    "beat": "metricbeat",

Metadata

Metadata

Assignees

Labels

Team:Services(Deprecated) Label for the former Integrations-Services teambug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions