Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated the intro

Message Tracing is an identification of refers to the process of identifying each message flow in each transaction which goes of each of the transactions that go through the gateway. Gateway. You can do message tracing on WSO2 API Manager provides the facility to do message tracing by by installing the Message Tracer feature that has been specifically developed for WSO2 Products. It is used to products. You can use the Message Tracer to derive logging, auditing, and debugging related information with regard to message content and it’s direction.

Message Tracer is a part of carbon-analytics and this feature is built into WSO2 API Manager.

...

Follow the below steps to configure Message Tracer in API Manager.

  1. Log into Managemet Management Console (https://localhost:9443/carbon).
  2. Navigate to Configure > Message Tracing in Configure Tab to open the Message Tracing Configuration.
  3. Select Enable Message Tracing and click Update to enable Message Tracking.
  4. Select following options as well if you wish to get the message tracing in detail.

...

  1. Select Enable Analytics Event Publishing in Message Tracer Configuration and click update.

    Once you have saved the changes, APIM will generate stream definition in <APIIM_HOM>/repository/deployment/server/eventstreams/DAS_MESSAGE_TRACE_1.0.0.json.

  2. Copy the DAS_MESSAGE_TRACE_1.0.0.json file to <APIM_ANALITICS_HOME>/repository/deployment/server/eventstreams directory to deploy the same definition in API Manager Analytics.

  3. Login to API Manager Analytics (https://localhost:9444/carbon) and navigate to Main > Event > Streams.

    You will be able to see the deployed stream under event streams. Now we need to persist the event stream to save data into a table.

  4. Click Edit in the stream definition DAS_MESSAGE_TRACE:1.0.0 and open the edit view.
  5. Click Next[Persist Event] at the bottom of the edit view.
  6. In the next page select Persist Event Stream and select all attribute checkboxes to perist and click on Save Event Stream button.

    You should configure an Event receiver to point thid Event to the Event stream.
  7. Go to Main -> Event -> Receivers in API Manager Analytics and and click on Add Event Receiver.
  8. Add following details and click on Add Event Receiver.

    propertyValue
    Event Receiver Namemessage_trace_receiver
    Input Event Adoptor Adapter Typewso2event
    Is events duplicated in clusterfalse
    Event StreamDAS_MESSAGE_TRACE:1.0.0
    Message formatwso2event

    Next, a publisher need to be configured in order to publish events to API Manager Analytics. To do that,

  9. Go to Main > Event > Publishers in API Manager Analytics and click Add Event Publisher.

  10. In Create a New Event Publisher page, add the following details and click Add Event Publisher.

    PropertyValue
    Event Publisher Namemessage_tracer_publisher
    Event SourceDAS_MESSAGE_TRACE:1.0.0
    Stream Attributes
    Note

    Keep default values

    Output Event Adaptor Adapter Typewso2event
    Receiver URLtcp://localhost:7612
    User Nameadmin
    Passwordadmin
    Protocolthrift
    Publishing modenon-blocking
    Message Formatwso2event


...

After enabling Message tracing, Dump Message Contnet Content, and Logging, you can see the log Message similar to this from API Console for events like API invocation etc.

...