Page tree
Skip to end of metadata
Go to start of metadata

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

  1. Enable experimental features in GUI. Logout + login.
  2. Select tracing profile e.g. "functional" when invoking an operation.
  3. Find the trace in "Reports created" and click on "eye" icon.
  4. Enjoy!

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:

  1. By requesting it via GUI when starting an operation. (Supported for majority - but not all - operations: those that have "options bar" available.)
  2. By requesting regular tracing (each N processed objects) in background tasks.
  3. By turning on tracing of all operations in midPoint.

Analysis can be carried out via:

  1. midPoint GUI (via Created reports page - since 4.1),
  2. Eclipse plugin (but only using unpublished version in feature/tracing branch - and this plugin is already deprecated),
  3. 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:

  1. 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.
  2. 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. (smile))

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

  • No labels