Dashboards & Visualizations

Monitoring Circuit Breaker Status?

Stephcg
Explorer

Hello!
I'm implementing a custom circuit breaker in my application spring gateway application, which returns the following event/log:

1/20/23
1:20:28.487 PM
 
[app=teste-gateway, traceId=traceid, spanId=spanId, INFO CircuitBreakerCustomConfig : Circuit breaker circuitBreakerName=/test-circuit-breaker-gateway-route onStateTransition=State transition from CLOSED to OPEN fromState=CLOSED toState=OPEN stateName=CLOSED_TO_OPEN
  • host =  host-ip
  • source = http:source-test
  • sourcetype = sourcetype_teste-gateway


There are about 120 hosts of this application.
If a request to a route starts receiving many errors it will open the circuit, and it will receive the above event, and eventually until the route stabilizes it will change to HALF-OPEN and CLOSED. Each route is represented by the circuitBreakerName field.
So, for example, in an instance/host, the route: /test-circuit-breaker-gateway-route will not have the above event/log until it opens the circuit due to many errors. Then it will receive the log just like the above with stateName=CLOSED_TO_OPEN. Eventually, it will change to stateName=OPEN_TO_HALF-OPEN, and then it can go to stateName=HALF-OPEN_TO_OPEN (if the errors continue) or stateName=HALF-OPEN_TO_CLOSED (if errors stop).
And according with how the requests are being balanced between hosts, I can have hosts where the circuit is currently HALF_OPEN, whereas at the same moment, others hosts have the circuit OPEN for the same route.
I would like to keep track of the routes with an OPEN circuit as it last status (most recent).
It could be something like a Line Chart, that Y-axis is the number of hosts with currently OPEN circuit, and X-axis is time.
So, I imagine that I'll have to check the last status of the above log for every host and search for OPEN. But I'm not really sure how to do this.

Is it possible? How can I do this?

Thank you for any help in advance. And sorry if I wrote anything wrong, english is not my main language.

 

Labels (5)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @Stephcg,

Can you please try below?

index=gateway source=http:source-test sourcetype=sourcetype_teste-gateway toState=OPEN 
| timechart dc(host) as count by circuitBreakerName
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

Stephcg
Explorer

It almost works, but as the log of the changing of the circuit breaker only comes once, the second it OPENS it is registered, but it soon drops, even though the circuit breaker stills is OPEN and still didn't receive the log of HALF-OPEN.

Stephcg_0-1674333358986.png

But thank you for trying to help, I'll try a little more, or maybe, I'll just show on a table the one's who are currently open. But if I find anything, I'll report here.

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...