-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix MongoDB dbstats fields mapping #4025
Conversation
537d484
to
42fe544
Compare
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.
The dbstats metricset is still experimental. We should change the fields in the mapping and not the documentation. Means we should add .bytes
etc. as it is according to our convention. This is a BC break but with experimental metricsets that is fine in my opinion.
42fe544
to
a83d718
Compare
a83d718
to
7891e8f
Compare
"db": c.Str("db"), | ||
"collections": c.Int("collections"), | ||
"objects": c.Int("objects"), | ||
"avg_obj_size.bytes": c.Int("avgObjSize"), |
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.
This will make it incompatible with elasticsearch 2.x. You must use s.Object{ ... }
to add the nesting.
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.
Ah, didn't know that one, thanks!
7891e8f
to
73b3fc4
Compare
@exekias Some tests are failing. Can you please have a look? |
"num": c.Int("num"), | ||
"size": c.Int("size"), | ||
"num": c.Int("num"), | ||
"size.bytes": c.Int("size"), |
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.
Still one with .bytes
@@ -30,13 +30,13 @@ func TestFetch(t *testing.T) { | |||
objects := event["objects"].(int64) | |||
assert.True(t, objects > 0) | |||
|
|||
avgObjSize := event["avg_obj_size"].(int64) | |||
avgObjSize := event["avg_obj_size.bytes"].(int64) |
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.
I assume that is not going to work, as it is a nested object.
@@ -12,15 +12,15 @@ | |||
}, | |||
"mongodb": { | |||
"dbstats": { | |||
"avg_obj_size": 59, | |||
"avg_obj_size.bytes": 59, |
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 should update this one with make generation-json
.
73b3fc4
to
6b0b077
Compare
@ruflin How do I make changes to my existing metric beat installation, please advise. |
@ashwinboinala There are two options. Either you adjust the mapping manually and overwrite the one you have or you switch to the nightly build found here and let metricbeat overwrite your template: https://beats-nightlies.s3.amazonaws.com/index.html?prefix=metricbeat/ @exekias Should we backport this to 5.x? |
@ruflin uhm probably yes, let me open a PR |
@ruflin thanks for your response.
-Ashwin |
@ashwinboinala This is not expected. It sounds like something does not work well with the host parser. Could you open a new Github issue for it? |
Fix mongodb dbstats mapping to avoid errors like this:
closes #3989