Configuring Delegating Monitors to Use Dye Filtering

Configuring the DyeInjection Monitor to Manage Diagnostic Contexts 12-7 If the DyeInjection monitor is disabled, no diagnostic contexts will be created for any incoming requests.

12.4 Configuring Delegating Monitors to Use Dye Filtering

You can use the DyeInjection monitor as a mechanism to restrict when a delegating or custom diagnostic monitor in the diagnostic module is triggered. This process is called dye filtering. Each monitor can have a dye mask, which specifies a selection of the dyes from the DyeInjection monitor. When dye filtering is enabled for a diagnostic monitor, the monitors diagnostic action is triggered and a diagnostic event is generated only for those requests that meet the criteria set by the mask. Figure 12–2 shows an example of diagnostic events that were generated when a configured diagnostic action was triggered. Notice that the Context ID is the same for all of the events, indicating that they are related to the same request. You can use this Context ID to query for log records that are associated with the request. Note that the user ID associated with a request may not always be the same as the USER value you configured in the DyeInjection monitor; as a request is processed through the system, the user associated with the request may change to allow the system to perform certain functions for example, the User ID may change to kernel. Figure 12–2 Example of Diagnostic Events Associated with a Request Example configuration Consider a Servlet_Around_Service application-scoped diagnostic monitor that has a TraceElapsedTimeAction action attached to it. Without dye filtering, any request that is handled by Servlet_Around_Service will trigger a TraceElapsedTimeAction. You Note: For information on how to implement a diagnostic monitor for an application such as a web application, see Section 11.5.2, Overview of the Steps Required to Instrument an Application. 12-8 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server could, however, use dye filtering to trigger TraceElapsedTimeAction only for requests that originated from user adminavitek.com at IP address 127.0.0.1. 1. Configure the DyeInjection monitor so that USER1=adminavitek.com and ADDR1=127.0.0.1, and enable the DyeInjection monitor. For instructions, see Configure diagnostic monitors in a diagnostic system module in the Oracle WebLogic Server Administration Console Help. 2. Configure a dye mask and enable dye filtering for the Servlet_Before_Service diagnostic monitor. In the Administration Console: a. Add the Servlet_Around_Service monitor from the WLDF instrumentation library to your application as described in Configure instrumentation for applications in the Oracle WebLogic Server Administration Console Help.

b. After adding the monitor, click Save on the Settings for application_name