You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect that adding a second command with a different group key, but identical command key: HystrixCommandGroupKey = FireBrigade HystrixCommandKey = CreateEmergency
The code above gets executed onHystrixMetricsPublisherFactory SINGLETONwhen a command is created (in AbstractCommand's constructor) which means that if there are two commands with the same name, only the first command to be executed gets its HystrixMetricsPublisherCommand added to the map. Hence only metrics about the first executed command will be reported.
This behavior is confusing, I would expect both the HystrixCommandGroupKey and HystrixCommandKey to be considered as uniquely defining a command. Is using only the HystrixCommandKey by design?
Cheers
The text was updated successfully, but these errors were encountered:
Using Hystrix 1.5.13, suppose you have a command with following parameters:
HystrixCommandGroupKey
= PoliceHystrixCommandKey
= CreateEmergencyWhen it gets executed, the following metrics will be reported
I would expect that adding a second command with a different group key, but identical command key:
HystrixCommandGroupKey
= FireBrigadeHystrixCommandKey
= CreateEmergencywill result in having additional metrics:
But it is not the case. What happens is that metrics of the later executed method are not published.
Turns out that because of this part command keys must be unique to be correctly published.
The code above gets executed on
HystrixMetricsPublisherFactory SINGLETON
when a command is created (inAbstractCommand
's constructor) which means that if there are two commands with the same name, only the first command to be executed gets itsHystrixMetricsPublisherCommand
added to the map. Hence only metrics about the first executed command will be reported.This behavior is confusing, I would expect both the
HystrixCommandGroupKey
andHystrixCommandKey
to be considered as uniquely defining a command. Is using only theHystrixCommandKey
by design?Cheers
The text was updated successfully, but these errors were encountered: