63.2. Using Active Session History Page #

63.2.1. Viewing Active Session History #

To view the active session history, go to the Monitoring navigation tab → Active sessions history → Active sessions history.

The total wait event time line chart and tables with queries and sessions will be displayed.

The data is displayed only for one instance and for a selected time period. By default, the first instance in the drop-down list and the last 4 hours are selected. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

If the history page is accessed from an individual instance page, the instance drop-down list is not displayed on the history page.

Tip

If no data is displayed, first try adjusting the display parameters as described below.

If the problem persists, refer to the troubleshooting section.

If necessary, use the controls on the page to adjust the data display parameters:

  • Configure auto-refreshing of the displayed data:

    • In the top-right corner of the page, click to enable auto-refreshing.

    • In the top-right corner of the page, click to disable auto-refreshing.

    If auto-refreshing is disabled, refresh the data manually by clicking .

  • In the top-right corner of the page, select an instance from the instance drop-down list. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

  • Select or specify a time period by performing one of the following actions:

    • In the top-right corner of the line chart, specify a different time period or select it from the drop-down list.

    • In the top-right corner of the line chart, click . Then, inside the chart, press the left mouse button and drag the cursor to select a horizontal area that represents a time period of interest.

    The chart is scaled in accordance with the selected time interval.

For information about managing active session profiling, refer to the corresponding instructions.

63.2.1.1. Viewing Total Wait Event Time #

The line chart contains data related to the total wait event time.

To quickly view details of wait event statistics at a specific point of time, hover over the chart to this point. The tooltip will be displayed with the event summary and following metrics:

  • The server CPU count.

  • The total number of wait events.

  • The total wait time.

  • The wait event type, its percentage compared to other types, average number of active sessions, and wait time per event type.

At the bottom of the chart, click the legend checkboxes to show or hide certain event types.

Switch between the chart display modes to view the data in different ways:

  • In the main mode (the default), the chart shows the total wait time per event type.

    In the alternative mode, the chart shows the total wait time per event.

    To switch to the alternative mode, click on the colored part of the chart.

  • While in the alternative mode, a different event type can be selected from the drop-down list at the top of the chart.

    To switch back to the main mode, click Back.

In the top-right corner of the chart, click to download a CSV file with the data collected within the time period displayed in the drop-down list. The data is downloaded in a raw, non-aggregated form to be used as a source in external systems. The file name is the profile identifier.

If no data is collected within the time, the resulting file contains only the header.

All data collected within the time period is saved to the file, even if the chart is configured so that no data is displayed, for example by deselecting all the legend checkboxes.

63.2.1.2. Viewing SQL Queries and Sessions #

The tables below the line chart contain data related to queries and sessions.

Note

Duration and execution time values that are less than one second are displayed in milliseconds.

The SQL queries table has the following columns:

  • Activity: The colored horizontal indicator that represents the query wait time compared to the other queries within the selected time period.

    To view details about the activity, hover over the indicator.

  • Query ID.

    To view SQL statistics for the query, click the query ID. You will be redirected to the SQL statistics page of the related instance.

  • Query: The short name of the query.

    To filter queries, click and enter a full or partial query text.

    To quickly view the query text, hover over the query category (for example, SELECT). The partial query text will be displayed. The full text is in the query details.

    To view the query details, click the query category. The window with detailed information about the query will open. The following parameters are displayed:

    • Number of executions and Total execution time.

      These parameters are displayed only if the pg_stat_statements module is installed on the instance.

    • Query: The query text.

      If the query is a result of executing a prepared statement, the Prepared statement badge is displayed. In this case, the query text is the prepared statement text.

      To view the name of the prepared statement, hover over the badge.

      To copy the query text, click .

    • Query plan: The query plan, if available.

      The query plan is displayed only if the pgpro_stats extension is installed on the instance.

      Even with the extension installed, the query plan may be unavailable.

      To copy the query plan, click .

  • Duration: The duration of the query.

  • Executions, count: How many times the query was executed.

  • Total time: The total execution time of all executed queries.

The Sessions table has the following columns:

  • Activity: The colored horizontal indicator that represents the session duration compared to other sessions within the selected time period.

    To view details about the activity, hover over the indicator.

  • Process ID: The backend ID.

  • User: The name of the DBMS user on behalf of which the session is initiated.

  • Database: The name of the database associated with the user session.

  • Application: The name of the source application of the user session.

63.2.2. Managing Active Session Profiling #

Note

Profiling is managed separately for each instance.

63.2.2.1. Enabling and Disabling Profiling #

  1. Go to the Monitoring navigation tab → Active sessions history → Active sessions history.

  2. In the top-right corner of the page, select an instance from the drop-down list. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

    If the history page is accessed from an individual instance page, this drop-down list is not displayed on the history page.

  3. Perform one of the following actions:

    • To enable profiling, in the top-right corner of the page, click .

      To enable profiling for a large number of instances, use the corresponding mass operation.

    • To disable profiling, in the top-right corner of the page, click and confirm the operation.

      Important

      Disabling profiling clears profile data and permanently deletes all collected information.

      When profiling is re-enabled, data collection starts anew.

