Demo-ing Hystrix fault-tolerance features. Sets up Spring boot microservice that publishes metrics to Prometheus, as well as a Graphene container to view the metrics.
To get started, run bash start.sh
.
- Go to http://localhost:3000
- Log in with default username and password
admin
. - Click "Add your first data source" -> "Prometheus"
- Under "HTTP" -> "URL", input
<prometheus container ip>:9090
- Click "Save & Test" at the bottom
- To start exploring metrics, click "Explore" on the sidebar on the left
- Test circuit-breaker functionality against a rate-limited service: http://localhost:8080/throttling
- Test timeout functionality against a slow service: http://localhost:8080/slow
- Test against a faulty (50% failing) service: http://localhost:8080/faulty
There is also a separate non-Hystrix endpoint (http://localhost:8080/non-hystrix) to demonstrate logging metrics using
@Timed
and @Counted
. This is separate because it doesn't seem possible to use these annotations simultaneously
with the @HystrixCommand
annotation.
Metrics generated by @Timed
should show up as NonHystrixService:GetResult:Count_total
while metrics
generated by @Counted
should show up as NonHystrixService:GetResult:Time_*
.
Query to graph error rate:
sum(rate(NonHystrixService:GetResult:Count_total{result="success"}[$__interval])) / sum(rate(NonHystrixService:GetResult:Count_total{}[$__interval]))