-
Notifications
You must be signed in to change notification settings - Fork 491
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
cmd/scollector: RabbitMQ #1202
cmd/scollector: RabbitMQ #1202
Conversation
@@ -238,6 +238,11 @@ or just one. | |||
[[HTTPUnit]] | |||
TOML = "/some/other.toml" | |||
|
|||
RabbitMQ (array of table, keys are URL): RabbitMQ hosts to poll. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps document that it will check localhost, even with no config given.
One of the problems I've encountered is |
That would be an acceptable use of an interface{} field. Most others look like they could be mapped into structs. Have you seen this tool: http://mholt.github.io/json-to-go/? |
Yeah, seen that, will do some research on how does RMQ output stats in different versions. |
@dimamedvedev Also the gojson as a local utility is quite nice https://github.com/ChimeraCoder/gojson , you just do |
10de452
to
c65c98d
Compare
|
Add(&md, p+"message_bytes_ready", q.MessageBytesReady, ts, metadata.Gauge, metadata.Bytes, DescRmqMessageBytesReady) | ||
Add(&md, p+"message_bytes_unack", q.MessageBytesUnacknowledged, ts, metadata.Gauge, metadata.Bytes, DescRmqMessageBytesUnacknowledged) | ||
Add(&md, p+"messages_queue_depth", q.Messages, ts, metadata.Gauge, metadata.Message, DescRmqMessages) | ||
Add(&md, p+"messages_persistent", q.MessagesPersistent, ts, metadata.Gauge, metadata.Message, DescRmqMessagesPersistent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could be tagged, not 100% sure.
1f6af72
to
91de289
Compare
return nil, err | ||
} | ||
var o rmqOverview | ||
if err := json.NewDecoder(bytes.NewReader(content[:])).Decode(&o); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't even need to read the body prior to this. Just use json.NewDecoder(res.Body)
@captncraig updated PR, will squash when ready |
metadata.Rate, metadata.Message, DescRmqBackingQueueStatusAvgAckIngressRate) | ||
Add(&md, p+"avg_rate", bqs.AvgAckEgressRate, ts.Copy().Merge(opentsdb.TagSet{"direction": "out"}), | ||
metadata.Rate, metadata.Message, DescRmqBackingQueueStatusAvgEgressRate) | ||
Add(&md, p+"avg_rate", bqs.AvgAckEgressRate, ts.Copy().Merge(opentsdb.TagSet{"direction": "in"}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are adding the same two data points twice, with different tagsets (once with direction and method, once with only direction). This scheme seems like it may cause confusing data conditions. Why Not have just the first two Adds and the last one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my bad, easy to get lost in so many metrics. Used wrong datapoints. Thank you for being thorough.
ab3f1f0
to
98bf1d1
Compare
98bf1d1
to
f74cdf1
Compare
Fairly comprehensive collector for RabbitMQ 3.x Probably needs careful review of metric/tags design.