Versions Compared

Key

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

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

Note

Be aware, this plugin publicly exposes some sensitive data by default. The metrics page exposes the username of who last logged in, who last edited issues in every project and some more usernames. You should enable token protection to make sure the public cannot view usernames.

Once app is successfully installed:

  1. Use the following link to expose necessary metrics: /plugins/servlet/prometheus/metrics. 
  2. Set up the Prometheus settings 

    Code Block
    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']



  3. Optionally, to enable secure access, you can configure a secret token. To configure the secret token:

    1. Log into your Bitbucket as Admin.
    2. In the cog wheel menu, select Administration.
    3. Locate and click Prometheus Exporter Settings. The Prometheus Exporter Settings page opens. 
    4. Fill in the fields on this page. Use the following scrape URL: /plugins/servlet/prometheus/metrics?token=secrettoken



    5. The prometheus settings will now take the following look:

      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']


...