-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
log the Hystrix metrics to local file or DB #1298
Comments
You can do but you need to implement a custom metrics publisher. |
I did the code as following, is it OK? HystrixPlugins.getInstance().registerMetricsPublisher(HystrixServoMetricsPublisher.getInstance()); |
Internally at Netflix, we log metrics to Atlas for historical time-series analysis. As @mukteshkrmishra observed, we use a custom metrics publisher for that ( You should just create your own metrics publisher (extend from If you're interested in getting a review (or even submitting a PR), feel free to post it here - happy to review for you |
@mattrjacobs thank you, I use HystrixServoMetricsPublisher and a customer observer to get the metrics, Metric{config=MonitorConfig{name=propertyValue_corePoolSize, tags=com.netflix.hystrix.contrib.servopublisher.HystrixServoMetricsPublisherThreadPool$1@50f556a3,com.netflix.hystrix.contrib.servopublisher.HystrixServoMetricsPublisherThreadPool$2@5e32a2cd, policy=DefaultPublishingPolicy}, timestamp=1470187468329, value=10} |
You can refer servo java documents and dropwizard metrics api documents from git. Sent from my iPhone On Aug 2, 2016, at 9:38 PM, killjason <notifications@github.commailto:notifications@github.com> wrote: @mattrjacobshttps://github.com/mattrjacobs thank you, I use HystrixServoMetricsPublisher and a customer observer to get the metrics, Metric{config=MonitorConfig{name=propertyValue_corePoolSize, tags=com.netflix.hystrix.contrib.servopublisher.HystrixServoMetricsPublisherThreadPool$1@50f556a3,com.netflix.hystrix.contrib.servopublisher.HystrixServoMetricsPublisherThreadPool$2@5e32a2cd, policy=DefaultPublishingPolicy}, timestamp=1470187468329, value=10} You are receiving this because you were mentioned. |
@mattrjacobs : Do we have any code piece to show how we are pushing it to Atlas. PS: I have implemented a solution to push Hystrix Metrics to another time series and just wanted to see the Atlas implementation. |
@killjason Again, I should repeat that using That data type is a Servo data type (used to publish to Atlas). Since you're not publishing to Atlas, that's not the right type to engage with. By extending |
@mattrjacobs OK, I got it ,I will try it and give a feed back later, thank you. |
@mattrjacobs I created a new custom metrics publisher, and got the readable metrics,Thank you. |
@killjason :: can tou share the implementation you did?? |
@mukteshkrmishra ,sure, if there is anything wrong ,please tell me, thank you.
|
@killjason : Code looks good. Couple of suggestions: You can write own poller or observer as well (instead of using servo). But overall this is the perfect strategy to pull out metrics from Hystrix. |
@killjason :: One quick question, where are you registering your processMetrics() method, is it inside PostConstruct of init of a class or where? Reason I am asking is to know what practice you are following.. |
@killjason : Any updates on this. As the above code seems to be bugy. |
@mukteshkrmishra, processMetrics() is registering in Springboot main class. |
@killjason : got it. In a typical web app env, I would prefer it to register as under @PostConstruct method. Never mind, its a good use case. |
@mukteshkrmishra, thank you , glad to discuss with you. |
Yeah, this seems fine |
@silentAllay can you share complete code of PostConstruct please? Even your complete code to write metric on console is not compiling for me.I have all dependancies. |
@mausamgautam This is postContructor in main class (change processMetrics is public static method) |
Can I log the Hystrix metrics to local file/DB with custom programming? Because Hystrix dashboard only show realtime metrix, what if I want to look back the history metrix?
The text was updated successfully, but these errors were encountered: