Daniel Keir Haywood created CAUSEWAY-4065:
---------------------------------------------

             Summary: Provide an applib API to allow business logic to define 
their own spans
                 Key: CAUSEWAY-4065
                 URL: https://issues.apache.org/jira/browse/CAUSEWAY-4065
             Project: Causeway
          Issue Type: New Feature
          Components: Applib (programming model), Core
    Affects Versions: 4.0.0-M2, v2 maintenance-branch
            Reporter: Daniel Keir Haywood
            Assignee: Daniel Keir Haywood
             Fix For: 4.0.0, v2 maintenance-branch


      @Inject
       CausewayObservationIntegration observations;

       public void run() {
           observations.createNotStarted(
                       getClass(),
                       "myapp.long-running-action.load")
                   .contextualName("load input data")
                   .lowCardinalityKeyValue("myapp.phase", "load")
                   .observe(this::loadData);

           observations.createNotStarted(
                       getClass(),
                       "myapp.long-running-action.process")
                   .contextualName("process records")
                   .lowCardinalityKeyValue("myapp.phase", "process")
                   .observe(this::processRecords);
       }

but observations is not in the applib, and we could also use 
interactionService.currentInteraction() to provide most of the context (which 
action is being invoked), with some sort of suffix.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to