> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/platform/monitoring.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# Monitoring

Monitor PowerShell Universal with Azure Application Insights and Windows performance counters, and review active processes and user sessions in the console.

PowerShell Universal automatically integrates with Microsoft Application Insights to provide monitoring and alerting for your system. It also provides performance counters for various features in the environment.

## Application Insights

### Configuring Application Insights

Within the Azure Portal, you will need to create a new Application Insights resource. Once it's been created, you will need to copy the connection string.

Next, paste your connection string into the [Settings file ](https://docs.devolutions.net/powershell-universal/config/settings.md)for PowerShell Universal. Finally, restart the PowerShell Universal server. Application monitoring will now be enabled. Application Insights is enabled only when `ApplicationInsights:ConnectionString` is not empty; it is empty by default.

```json
  "ApplicationInsights": {
    "ConnectionString": "InstrumentationKey=73b84b67-6fc9-4c37-9f54-000000000000"
  },
```

If you are running PowerShell Universal in Azure, you can also create a new Application Setting. Within your web app, click Configuration and the n Click New application setting.

The name should be:

```
APPLICATIONINSIGHTS__CONNECTIONSTRING
```

The value should be the connection string. Restart your web app to start collecting metrics.

### Viewing Monitoring Data

Within the Azure Portal, you can view the Application Insights resource to view information about your PowerShell Universal server. This will include data such as failed responses, server response time, server requests and availability. You'll also be able to setup alerts to monitor for particular conditions of the PowerShell Universal server.

## Performance Counters

{% hint style="info" %}
Performance counters are only supported on Windows.
{% endhint %}

Performance counters are installed when running the MSI installer. Once this occurs, performance data will automatically be generated by the following counters.

* PowerShell Universal \ Active API Endpoints \ \_Total
* PowerShell Universal \ Active API Endpoints \ Endpoint
* PowerShell Universal \ API Endpoint Calls per second \ \_Total
* PowerShell Universal \ API Endpoint Calls per second \ Endpoint
* PowerShell Universal \ API Execution Time \ \_Total
* PowerShell Universal \ API Execution Time \ Endpoint
* PowerShell Universal \ Active Dashboard Connections \ \_Total
* PowerShell Universal \ Active Dashboard Connections \ Dashboard

The endpoint instance name is the endpoint URL followed by `|` and its HTTP methods, such as `/api/users|GET`. The dashboard instance name is the app name. PowerShell Universal writes the counters only when the `PowerShell Universal` counter category exists when the server starts. Otherwise, the log contains `PowerShell Universal performance counters do not exist.`

To stop PowerShell Universal from writing performance counters, set `Diagnostics:DisablePerformanceCounters` to `true` in `appsettings.json`:

```json
  "Diagnostics": {
    "DisablePerformanceCounters": true
  },
```

### Installation

By default, the MSI will install the performance counters. If you are running PowerShell Universal outside of the MSI, you will need to install them yourself. You can do so with the following script. You will need to run it from an elevated prompt.

```powershell
$categoryName = "PowerShell Universal"
$categoryType = [System.Diagnostics.PerformanceCounterCategoryType]::MultiInstance
$categoryExists = [System.Diagnostics.PerformanceCounterCategory]::Exists($categoryName)

If (-Not $categoryExists)
{
$objCCDC = New-Object System.Diagnostics.CounterCreationDataCollection
$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Active Endpoints"
$objCCD1.CounterType = "NumberOfItems32"
$objCCD1.CounterHelp = "Active number of executing endpoints."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Execution Time"
$objCCD1.CounterType = "averageTimer32"
$objCCD1.CounterHelp = "Average execution time."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Execution Time Base"
$objCCD1.CounterType = "averageBase"
$objCCD1.CounterHelp = "Average execution time base."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Calls per second"
$objCCD1.CounterType = "rateOfCountsPerSecond64"
$objCCD1.CounterHelp = "Number of executions per second."
$objCCDC.Add($objCCD1) | Out-Null

$objCCD1 = New-Object System.Diagnostics.CounterCreationData
$objCCD1.CounterName = "Active Connections"
$objCCD1.CounterType = "numberOfItems64"
$objCCD1.CounterHelp = "Number of active connections to dashboards"
$objCCDC.Add($objCCD1) | Out-Null

[System.Diagnostics.PerformanceCounterCategory]::Create($categoryName, $categoryHelp, $categoryType, $objCCDC)|Out-Null
}
```

## Health Monitoring

In PowerShell Universal 2027.1 and later, the ***Health Monitoring*** page of the admin console (***Observe*** – ***Health Monitoring***, at `/admin/health-monitoring`) helps you "Compare recent recorded activity to investigate when an issue occurred." The page requires a license and the Read permission on health checks; without it, the page shows "Read permission is required to view this activity." Users can customize the admin console menu, so the item can be in another place on your instance.

| Element              | Description                                                                                                                                  |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **Time range**       | **Last 10 minutes**, **Last 30 minutes** or **Last 60 minutes**.                                                                             |
| **Refresh**          | Reloads the activity. If it cannot be loaded, the page shows "Activity could not be loaded. Refresh to try again."                           |
| **Activity window:** | The start and end of the displayed period, followed by **Most recent persisted activity:** and the time of the latest saved counter.         |
| **API requests**     | Chart of the calls that reached enabled configured endpoints, per minute.                                                                    |
| **Sessions started** | Chart of the session connections, including reconnects (not unique users), per minute.                                                       |
| **App events**       | Chart of the browser callbacks and form submissions dispatched to app scripts, per minute. Not every click or background refresh is counted. |

The information banner of the page explains how the counters are collected: they are saved every 5 seconds across nodes, independently of logs. Counts may be partial during startup, for the current minute or during outages, and unsaved counts can be lost on a crash. When some minutes have no collected data, the page shows "Some minutes have no collected data. Missing bars do not mean zero activity."

## Processes

Processes started directly from PowerShell Universal will be displayed in the processes page. You can access this page by clicking **Processes** under **Observe** in the navigation menu, or by clicking **View** next to **Processes** in the **Additional Information** card of the Home page.

Information includes the computer, process ID, description, environment, process name, arguments, user, and memory (**Working Set**). You can also view the runspaces and loaded assemblies of each process.

Note that processes started by your scripts will not be listed here.

## User Sessions

You can view user sessions for dashboards and the admin console by clicking **User Sessions** under **Observe** in the navigation menu, or **View** on the **Sessions** card of the Home page. Session information includes the connection time, disconnection time, whether the session is currently connected, source, user name, browser user agent string and IP address.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/platform/monitoring.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
