sonarqube-prometheus-exporter icon indicating copy to clipboard operation
sonarqube-prometheus-exporter copied to clipboard

Authorization for recieve metrics from Private Projects?

Open SkokOleg opened this issue 4 years ago • 2 comments
trafficstars

Is it possible to add auth for recieve metrics from private Projects?

SkokOleg avatar Feb 24 '21 12:02 SkokOleg

The following did work for me. I generated the Token like this.

- job_name: 'sonarqube-test'
  metrics_path: '/api/prometheus/metrics'
  scheme: https
  static_configs:
    - targets: ['your.sonarqube.com']
  basic_auth:
    username: <TOKEN>

Edit: Formatting

alkern avatar May 06 '21 13:05 alkern

I'm trying to access our sonarqube instance running in AWS from k8s, using the configuration:

spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: sonar-prometheus
  namespaceSelector:
    matchNames:
        - monitoring
  endpoints:
  - targetPort: 443
    scheme: https
    interval: 30s
    path: /api/prometheus/metrics
    bearerTokenSecret:
      key: auth-token

I know that I can get the metrics returned by using curl -u<SECRET>: https://serverhost/api/prometheus/metrics but I am not seeing these within our Grafana service.

Jaff avatar Jan 10 '22 18:01 Jaff