Troubleshooting With Traces
EXPERIMENTAL
This feature is experimental.
It means that it is not intended for production use.
The feature is not finished.
It is not stable.
The implementation may contain bugs, the configuration may change at any moment without any warning and it may not work at all.
Use at your own risk.
This feature is not covered by midPoint support.
In case that you are interested in supporting development of this feature, please consider purchasing midPoint Platform subscription.
|
TL;DR
|
Overview
Tracing is an unofficial and highly experimental feature of midPoint troubleshooting. The principle is very simple: any operation in midPoint can be recorded into a special trace file, and that file can be later analyzed.
Recording can be done in the following ways:
-
By requesting it via GUI when starting an operation. (Supported for majority - but not all - operations: those that have "options bar" available.)
-
By requesting regular tracing (each N processed objects) in background tasks.
-
By turning on tracing of all operations in midPoint.
Analysis can be carried out via:
-
midPoint GUI (via Created reports page - since 4.1),
-
Eclipse plugin (but only using unpublished version in feature/tracing branch - and this plugin is already deprecated),
-
IntelliJ IDEA plugin (but this feature is not finished there).
Enabling experimental features
To record (via GUI) or to view traces you have to enable experimental features of midPoint GUI:
After the change, please log out and log in, in order to apply the changed settings.
Recording traces via GUI
Now you can execute any operation in "traced mode" like this:
There are two basic flavors of tracing:
-
Functional tracing. It is used to troubleshoot functional issues like misbehaving mappings. There is a lot of information collected, and therefore this can have a significant performance impact. It is often advisable to include logging information in recorded traces, e.g. model, provisioning, or SQL logging.
-
Performance tracing. This one is suitable to pinpoint performance issues. Here we collect only basic information, so the impact on performance is quite low.
After operation is complete, the trace is stored in trace
subdirectory of midPoint home directory.
It can be obtained either directly from there, or downloaded/viewed from within _Created reports _menu item (see below).
Recording traces for background tasks
A task can record the trace(s) for objects being processed by including the following configuration snippet (adapted as needed):
<task ...>
<extension ...>
<mext:tracing xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">
<interval>1</interval> <!-- we will trace each object processed -->
<tracingProfile>
<collectLogEntries>true</collectLogEntries>
<loggingOverride>
<levelOverride>
<logger>com.evolveum.midpoint.model</logger>
<level>TRACE</level>
</levelOverride>
</loggingOverride>
<tracingTypeProfile>
<level>normal</level>
</tracingTypeProfile>
<fileNamePattern>trace %{timestamp} %{testNameShort} %{focusName} %{milliseconds}</fileNamePattern>
</tracingProfile>
</mext:tracing>
...
</extension>
...
</task>
Analyzing traces via GUI
First you need to open Created reports page:
After clicking on "eye" icon you get the Trace view page:
Now you can configure the view you’d like to obtain and click the Show button. As the trace file is usually quite large (tens or hundreds of megabytes) it will take a few seconds before displaying. But subsequent visualizations of the same trace (with changed parameters) should be quite fast. (Also make sure you get enough heap when opening large traces. ☺)
More information about the Trace view is on Trace visualization page.
Analyzing traces via IDEA plugin
TODO
Tracing customization
Tracing profiles are available in the system configuration. If you need to change them (typically if you need to include more logging), you can update the configuration.
An example of adding workflow module logging:
<profile>
<name>functional-model-workflows-logging</name>
<displayName>Functional tracing (with model and workflows logging)</displayName>
<visible>true</visible>
<fileNamePattern>functional-trace %{timestamp} %{focusName}</fileNamePattern>
<createRepoObject>true</createRepoObject>
<compressOutput>true</compressOutput>
<collectLogEntries>true</collectLogEntries>
<loggingOverride>
<levelOverride>
<logger>com.evolveum.midpoint.model</logger>
<logger>com.evolveum.midpoint.wf</logger>
<level>TRACE</level>
</levelOverride>
</loggingOverride>
<tracingTypeProfile>
<level>normal</level>
</tracingTypeProfile>
</profile>
Authorizations
TODO