+

Search Tips   |   Advanced Search

Create a Diagnostic Provider


Use Diagnostic Providers to query the startup configuration, current configuration, and current state of a diagnostic domain. Diagnostic Providers also provide access to any self diagnostic tests that are available from a diagnostic domain.

To complete this task have programming knowledge of the system and the proper authorities to perform the following steps.

The steps that follow outline a general process for creating Diagnostic Providers (DP).

 

  1. Determine the diagnostic domain. Look for configuration MBeans that control a similar domain in the same component. Extending an existing configuration MBean with a DP interface avoids proliferation of new MBeans and has the benefit that mapping from a diagnostic MBean to a configuration MBean requires no additional information.

  2. Determine what configuration attributes you want to expose.

    Include information used to configure the component from the configuration MBeans.

  3. Determine what state attributes you want to expose. Anything we might want to know about the state of the component for troubleshooting can go here.

  4. Determine what self diagnostic tests you will expose.

  5. Determine what test attributes you will return for each self diagnostic.
  6. Create the DP registration XML file.

  7. Create the DP implementation.

    1. To see an example, refer to Implement a Diagnostic Provider and keep in mind that most things that a Diagnostic Provider should do are already done for you in the DiagnosticProviderHelper class.

    2. To ensure that you do not collect unwanted data, add hooks in your component code where we need to collect state data using the DiagnosticConfig object.

    3. Add hooks in the component code where we need to store or be able to access configuration data.

  8. Add code to register the DP implementation. Typically, the best place to do this is where the component is initialized.

  9. Add Diagnostic Provider IDs (DPID) to the logged messages.

    Registering a DPID with a logger makes that information available in any messages logged with this logger. This enables fast paths in the DP utility to function on this particular Diagnostic Provider.

    1. Register the DPID with the loggers (for any of the loggers that you only want to associate a single DPID with).

    2. When you use multiple DPIDs with the same Logger, we can (instead of registering a single DPID with a Logger) add DPIDs to individual logging calls in the parm[0] position. Do not put {0} in the corresponding localized messages. It is bad practice to print the DPID in the messages as this would be inconsistent with messages from loggers with statically assigned DPIDs.


Diagnostic Provider Extensible Markup Language
Choose a Diagnostic Provider name
Implement a Diagnostic Provider
Create a Diagnostic Provider registration XML file