63.2.2.2. Pausing and Resuming Profiling #

  1. Go to the Monitoring navigation tab → Active sessions history → Active sessions history.

  2. In the top-right corner of the page, select an instance from the drop-down list. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

    If the history page is accessed from an individual instance page, this drop-down list is not displayed on the history page.

  3. Perform one of the following actions:

    • To pause profiling, in the top-right corner of the page, click Pause and confirm the operation.

      The data already collected will remain available for viewing, but new data will not be collected.

    • To resume profiling, in the top-right corner of the page, click Resume.

      The data collection will continue.

63.2.2.3. Viewing Profile Details #

Important

Profile details of an instance can be viewed only if profiling is not disabled for the instance.

To view profile details:

  1. Go to the Monitoring navigation tab → Active sessions history → Active sessions history.

  2. In the top-right corner of the page, select an instance from the drop-down list. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

    If the history page is accessed from an individual instance page, this drop-down list is not displayed on the history page.

  3. Click .

The window with detailed information about the profile will open. The following parameters are displayed:

  • Identifier.

  • Created at: The creation time.

  • Collection status: The collection status, depends on the profiling status.

  • Collection interval.

  • Possible values:

    • Enabled: The profiling is enabled.

    • Initializing: Profiling is enabled, profile data collection starts.

      This means that profiling is either enabled from the Disabled state or resumed from the Paused state.

    • Active: Profiling is enabled, profile data collection is in progress.

    • Stopping: Profiling is enabled but paused, and profile data collection is being stopped.

    • Paused: Profiling is enabled but paused, and profile data collection is stopped.

    • Error: Profiling is enabled but encountered errors.

    • Disabled: Profiling is disabled.

  • First snapshot: The time when the first snapshot was taken.

  • Last snapshot: The time when the last snapshot was taken.

  • Number of snapshots.

  • Table size: The size of the profiling table that stores the collected data in the active session history storage.

  • Data retention period: The retention period for the collected data.

    The background process automatically clears the profile by deleting the stale data for which the retention period expires. This helps to free up the history storage.

    For information about how to configure the data retention period for the profile, refer to the corresponding instructions.

  • Last profile data clearing: The last time when the profile was cleared.

    The profile can be cleared either automatically by the background process or manually.

    For information about how to clear the profile, refer to the corresponding instructions.

63.2.2.4. Editing Profile Parameters #

Important

The profile of an instance can be edited only if profiling is paused for the instance.

To edit the profile parameters:

  1. Go to the Monitoring navigation tab → Active sessions history → Active sessions history.

  2. In the top-right corner of the page, select an instance from the drop-down list. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

    If the history page is accessed from an individual instance page, this drop-down list is not displayed on the history page.

  3. In the top-right corner of the page, click .

    If profiling is not paused for the instance, pause it first.

  4. Edit profile parameters:

    1. Snapshot interval, sec: The interval between taking session snapshots, in seconds.

      The less interval is specified, the more snapshots are taken, and the more data is stored.

      Default value: 10 seconds.

    2. Data retention, days: The retention period for the collected data, in days.

      The background process automatically clears the profile by deleting the stale data for which the retention period expires. This helps to free up storage in the repository database.

      Also, it is possible to clear the stale data manually. For information about how to clear the profile, refer to the corresponding instructions.

      Default value: 7 days.

  5. Click Save.

  6. Resume profiling, if necessary.

63.2.2.5. Clearing Profile Data #

Important

Profile data of an instance can be cleared only if profiling is not disabled for the instance.

You can clear profile data manually, without waiting for the retention period to expire or the background process to delete stale data.

To clear profile data:

  1. Go to the Monitoring navigation tab → Active sessions history → Active sessions history.

  2. In the top-right corner of the page, select an instance from the drop-down list. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

    If the history page is accessed from an individual instance page, this drop-down list is not displayed on the history page.

  3. In the top-right corner of the page, click .

  4. Specify the date.

    Profile data stored on or before this date will be deleted.

  5. Click Clear.

63.2.3. Troubleshooting #

Under certain conditions, the chart and tables may be missing or empty. In this case, try the following steps, depending on the message displayed:

  • Profiling is disabled.

    Either enable profiling for the selected instance, or select another instance with enabled profiling from the drop-down list in the top-right corner of the page. The instances for which active session profiling is disabled are marked with the corresponding hint next to them.

  • No data.

    Profiling is enabled, but no data can be fetched.

    Ensure that the manager and agents are running and functioning correctly, and there are no network-related issues. Then try to access the active history page again later.

  • No active sessions and wait events.

    Either profiling is paused, or no sessions and events happened within the selected time period. Try the following actions:

    • Resume profiling if it is paused.

    • Wait for the historical data to be collected.

    • In the top-right corner of the line chart, specify a different time period or select it from the drop-down list.

FAQ