---
title: "PE - Configuring Prometheus Exporter PRO for Jira"
canonical: "https://support.appfire.com/space/PE/14680296/PE%20-%20Configuring%20Prometheus%20Exporter%20PRO%20for%20Jira"
format: markdown
---
> Macro (aura-html)


> ℹ️ All examples in this article are applied to Jira. But the same can be applied to Confluence and Bitbucket.

## Configuring Prometheus Exporter Metric Collector

Prometheus Exporter gathers some metrics by a scheduled job which means that you will have up-to-date values for such metrics only if the job has been performed. For other metrics, you always get up-to-date values. You can find information on which metrics are gathered by the scheduled job [here](https://appfire.atlassian.net/wiki/spaces/PE/pages/14680629).

> ⚠️ **Recommended Job Interval for Metric Collection**
> ⚠️ 
> ⚠️ The job's default run interval is set at **2 minutes**. We strongly recommend not to reduce this interval to less than 2 minutes in production environments to prevent high loads on the server.

**To change the Metric collector job interval:**

1. Select the **Jira** **Settings*** *icon* ( *:jira-cog: *) *in the top-right corner of the screen.
2. Go to **General Configuration** → **Prometheus Exporter** → **General**.
3. In the **Metric Collector Job Interval (minutes)** box, enter the required period.
4. Click **Save**.

![image](media://51c79675-3305-4454-82b8-87e37cfd1f33)

### Checking the Prometheus exposed metrics

At the top of the *General* page (as shown in the screenshot above), you'll also find a **Note **with* *two* links* that provide access to the metrics collected by Prometheus:

- For the** single current node**: Follow the link to access metrics specific to the currently active node.
- For **Multiple nodes**: Click the link to view metrics collected from all the Data Center nodes that Prometheus Exporter PRO collects metrics from. To learn how to set up Prometheus Exporter PRO for Jira to gather metrics from your Data Center nodes, check the [Configuring Prometheus Exporter PRO for Jira Data Center](https://appfire.atlassian.net/wiki/spaces/PE/pages/14680641) document.

You will also find the **Last Execution*** *time of the scheduled job in the *Note *on this page.

> ⚠️ The links to exposed metrics are unavailable if you chose the **Basic Auth (Bearer) authentication type**.

### Request Settings

By default Prometheus Exporter collects duration of web requests (duration includes spent time of a web request on the server side. It does not include the time spent on the client and network connection) This metric is called `confluence_request_duration_on_path` (`jira_request_duration_on_path` for Jira, `bitbucket_request_duration_on_path` for Bitbucket)

It is a histogram metric. Each metric has a label which provides the path, which were executed.

For example:

```
confluence_request_duration_on_path_sum{path="/rest",} 11.873832757
```

It shows how long all requests to the /rest path took. 

By default all urls are cut to the first level. For example, let's say you called the following url : [http://localhost:8090/rest/api/space](http://localhost:8090/rest/api/space). The first path which contains the domain and the port of the server will be cut. Also if the url contains the context it will be also cut. In the result we have the following url: [/rest/api/space](http://localhost:8090/rest/api/space). Now only the first level will be taken which is /rest and set as the label for the metric. If you do not need the default behaviour you can unclick the "Collect duration for default urls" checkbox. As the result the  confluence_request_duration_on_path metric will not be collected.

Now suppose that you want to collect information only for certain rest calls. For example, for [/rest/api/space](http://localhost:8090/rest/api/space). In this case you can enter this line into the "Add url to collect metrics" field, push the Add button and then the **Save** button.

![image](media://9ff16d2d-dbd5-4c64-b238-b821ee9d3a17)

Now if you execute the [/rest/api/space](http://localhost:8090/rest/api/space) rest endpoint you will be able to see metrics on the request:

```
confluence_request_duration_on_path_sum{path="/rest/api/space",} 0.01212779
```


You can also provide the asterisk sign as a wildcard. For example,

```
/pages/createpage.action?*spaceKey*
/pages/createpage.action?*spaceKey=d*
```

The asterisk sign can represent any number of characters (including zero). If you specified a "co*" it would use "co", "coca-cola", "cone" and *anything* that starts with “co”. "n*l" could be null, nutritional, nonparallel, and anything that starts with an n and ends with an l.

If multiple added urls satisfy the current web request url then the added url with most characters will be chosen as the label for the confluence_request_duration_on_path metric. 

For example, in the example above, if both added urls (/pages/createpage.action?*spaceKey*, /pages/createpage.action?*spaceKey=d*) satisfy the current web request url ([/pages/createpage.action?spaceKey=ds](http://localhost:1990/confluence/pages/createpage.action?spaceKey=ds)) then the /pages/createpage.action?*spaceKey=d* will be chosen (37 characters against 35 characters)  as the label for the confluence_request_duration_on_path metric.

## Securing Prometheus Exporter

To secure Prometheus Exporter you need to go to cog wheel → **General Configuration** → **Prometheus Exporter** → **Security**

![image](media://48069605-9a44-4115-99ae-5a400b6496b9)

But default no authentication is chosen for Prometheus Exporter which means that your metrics can be pulled by any user.

If you want to secure your Prometheus Exporter then you have two options: URL token and Basic Auth (Bearer)


**URL Token**

To secure Prometheus Exporter by URL token you should choose the URL Token option in the Authentication Type select field:

![image](media://a781390c-899b-4b77-8e5f-ffa1b7c089ee)

The Token input field will be automatically generated but if you wish to regenerate the token you can click on the Generate link button.

The URL Token Authentication means that the token will be sent in the URL in your browser.

[https://yourconfluence.com/confluence/plugins/servlet/prometheus/metrics?token=bhELVroDYjRAtZCGEJPBElj00Sk6aP2Pn6O](https://products-dc.cprime.io/confluence/plugins/servlet/prometheus/metrics?token=bhELVroDYjRAtZCGEJPBElj00Sk6aP2Pn6O)

Your prometheus.yml file should look like this:

##### **prometheus.yml**

```
- job_name: 'confluence'
    scheme: https # change to http if you don't have https
    metrics_path: '/<your_confluence_context_path>/plugins/servlet/prometheus/metrics'
    params:
         token: ['bhELVroDYjRAtZCGEJPBElj00Sk6aP2Pn6O'] 
    static_configs:
      - targets: ['myhost:1990'] # Confluence host and port you serve






```


**Basic Auth (Bearer)**

To secure Prometheus Exporter by Basic Auth (Bearer) you should choose the Basic Auth (Bearer) option in the Authentication Type select field:

![image](media://46c717cf-e661-4278-b14b-1cdda9a0b15a)

For this authentication type the token will be sent in the Authorization header of the request.

You should configure the prometheus.yml file for the Basic Auth (Bearer) like this:

##### **prometheus.yml**

```
- job_name: 'confluence'
    scheme: https #change to http if don't you have https
    metrics_path: '/<your_confluence_context_path>/plugins/servlet/prometheus/metrics'
    
    bearer_token: 'bhELVroDYjRAtZCGEJPBElj00Sk6aP2Pn6O'
    static_configs:
      - targets: ['myhost:1990']
```

### Token Expiration

If you chose the URL Token or Basic Auth (Bearer) type authentication then you can set your token to be expired.

Go to cog wheel → General Configuration → Prometheus Exporter → Security and click on the Expire Token checkbox:

![image](media://d4e22340-3d42-41a6-a1e9-b3230d38dc9c)

By default the token will expire in 30 days but you can change this period by changing the value of the input filed below the Expire Token checkbox.

##   
Managing Prometheus Exporter PRO Metrics

> ℹ️ Starting with version 3.0.0-jira8 for Prometheus Exporter PRO for Jira, you are able to see and manage collected metrics.


Go to **Administration** → **Manage apps** → **Prometheus Exporter** → **Metrics **and select which metrics must be collected and how.

![image](media://5f4d313e-b48b-4fde-b461-6b47f8fcc458)

On this page, you're able to turn on and off metrics you want to track, select which metrics must be collected in real-time (otherwise by a schedule job), and see the time and duration of metrics execution.

> ✅ **Recommendation for production environments**
> ✅ 
> ✅ For optimal performance in production environments, especially when the **scrape_interval** in the *prometheus.yml* file is set to 2 minutes or less, we highly recommend two actions:
> ✅ 
> ✅ 1. Uncheck the boxes under the **Collection in Real Time** column.
> ✅ 2. Adjust the **scrape_interval** to a minimum of 2 minutes, or ideally 5 minutes.
> ✅ 
> ✅ This ensures smooth and efficient operation of the production server.

## Checking visualizations of your metrics on the Dashboard 

To better understand the metrics collected by Prometheus for your Jira system, we have added the **Dashboard** admin page. To explore the types of metrics used for visualizations on the *Dashboard* page, check the **list of exposed metrics **in our [Using Prometheus Exporter for Jira](https://appfire.atlassian.net/wiki/spaces/PE/pages/14680629) document.** ** 

In the **Dashboard** admin page, you'll find:

- *Column chart* visualizations of** JVM **(Java Virtual Machine)** **related metrics, such as a comparison of *JVM pool bytes* used by different nodes.
- *Column chart *visualizations of **Request Duration on Path**, like a comparison of request durations for the `/rest` path across different nodes.
- *Column chart* visualizations of **Instance Specific** metrics, such as a comparison of *Jira Data Base Connections* metrics.
- *Table chart *visualizations of various **Other **metrics, such as *process_cpu_seconds *values for different nodes.

> ℹ️ All chart visualizations you see on the Dashboard menu use metrics data values provided by Prometheus last job execution. You can check the time of the **last execution** by going to the *[ ](#)*[General admin page](#Configuring-Prometheus-Exporter-Metric-Collector) of the Prometheus Exporter PRO app in Jira.


**Examples of visualizations on the Dashboard admin page**