These are chat archives for spring-cloud/spring-cloud

3rd
Apr 2015
Chris Phillipson
@fastnsilver
Apr 03 2015 13:41
hi all, i started a thread in spring-boot room but it’s more appropriate here. we have a requirement to gather metrics and publish to both graphite and cloudwatch. looked into netflix servo. after trying https://gist.github.com/fastnsilver/15f4fee29bf324d6d7d0 saw that there was ServoMetricsAutoConfiguration then tried https://gist.github.com/fastnsilver/ed6948e0f2e464b52d5f. just wondering how anyone else has proceeded with trying to integrate MetricObserver implementations.
Dave Syer
@dsyer
Apr 03 2015 14:38
Why do you need servo?
It might be better to use the native Spring Boot metrics
Chris Phillipson
@fastnsilver
Apr 03 2015 15:08
Then why does org.springframework.cloud.netflix.servo.ServoMetricCollector exist? Isn’t this meant to expose metrics to the Spring Boot Actuator/metrics endpoint? I was trying to model a solution after this. What is an alternative?
Dave Syer
@dsyer
Apr 03 2015 15:08
Yes, it exposes Servo metrics to the Boot services.
The assumption being that the Servo metrics come from Netflix components that you don't control
If you are writing your own metrics in a Spring Boot application then its own facilities can be used directly (no need to bridge to Servo). Or maybe I'm misunderstanding your use case or needs.
Chris Phillipson
@fastnsilver
Apr 03 2015 15:29
I want to surface metrics to CloudWatch and I want to have them available for Graphite. Servo seemed like a good option since you implement observers and can collect them to report. The poller setup and delegation to metricregistry in a collector seemed sound. I’m aware of being able to publish other app metrics, here: http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html#production-ready-recording-metrics. But what I don’t know how to do in an alternative way is to integrate CloudWatch and/or statsd to Graphite. Looking for some guidance.
Spencer Gibb
@spencergibb
Apr 03 2015 15:32
@fastnsilver you want to publish boot metrics to CloudWatch right?
Chris Phillipson
@fastnsilver
Apr 03 2015 15:33
yup
i think i figured that out in the gists i linked earlier, but if there’s another way…
Spencer Gibb
@spencergibb
Apr 03 2015 15:35
servo defenitly isn’t required, as dave said, it just brings in netflix metrics to boot.
Chris Phillipson
@fastnsilver
Apr 03 2015 15:39
ok, then until spring-cloud/spring-cloud-aws#7 is resolved, what is an alternative?
Chris Phillipson
@fastnsilver
Apr 03 2015 15:45
com.netflix.servo.publish.cloudwatch.CloudWatchMetricObserver does all the dirty work of integrating with CloudWatch API.
Spencer Gibb
@spencergibb
Apr 03 2015 15:46
I think the trouble there is that will only publish servo metrics, not the rest of the boot metrics
pull requests are always welcome for spring-cloud/spring-cloud-aws#7
Dave Syer
@dsyer
Apr 03 2015 15:49
It's pretty trivial to write an Exporter for Boot metrics. I don't know the AWS APIs but there must be a library?
Chris Phillipson
@fastnsilver
Apr 03 2015 15:51
understood, so just a hint on direction… would I just extend AbstractMetricExporter?
Dave Syer
@dsyer
Apr 03 2015 15:51
That's a general purpose base class. Probably works for most things.
I use the redis one a lot
You just need to declare a @Bean with an @Scheduled method to run the exporter
Chris Phillipson
@fastnsilver
Apr 03 2015 15:52
ok, i’ll pull something together, then put another gist up for review
Chris Phillipson
@fastnsilver
Apr 03 2015 16:03
So if I meant to adapt your referenced config @dyser… I would implement a MetricWriter and it would be responsible for writing metrics to CloudWatch (using AWS SDK JAva API)? The MetricCopyExporter is pretty sweet.
Dave Syer
@dsyer
Apr 03 2015 16:07
Yes.
Chris Phillipson
@fastnsilver
Apr 03 2015 16:07
thanks! this is what i needed. you guys rock!