Configuring the DyeInjection Monitor to Manage Diagnostic Contexts 12-9
instrumentation -- Other elements to configure this diagnostic monitor --
wldf-resource
With this configuration, the TraceElapsedTimeAction action will be triggered for the Servlet_Around_Service diagnostic monitor only for those requests that originate from
IP address 127.0.0.1 and user adminavitek.com.
The flags that are enabled in the diagnostic monitor must exactly match the bits set in the requests dye vector for an action to be triggered and an event to be written to the
Event Archive. For example, if the diagnostic monitor has both the USER1 and ADDR1 flags enabled, and only the USER1 flag is set in the requests dye vector, no action will
be triggered and no event will be generated.
12.5 How Dye Masks Filter Requests to Pass to Monitors
A dye vector attached to a request can contain multiple dyes, and a dye mask attached to a delegating monitor can contain multiple dyes. For a delegating monitors dye
mask to allow a monitor to take action on a request, all of the following must be true:
■
Dye filtering for the delegating or custom diagnostic monitor is enabled in the applications weblogic-diagnostics.xml descriptor, or is enabled via the
Administration Console.
■
The requests dye vector contains all of the dyes that are defined in the monitors dye mask. The dye vector can also contain dyes that are not in the dye mask.
12.5.1 Dye Filtering Example
Figure 12–3 illustrates how dye filtering works, using a diagnostic module with three
diagnostic monitors:
■
The DyeInjection monitor is configured as follows: ADDR1=127.0.0.1
USER1=weblogic
■
The Servlet_Around_Service monitor is configured with a dye mask containing only ADDR1.
■
The EJB_Around_SessionEjbBusinessMethods monitor is configured with a dye mask containing USER1 only.
Note: When configuring a diagnostic monitor, do not enable
multiple flags of the same type. For example, dont enable both the USER1 and USER2 flags, as the dye vector for a given request will
never have both the USER1 and USER2 flags set.
12-10 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server
Figure 12–3 Dye Filtering Example
1. A request initiated by user guest from IP address 127.0.0.1 enters the system. The
user guest does not match the value for USER1 in the DyeInjection monitor, so the request is not dyed with the dye vector USER1. The originating IP address
127.0.0.1 matches the value for ADDR1 defined in the DyeInjection monitor, so the request is dyed with the dye vector ADDR1.
2. The request dyed with ADDR1 enters the Servlet component, where the
diagnostic monitor Servlet_Around_Service is woven into the code. Servlet_ Around_Service triggers diagnostic actions at the entry of and exit of certain
servlet and JSP methods. Dye monitoring is enabled for the monitor, and the dye mask is defined with the single value ADDR1.
3. When the request enters or exits a method instrumented with Servlet_Around_
Service, the diagnostic monitor checks the request for dye vector ADDR1, which it finds. Therefore, the monitor triggers a diagnostic action, which generates a
diagnostic event, for example, writing data to the Events Archive.
4. The request enters the SessionEJB component, where the diagnostic monitor EJB_
Around_SessionEjbBusinessMethods is woven into the code. EJB_Around_ SessionEjbBusinessMethods triggers diagnostic actions at the entry and exit of all
SessionBean methods. Dye monitoring is enabled for the monitor, and the dye mask is defined with the single value USER1.
5. When the request enters or exits a SessionBean method instrumented with EJB_
Around_SessionEjbBusinessMethods, the diagnostic monitor checks the request for dye vector USER1, which it does not find. Therefore, the monitor does not
trigger a diagnostic action, and therefore does not generate a diagnostic event.
12.6 Using Throttling to Control the Volume of Instrumentation Events