Skip to main content
The instructions for downloading, installing, configuring, and running Prometheus locally in this section assume Unix-like systems, such as Linux and MacOS, but the process is similar for Windows with minor changes.
Perform the following tasks to install and configure Prometheus:
  1. Download Prometheus.
  2. Extract the archive.
  3. Extract the certificate, key, and certificate chain.
  4. Configure Protheus.
  5. Run Prometheus.

Download Prometheus

1
Open your web browser and go to the official Prometheus download page at https://prometheus.io/download/.
2
Find the appropriate version for your operating system under the Prometheus section and select it to start the download.

Extract the archive

Perform the following steps to extract the downloaded archive:
1
After the download finishes, open your terminal.
2
Go to the directory where you downloaded the Prometheus archive.
3
Extract the downloaded file using the following tar command:
Terminal
  tar xvfz prometheus-*.tar.gz
4
This command creates a new directory named something similar to prometheus-2.x.x. Run the following command to go this directory:
Terminal
  cd prometheus-*

Extract the certificate, key, and certificate chain

In a terminal, perform the following steps in OpenSSL to extract the client certificate, client private key, and CA certificate tree from the PKCS #12 file you downloaded in the VIP:
Each of the following commands prompts for the PKCS #12 file password.
1
Extract the client certificate:
Terminal
  openssl pkcs12 -in pki.p12 -clcerts -nokeys -out clientcert.pem
2
Extract the client private key:
Terminal
  openssl pkcs12 -in pki.p12 -nocerts -nodes -out clientkey.pem
3
Extract the CA certificate chain:
Shell
openssl pkcs12 -in certificate.p12 -cacerts -nokeys -out cacert.pem

Configure Prometheus

To configure the Prometheus configuration file (including the client certificate, client private key, and CA certificate chain PEM files), perform the following steps:
1
Create a file to contain the configuration settings for Prometheus in the extracted Prometheus directory. Name it prometheus.yml.
2
Edit the file with the appropraite setting for your use case.
This is an example configuration that instructs Prometheus to monitor a VirtuCrypt endpoint at us01crypto01test.virtucrypt.com on port 1234. Refer to Appendix A - VirtuCrypt endpoints for the full list of public VirtuCrypt endpoints.
YAML
global:
  scrapeinterval:     3s

  externallabels:
      monitor: 'virtucrypt'

scrapeconfigs:
  - jobname: 'prometheus'
    staticconfigs:
      - targets: ['localhost:9090']

  - jobname: 'TLSTest'
    metricspath: '/federate'
    params:
      'match[]':
        - '{name=~".+"}'
    staticconfigs:
      - targets: ['us01crypto01test.virtucrypt.com:1234']
    scheme: 'https'
    tlsconfig:
      cafile: '/certs/cacerts.pem'
      certfile: '/certs/clientcert.pem'
      key_file: '/certs/clientkey.pem'
3
Save the prometheus.yml file and close your text editor.

Run Prometheus

Run the following command to execute the Prometheus binary:
Shell
./prometheus --config.file=prometheus.yml
Prometheus should now be running and available at http://localhost:9090/ by default.