spring-projects / spring-statemachine

Spring Statemachine is a framework for application developers to use state machine concepts with Spring.
1.53k stars 599 forks source link

How to name Actions properly for Monitoring? #1023

Open hgnoyke opened 2 years ago

hgnoyke commented 2 years ago

Hi,

we want to use the monitoring via Influx, but have problems setting up a proper name for actions (transitions work fine). By default, the tags look like this: Bildschirmfoto 2022-03-03 um 09 36 32

One example tag value: "org.springframework.statemachine.action.Actions$Lambda$1563/0x0000000840da7040@10ef7672"

I tried to define a name in the action via toString() or @Component("foo"), but still got that dynamic name. Can somebody give a hint how to set a proper name? The name will be evaluated in org.springframework.statemachine.boot.support.BootStateMachineMonitor#actionToName, but I don't know how to give the Mono<Void>> action a proper name. Thanks in advance!

Actions are separate beans implementing the org.springframework.statemachine.action.Action interface and are setup as fields in org.springframework.statemachine.config.EnumStateMachineConfigurerAdapter via @Qualifier("actionName") private final Action<Enum1, Enum2> actionName;