-
Notifications
You must be signed in to change notification settings - Fork 815
Added spring-boot client #114
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
Conversation
I'm not too familiar with Spring, however this appears to be a mix of a wrapper, bridge, collector and exporter. Each of those should probably be separate. |
Okay, I'll split into modules. |
I removed some over eringeering modules. |
/** | ||
* Returns the number of collectors in this registry. | ||
*/ | ||
public 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.
Why do you 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.
Oops. Old implementation required this. But it was removed.
I rewrote all of the code. Could you re-review this? |
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<spring.boot.version>1.3.3.RELEASE</spring.boot.version> |
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 put this in literally. Some build tools have problems with variables.
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.
Inlined a variable.
That looks generally good, just some nits left. |
That's looking good. Could you add a docstring demonstrating how to use it, and squash your commits? |
Thanks. I added docstring. And squashed commits. |
Thanks! |
Hi @tokuhirom , Would you please provide an example about how to use SpringBootMetricsCollector?
Thank you! |
@ haocheng Here is a complete example:
|
Hi @tokuhirom , Thank you for the great work! It works like a charm ;) BTW, I cannot find SpringBootMetricWriter, but using SpringBootMetricsCollector instead works fine.
|
@haocheng, where do you get the |
@240ch um... I am still using Spring boot 1.3.3. Do you have |
Is there a guide for how to use this? Trying to use spring boot's metrics as an exporter for prometheus. Thanks! |
@johnmgibbons try @haocheng 's code above and be sure to add following dependencies:
|
Hi @tokuhirom ,
Which makes Prometheus unhappy:
Is this my misconfiguration, or is this a bug? EDIT: this.publicMetrics = {LinkedHashMap$LinkedValues@7351} size = 4 There you can see that for requests they actually use the same name but different id and/or status. I think just changing the logic in SpringBootMetricsCollector to generate a name of the Metric to account for that should be enough. Shall I open a bug report? EDIT: |
hey, you just need add @EnableSpringBootMetricsCollector, DONE. |
I want to use spring-boot's metrics/health checking feature as a prometheus exporter.
ref.