akoutmos / prom_ex

An Elixir Prometheus metrics collection library built on top of Telemetry with accompanying Grafana dashboards
MIT License
577 stars 96 forks source link

[BUG] AccessDenied and missing permission `folders:read` #231

Open KoeusIss opened 3 months ago

KoeusIss commented 3 months ago

Describe the bug I'm giving PomEx a try and try to link it to Grafana. since we are a multi application company we have different folder for different app. I followed the Installations steps a longside with the dockyard tutorial. but I'm blocked by a permission issue.

{
  "time": "2024-03-26T12:56:21.491Z",
  "severity": "warn",
  "message": "Received a 403 from Grafana because: %Finch.Response{status: 403, body: \"{\\\"accessErrorId\\\":\\\"*************\\\",\\\"message\\\":\\\"You'll need additional permissions to perform this action. Permissions needed: folders:read\\\",\\\"title\\\":\\\"Access denied\\\"}\\n\", headers: [{\"date\", \"Tue, 26 Mar 2024 11:56:21 GMT\"}, {\"content-type\", \"application/json; charset=UTF-8\"}, {\"content-length\", \"162\"}, {\"connection\", \"keep-alive\"}, {\"cache-control\", \"no-store\"}, {\"strict-transport-security\", \"max-age=86400\"}, {\"x-content-type-options\", \"nosniff\"}, {\"x-frame-options\", \"deny\"}, {\"x-xss-protection\", \"1; mode=block\"}], trailers: []}",
  "metadata": {}
}

Configurations:

# config.exs
config :my_app, MyApp.PromEx,
  disabled: false,
  manual_metrics_start_delay: :no_delay,
  drop_metrics_groups: [],
  grafana: [
    host: "https://my_grafana_host.com",
    upload_dashboards_on_start: true,
    auth_token: "grafana_token_for_the_service_account",
    folder_name: "APP Three dashboard",
    annotate_app_lifecycle: true
  ],
  metrics_server: :disabled

The service account in grafana has the permission to edit the APP Three dashboard folder. Am I missing something here.

Expected behavior **

Environment

Additional context Add any other context about the problem here.