Un-authenticated user unable to access web-API

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 9.4.0-de (docker image) with prometheus-exporter plugin
  • what are you trying to achieve
    We wish to capture application metrics for observability. Initial success using Prometheus plugin for collecting projects metrics, so attempted to expand to additional metrics
  • what have you tried so far to achieve this
    Using the same credentials as for the plugin was not successful (403 error.) Tried using from command-line using a new token with same result. Tried using a token from Admin user, with success (200 status, full API response.) Tried creating a new (local) user and generated a token, but this also failed (401 error.) New user not able to login, since it is not in LDAP. The endpoints failing are:
    …/api/monitoring/metrics
    …/api/projects/license_usage

Hey Mark.

Both these endpoints require authentication, and specifically require global Administer permissions on the instance.

So this solution

Is probably the way to go.

Please note there are several ways of authenticating to GET api/monitoring/metrics

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.