> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# System metrics with Prometheus

Package Security Manager system performance can be monitored to understand system health, evaluate network traffic, and detect issues. Each of Package Security Manager’s services expose a set of metrics that can be visualized using the built-in Prometheus expression browser. Metrics are provided in [OpenMetrics](https://openmetrics.io/) (Prometheus) format.

## Accessing Prometheus

In your web browser, append `/prometheus/` to your Package Security Manager fully qualified domain name (FQDN). For example: `https://<FQDN>.com/prometheus/`

## Creating graphs for metrics

Prometheus uses a built-in expression browser for time series visualizations of system metrics.

To create system metric graphs in Prometheus:

1. Enter the name of an expression you want to view in the search box.

2. Select your expression from the list that appears.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/prometheus_metric_select.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=9053f32c8eb1ecc7926b20989d1390af" alt="" width="1922" height="589" data-path="images/prometheus_metric_select.png" />
   </Frame>

3. Click **Execute**.

4. Select the **Graph** tab.

The graph is populated by the selected metric, and a console readout appears below it.

<Tip>
  To isolate a specific resource, select it from the legend below the graph.
</Tip>

## Popular metrics

### up

The `up` time metric tells you if your instance is running.

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/prometheus_up_metric.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=d66f5990548a327e051026d655158006" alt="" width="1903" height="877" data-path="images/prometheus_up_metric.png" />
</Frame>

### process\_open\_fds

The `process_open_fds` metric counts the number of files in the `/proc/PID/fd` directory.
This tells you how many regular files, sockets, pseudo terminals, and other processes you currently have open.

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/prometheus_process_open_fds.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=bd23489c19b8538e0c87930e5df3dd45" alt="" width="1904" height="871" data-path="images/prometheus_process_open_fds.png" />
</Frame>

### process\_max\_fds

The `process_max_fds` metric reads `/proc/<PID>/limits` and uses the **Soft Limit** from the **Max Open Files** row.

<Note>
  `/limits` lists both soft and hard limits. The soft limit is the value the kernel enforces for the corresponding resource, while the hard limit acts as the ceiling for the soft limit.
</Note>

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/GAawxvWy-HUVSCqf/images/prometheus_process_max_fds.png?fit=max&auto=format&n=GAawxvWy-HUVSCqf&q=85&s=1b1420309659435bfc5f352ca715e9b3" alt="" width="1898" height="870" data-path="images/prometheus_process_max_fds.png" />
</Frame>

## Setting a file limit alert

Using the two metrics above, `process_open_fds` and `process_max_fds`, you can write an alert to warn you when a process hits 80% of the limit:

```yaml theme={null}
groups:
- name: example
  rules:
  - alert: ProcessNearFDLimits
    expr: process_open_fds / process_max_fds > 0.8
    for: 10m
```
