Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization for recieve metrics from Private Projects? #14

Open
SkokOleg opened this issue Feb 24, 2021 · 2 comments
Open

Authorization for recieve metrics from Private Projects? #14

SkokOleg opened this issue Feb 24, 2021 · 2 comments

Comments

@SkokOleg
Copy link

SkokOleg commented Feb 24, 2021

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

@alkern
Copy link

alkern commented May 6, 2021

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

@Jaff
Copy link

Jaff commented Jan 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants