package Ġcom . github . j nt ak pe . commons . tracing Ċ Ċ import Ġbr ave . Tracing Ċ import Ġio . mic ronaut . context . annotation . Requires Ċ import Ġio . mic ronaut . context . event . Application EventListener Ċ import Ġio . mic ronaut . context . event . Bean Created Event Ċ import Ġio . mic ronaut . context . event . Bean Created EventListener Ċ import Ġio . mic ronaut . context . event . Shutdown Event Ċ import Ġreactor . core . publisher . Hooks Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ @ Requires ( beans Ġ= Ġ[ Reactor Tracing Properties :: class ]) Ċ class ĠRe actor Tracing Hook Registration ( private Ġval Ġproperties : ĠRe actor Tracing Properties ) Ġ: ĠBean Created EventListener < Tracing >, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠApplication EventListener < Shutdown Event > Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġconst Ġval ĠRE ACT OR _ TR ACING _ HOOK _ NAME Ġ= Ġ" reactor - tracing - hook " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Created ( event : ĠBean Created Event < Tracing >): ĠTr acing Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġevent . bean . apply Ġ{ Ġregister Hooks ( this ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Application Event ( event : ĠShutdown Event ) Ġ{ ĊĠĠĠĠĠĠĠ ĠHooks . reset On Last Operator ( RE ACT OR _ TR ACING _ HOOK _ NAME ) ĊĠĠĠĠĠĠĠ ĠHooks . reset On Each Operator ( RE ACT OR _ TR ACING _ HOOK _ NAME ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġregister Hooks ( tracing : ĠTr acing ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( properties . decorate On Each ) ĠHooks . on Each Operator ( RE ACT OR _ TR ACING _ HOOK _ NAME , ĠRe actor Tracing . scope Pass ing Span Operator ( tracing )) ĊĠĠĠĠĠĠĠ Ġelse ĠHooks . on Last Operator ( RE ACT OR _ TR ACING _ HOOK _ NAME , ĠRe actor Tracing . scope Pass ing Span Operator ( tracing )) ĊĠĠĠ Ġ} Ċ } Ċ