Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Endpoint for Bucket Metrics In Couchbase #9701

Closed
bentonam opened this issue Aug 31, 2021 · 2 comments · Fixed by #9717
Closed

Incorrect Endpoint for Bucket Metrics In Couchbase #9701

bentonam opened this issue Aug 31, 2021 · 2 comments · Fixed by #9717
Labels
area/couchbase waiting for response waiting for response from contributor

Comments

@bentonam
Copy link

This is using the Cluster wide aggregate endpoint for gathering bucket metrics. If metrics are reported per host, each host reports the bucket metrics, resulting in the values being multiplied.

req, err := http.NewRequest("GET", server+"/pools/default/buckets/"+bucket+"/stats?", nil)

The current endpoint being used is http://localhost:8091/pools/default/buckets/{BUCKET}/stats which is the sum of all metrics across the cluster. To get per node metrics the node specific endpoint must be used.

This is easy enough to very by looking at the vb_active_num stat, as a bucket in Couchbase has 1024 vBuckets regardless of however many nodes are in the cluster, the vBuckets are distributed amongst all of the data nodes in the cluster. When using the cluster wide endpoint this value will always be 1024, but in a 3 node configuration for example 2 nodes would report a vb_active_num of 341 and 1 node would report 342 .

Per Node Endpoint: http://localhost:8091/pools/default/buckets/{BUCKET}/nodes/{HOSTNAME}:8091/stats

Note that the {HOSTNAME} must match what is configured in Couchbase Server. Even when using localhost you can still determine the node name as configured in Couchbase. The /pools/default endpoint that is being referenced and iterated over here:

for i := 0; i < len(pool.Nodes); i++ {

Needs to look for an attribute called "thisNode": true that is only defined on the current node returning the response, otherwise it is not present. that is the hostname you would use. for example

http://localhost:8091/pools/default/buckets/{BUCKET}/nodes/node1.example.org:8091/stats

The REST Endpoint Monitoring Guide may be useful https://developer.couchbase.com/seo-monitoring-guide

@reimda
Copy link
Contributor

reimda commented Apr 21, 2022

Hi @bentonam, are you still interested in a fix for this issue? Does it look like #9717 is going to fix it for you? thanks!

@reimda reimda added the waiting for response waiting for response from contributor label Apr 21, 2022
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented May 6, 2022

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!

@telegraf-tiger telegraf-tiger bot closed this as completed May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/couchbase waiting for response waiting for response from contributor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants