WebLogic Diagnostics Framework (WLDF) consists of a number of components that work together to collect, archive, and access diagnostic information about a WebLogic Server instance and the applications it hosts. It is a monitoring and diagnostic framework that defines and implements a set of services that run within WebLogic Server processes and participate in the standard server life cycle.
Before 11g this was delivered as an extension, but now integrated into the Console. Some WLDF features are configured as a part of configuration of server in a domain and others are configured as system resources (diagnostics modules) that can be targeted to server (or cluster).
The WLDF gather and analyse WebLogic runtime data through following:
- Diagnostics Image Capture -It creates a diagnostic snapshot from the server that can be used for post-failure analysis. A diagnostic zip file includes the server’s configuration, log cache, JVM state, work manager state, JNDI tree and most recent harvested data.
- Harvester-Captures metrics from run-time MBeans, including WebLogic Server MBeans and custom MBeans, which can be archived and later accessed for viewing historical data.
- Watches and Notifications– Provides the means for monitoring server and application states and sending notifications based on criteria set in the watches.
- Monitoring Dashboard – It is accessed from the WebLogic Server Administration Console and provides a set of tools for organizing and displaying diagnostic data into views, which surface some of the more critical run-time WebLogic Server performance metrics and the change in those metrics over time.
Let’s take an example to understand how we can use diagnostic image capture.
Problem faced: The server goes into a low thread count state and the thread dump capture is always triggered late / after, and always never capture thread dump useful for analysis.
1) Go to the WebLogic Console – Domain Structure – Diagnostic Modules
2) Create a new Module: Click on New, Add the module Name, description and click Ok. This creates a System Module
3) System Module needs to be targeted at one of the servers or cluster. Click on the Module Name (created in previous step), Go to “Target” tab and select the respective server/ cluster where this module needs to be targeted and Save.
4) Now go back to the Module screen. Click on Module name > Watches and Notification Tab > Notification.
Notification will be like an action that we want to occur when we detect a condition.
5) Create a New Notification.
Different Options are:
- SMTP (Email)
- JMS Message
- Diagnostic Image
- JMX Notification
- SNMP Trap
Select Diagnostic Image in this case.
Provide a new Name.
Tick the Enable Notification.
Enter Image Directory and Lockout Time (so that we don’t take too many screenshots) and click Finish.
6) Once a Notification is created, we need to create a “Watch”. A watch identifies a situation that you want to trap for monitoring or diagnostic purposes. You can configure watches to analyze log records, data events, and harvested metrics. A watch is specified as a watch rule, which includes:
- A watch rule expression
- An alarm setting
- One or more notification handlers
Click on Module > Watches and Notification > Watches > New.
Enter the Watch Name
- Collected Metrics
- Server Log
- Event Data
And Enable Watch
7) On the next screen , create a New Watch Rule Expression
Click Add Expression, Select the MBean Server Location ( Domain Runtime or Server Runtime).
Select the specific MBean Type or manually create one.
Select the Instance or create manually.
Select Message Attribute, Operator and Value
The Watch Rule will look something like this:
8) On the Alarms Tab, select one of the options to set the alarm
9) Assign notification to the created Watch
10) Go to Module > Collected Metrics. Enter the time period interval for which you want to collect the metrics
- Note : Values is in milliseconds
11) You can take a look at the server log files and check the Diagnostic Image Folder to see the effect of this.
12) You can also get a graphical interpretation of the same using the “Monitoring Dashboard” on the Home Screen