com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Distributed Message Tracer

The Distributed Message Tracer solution allows you to trace the list of events that belong to a message and search through its results. A message is a single user activity that may invoke one or more services that independently generate events that are sent to WSO2 SP for processing. In addition, the activity itself generates an event that is considered the parent events.

e.g., When a transaction being processed passes through many subsystems, you can search through events collected from different subsystems to check whether the transaction is completed, the subsystem at which it is currently being processed etc. 

This solution allows you to set up the Message Tracers to match different scenarios.

 The Distributed Message Tracer solution is packed with WSO2 SP by default. To use this solution, follow the steps below:

To try out the Distributed Message Tracer, you can run the Message Tracer sample shipped with WSO2 Stream Processor. For detailed instructions to run a sample, see Samples.

Step 1: Set up the Message Tracer

This step involves configuring a Siddhi application in a way that allows the required details relating to activities can be captured and processed as required. To do this, let's define a business rule via the WSO2 SP Business Rules Manager as follows. For more information, see  Creating Business Rules . 

  1. In your terminal, navigate to the <SP_HOME>/bin directory. Then issue one of the following commands to start the dashboard server.
    • On Windowsdashboard.bat --run
    • On Linux/Mac OS: ./dashboard.sh
     
  2. Start a WSO2 SP worker runtime by issuing one of the following commands from the <SP_HOME>/bin directory.
    • On Windowsworker.bat --run
    • On Linux/Mac OS./worker.sh
  3. Access the Business Rules Manager via one of the following URLs.
  4. If you do not have any business rules that are already created, click Create. If there are existing rules, click to create a new rule.
     
  5. Click Template to create the business rule from the business template that is already available in the Distributed Message Tracer solution.
     
  6. Click on Message Tracer to create your business rule from the Message Tracer template group.

    This opens the Message Tracer page. 
  7. To configure the Siddhi application, select Message Tracer App Template in the Rule Template field.
      
    This opens the Message Tracer App Template business rules template. 
  8. Enter the required information in the fields of the Message Tracer App Template business rules template as follows.

    FieldDescription
    Business Rule NameA unique name for the business rule.
    Span Stream DefinitionThis defines the source and the stream configuration to capture the required information.
    Component NameThe module that generates the associated span. This can be constant or an attribute you included in the Span Stream Definition field.
    Trace IDThe name of the attribute in the Span Stream Definition that captures the ID of the trace. The trace refers to the complete tracing carried out for the activity flow. A message flow may span over multiple services. The trace ID is unique to each message flow.
    Span IDThe name of the attribute in the Span Stream Definition that captures the ID of the span. When the message flow spans over multiple services, the extent of the flow that relates to one of the services is identified as a single span with a unique ID.
    Baggage ItemsThe name of the attribute in the Span Stream Definition to capture baggage items. Baggage items are common payloads that move across the trace.
    Parent IDThe name of the attribute in the Span Stream Definition that captures the parent ID of the span. This is relevant when an invoked service in the message flow in turn invokes another service. In this scenario, the span of the first service is he parent of the span of the second service.
    Service NameThe name of the attribute in the Span Stream Definition to capture the name of the service that generates the event. The span ID displayed in the Message Tracer dashboard to visualize the trace is derived from the service name. Therefore, each service needs to have a unique name. You can enter an concatenation to generate a unique service name. e.g., The default value str:concat(correlation_activity_id, timestamp) generates the service name by combining the value for the start time attribute (i.e., timestamp) and the message ID (i.e., trace ID).
    Start TimeThe name of the attribute in the Span Stream Definition to capture the start time of the span in milliseconds.
    End TimeThe name of the attribute in the Span Stream Definition to capture the end time of the span in milliseconds.
    TagsThe name of the attribute in the Span Stream Definition to capture tags. A tag is a JSON payload specific to a span. You can use a concatenation via str:concat.
    Span ReferencesThe name of the attribute in the Span Stream Definition to capture span references.
    Parent Span is DefinedThis field specifies whether the Span Stream Definition needs to capture the ID of the parent span or not. Is this is set to false the parent ID is generated and assigned by the system.
    Parent Span Service NameThe name to be assigned to the parent span if the value for the Parent Span is Defined field is false. This can be a concatanation generated by Siddhi (e.g.,

    str:concat(\"parent\", \"_\", e1.startTime, \"-\", e2[last].endTime).

    Parent Operation NameThe operation name to be assigned to the parent span generated by Siddhi. This can be a concatanation (e.g., str:concat(\"parent\", \"_\", e1.startTime, \"-\", e2[last].endTime).
    Parent TagsThe tags specific to the parent span. This is required only if the value for the Parent Span is Defined field is false and the parent span is generated via Siddhi.
    Parent Baggage ItemsThe baggage items of the parent span. This is required only if the value for the Parent Span is Defined field is false and the parent span is generated via Siddhi.
    Parent Span ReferenceThe span reference of the parent span. This is required only if the value for the Parent Span is Defined field is false and the parent span is generated via Siddhi.
    Approximate Time for Complete TraceThis defines an approximate time duration to complete the trace. The spans that occured within this time duration are considered to determine the parent span. This is required only if the value for the Parent Span is Defined field is false.
    No of Events per TraceThe number of events generated in the trace. This is required to determine the parent span only if the value for the Parent Span is Defined field is false .
    Parent Span Service NameThe name assigned to the parent span if the value for the Parent Span is Defined field is false . This can be a constant value or a concatanation to derive it using the values entered for the Approximate Time for Complete Trace and No of Events per Trace fields (e.g., str:concat("parent", "_", e1.startTime, "-", e2[last].endTime)).
  9. Click SAVE & DEPLOY. The rule you create is added as shown in the example below.
  10. Click +and enter another business rule from the Message Tracer Source Template template with the following information.

    FieldDescription
    Business Rule NameA unique name for the business rule.
    Source TypeThe type of the source via which events relating to activities are received.
    Map TypeThe format in which events relating to activities are received.
    Source Options

    Here, you can enter optional properties to configure the source. The properties entered depends on the source type you selected. e.g., if the source type is kafka, you can enter topic.list='kafka_topic', partition.no.list='0', threading.option='single.thread.

  11. Click SAVE & DEPLOY.

Step 2: Trace messages in the dashboard

To trace activities via the Message Tracer dashboard, follow the procedure below:

  1. Access the Dashboard Portal via one of the following URLs.
    • http://<SP_HOST>:<HTTP_PORT>/portal (e.g., http://localhost:9290/portal)
    • https://<SP_HOST>:<HTTPS_PORT>/portal (e.g., https://localhost:9643/portal)
  2. Log in with your credentials. The Distributed Message Tracer dashboard is included in the dashboard listing as shown below.
  3. Click on the Distributed Message Tracer dashboard to open the dashboard. The widgets in the dashboard are displayed as follows.
  4. To filter the information you want to view in the dashboard, do the following:
    1. In the Service field, select the service for which you want to view message statistics.
    2. Click on the required date range in the Date Range widget to view message statistics for the required time period. If the time period for which you want to view statistics is not displayed in this widget, you can click Custom and select a specific time interval.

Once you enter information to filter message statistics to be displayed, click SEARCH. The available traces are displayed in the Tracing List section as shown in the example below.
 

Once you click on the required trace ID, information related to the trace is displayed as shown in the following example.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.