Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Prometheus Exporter for Bitbucket exposes Bitbucket metrics as JVM and application statistics to Prometheus.

...

  • Global controls the Prometheus server's global configuration.
  • Rule_files specifies the location of any rules that you want the Prometheus server to load.
  • Scrape_configs controls what resources Prometheus monitors.

 To enable Prometheus Exporter for Bitbucket so that it collects metrics and pulls it into Prometheus

  1. Use the following scrape_configs:

    Code Block
    titleprometheus.yml
    scrape_configs:
      - job_name: 'bitbucket'
        scheme: https #change to http if don't you have https
        metrics_path: '/<your_bitbucket_context_path>/plugins/servlet/prometheus/metrics'
        static_configs:
          - targets: ['myhost:1990']

    For a complete specification of configuration options, see the Prometheus configuration documentation.


  2.  Select Select Prometheus Exporter for Bitbucket endpoint in the Prometheus Status >Targets page where all registered applications are listed, to get the Prometheus metrics.Image Removed<<<Update screenshot with Bitbucket 

  3. Build any of the available dashboards with the selected metrics.


    Image RemovedImage Added

Configuring a secret token (recommended)

...

  1. Log into your Bitbucket as Admin.
  2. Go to Administration and click Prometheus Exporter Settings. The Prometheus Exporter Settings page opens. 
  3. Generate or create a Token. We recommend to use 128 length symbol.
     

    Image Modified


  4. Use generated or created secret token in the following scrape_configs in the prometheus.yml configuration file: 

    Code Block
    titleprometheus.yml
    - job_name: 'bitbucket'
        scheme: https #change to http if don't you have https
        metrics_path: '/<your_bitbucket_context_path>/plugins/servlet/prometheus/metrics'
        params:
             token: ['1234567890'] # i'd reccomend use 128 symbol lenght long [A-Za-z0-9]
        static_configs:
          - targets: ['myhost:1990']


...