-
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
Adding dropwizard module #4022
Adding dropwizard module #4022
Conversation
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
1 similar comment
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
// Part of new is also setting up the configuration by processing additional | ||
// configuration entries if needed. | ||
func New(base mb.BaseMetricSet) (mb.MetricSet, error) { | ||
logp.Warn("BETA: The dropwizard collector metricset is beta") |
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.
We have logp.Beta
for this
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.
done
LGTM apart from a minor comment, please also add a changelog |
d2b21d7
to
0ed0527
Compare
0ed0527
to
af0eca7
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.
In general LGTM. Left a few minor comments. For the dropwizard integration tests docker image: For me this is not only for automated testing but also having an easy way in case things don't work, for us to manually test with an actual dropwizard app to reproduce potential problems.
[[metricbeat-module-dropwizard]] | ||
== dropwizard Module | ||
|
||
This is the dropwizard Module. |
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.
Could you add a link to dropwizard here?
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.
done.
"net/http" | ||
) | ||
|
||
var response = `{"version":"4.0.0","gauges":{"my_gauge{this=that}":{"value":565}},"counters":{"my_counter":{"count":565},"my_counter2{this=that}":{"count":565}},"histograms":{"my_hist":{"count":565,"max":564,"mean":563.3148706761577,"min":0,"p50":564.0,"p75":564.0,"p95":564.0,"p98":564.0,"p99":564.0,"p999":564.0,"stddev":1.0747916190718627}},"meters":{"my_meter":{"count":0,"m1_rate":0.0,"m5_rate":0.0,"m15_rate":0.0,"mean_rate":0.0,"units":"events/second"}},"timers":{"my_timer{this=that}":{"count":0,"max":0.0,"mean":0.0,"min":0.0,"p50":0.0,"p75":0.0,"p95":0.0,"p98":0.0,"p99":0.0,"p999":0.0,"stddev":0.0,"m1_rate":0.0,"m5_rate":0.0,"m15_rate":0.0,"mean_rate":0.0,"duration_units":"seconds","rate_units":"calls/second"}}}` |
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.
For testing the JSON output we don't need the integration tests. We could also do this with eventMapping and just load the content.
I would like to have a docker environment with a real dropwizard app inside (if possible). So in case things break, we have an instance around to test and don't have to build one ourself.
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.
added a proper dropwizard http endpoint as part of the integration run.
"version": "6.0.0-alpha1" | ||
}, | ||
"dropwizard": { | ||
"test": { |
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.
As it is a "dynamic" metricset I'm a bit undecided what we should do here. In other dynamic metricsets we leave it empty here (https://github.com/elastic/beats/blob/master/metricbeat/module/windows/perfmon/_meta/data.json) but provide an example output in the docs.
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.
removed the custom metrics
dw := map[string]interface{}{} | ||
|
||
d := json.NewDecoder(strings.NewReader(string(body))) | ||
d.UseNumber() |
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.
Interesting. Is there something special about the floats returned so we need this?
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.
yes. if not everything gets written out as double values.
http://stackoverflow.com/questions/22343083/json-marshaling-with-long-numbers-in-golang-gives-floating-point-number
203b080
to
87ca8cb
Compare
metricbeat/.gitignore
Outdated
@@ -7,3 +7,4 @@ _meta/beat.full.yml | |||
/metricbeat.test | |||
/docs/html_docs | |||
|
|||
target/ |
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 coming from java?
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.
Yes. Just as a precaution in case someone tries to build the src locally.
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.
Yes. Just as a precaution in case someone tries to build the src locally.
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.
Wouldn't that directory be inside the test folder?
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.
Yes. As long as there is no other directory named target we shouldn't have any issues.
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.
In this case I would suggest to create a .gitignore file inside the dropwizard module.
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.
done.
87ca8cb
to
e25c068
Compare
e25c068
to
85ba381
Compare
jenkins, test it |
@vjsamuel Thanks a lot for the contribution. |
Adding metricbeat module that can query HTTP servlets that expose dropwizard metrics.
cc: @Randgalt