mahendrapaipuri/grafana-dashboard-reporter-app

grafana-dashboard-reporter-app isn't reading the provisioned configs

Klaudd9 opened this issue · 5 comments

Hi, I have already added the reporter.yaml along with the needed configurations in the following directories:

/etc/grafana/provisions/plugins/reporter.yaml
/usr/share/grafana/conf/provisioning/plugins/reporter.yaml

However, I receive the following logs when making requests:

logger=plugin.mahendrapaipuri-dashboardreporter-app t=2024-05-23T16:33:07.858629867+08:00 level=info msg="provisioned config" endpoint=callResource pluginID=mahendrapaipuri-dashboardreporter-app config="Grafana App URL: ; Skip TLS Check: false; Grafana Data Path: /var/lib/grafana; Orientation: portrait; Layout: grid; Dashboard Mode: full; Time Zone: ; Encoded Logo: ; Max Renderer Workers: 2; Persist Data: false; Included Panel IDs: all; Excluded Panel IDs: none"
logger=context userId=7 orgId=2 uname=sa-grafana-reporter-api t=2024-05-23T16:33:07.858726445+08:00 level=error msg="Failed to call resource" error="failed to receive call resource response: rpc error: code = Unknown desc = grafana app URL not found. Please set it in provisioned config" traceID=
logger=context userId=7 orgId=2 uname=sa-grafana-reporter-api t=2024-05-23T16:33:07.858769016+08:00 level=error msg="Request Completed" method=GET path=/api/plugins/mahendrapaipuri-dashboardreporter-app/resources/report status=500 remote_addr=172.16.3.21 time_ms=17 duration=17.178919ms size=51 referer= handler=/api/plugins/:pluginId/resources/*

It seems like the plugin isn't reading the provision configs, such as appUrl and skipTlsCheck. May I request assistance with this? Thanks a lot!

Hello,

Where is your grafana.ini located? Could you share your paths configuration of Grfana?

If you are using default locations, you should provision the plugin by adding config file at /etc/grafana/provisioning/plugins/reporter.yml. Its not provisions, it is provisioning.

It is located at /etc/grafana/grafana.ini, and I haven't changed the paths in the Grafana configuration file, so everything is on default.

I have added the reporter.yaml file at that exact location. Apologies for the typo.

Ok, thanks for the info!

Could you please share your reporter.yaml file? When you first installed the plugin, is it enabled by default? Could you try again by restarting Grafana instance?

It wasn't enabled by default when I installed it. I've tried restarting the Grafana server each time I modify the reporter.yaml file, but unfortunately, it hasn't resolved the issue.

Here's the reporter.yaml:

apiVersion: 1

apps:
  - type: mahendrapaipuri-dashboardreporter-app
    org_id: 1
    org_name: Main Org.
    disabled: false
    
    secureJsonData:
      # If operators want to generate reports programatically using API requests with 
      # clients like, say `curl`, using service account tokens it is necessary to configure
      # that **same** service account token in the plugin's config.
      #
      # Grafana will use this token to make API requests to Grafana
      # to fetch dashboards and panels. The token must have appropriate permissions
      # and roles to be able to generate reports.
      #
      # This token can be configured from the Grafana UI as well.
      #
      # In Grafana >= 10.3.0, by enabling `externalServiceAccounts` feature flag, this
      # provisioning of the service account token is done automatically and there is
      # no need to set the token in the config
      saToken: ''

    jsonData:
      # appUrl is at which Grafana can be accessible. The plugin will make API requests
      # to Grafana to get individual panel in each dashboard to generate reports. These API
      # requests will be made to this URL. For most of the deployments the default value 
      # will work. 
      # 
      # If the Grafana is configured to use cookie_samesite "strict", the default localhost:3000
      # will not work as the plugin will forward cookie in the API requests and "strict" policy
      # will not make cookie set on URL Grafana is exposed (eg mygrafana.example.com) on 
      # localhost:3000. In this case, please use appUrl as `mygrafana.example.com`
      # 
      # The app URL set in GF_APP_URL env variable will always have the highest precedence
      # and will override the value set here
      #
      appUrl: https://localhost:3000

      # If Grafana is using HTTPS with self signed certificates, set this parameter to true
      # to skip TLS certificate verification
      #
      skipTlsCheck: true

      # Orientation of the report. Possible values are portrait and landscape
      #
      # This can be changed from Grafana UI as well and this configuration parameter
      # applies globally to all generated reports
      #
      # This setting can be overridden for a particular dashboard by using query parameter
      # ?orientation=portrait or ?orientation=landscape during report generation process
      #
      orientation: landscape

      # Layout of the report. Possible values are simple and grid
      #
      # This can be changed from Grafana UI as well and this configuration parameter
      # applies globally to all generated reports
      #
      # This setting can be overridden for a particular dashboard by using query parameter
      # ?layout=simple or ?layout=grid during report generation process
      #
      layout: simple

      # Dashboard mode in the report. Possible values are default and full. In default
      # mode collapsed rows will be ignored in the report and only Panels visible in 
      # dashboard by default will be rendered in the report. In the full mode, all the
      # rows will be expanded and all the panels in the dashboard will be included in
      # the report.
      #
      # This can be changed from Grafana UI as well and this configuration parameter
      # applies globally to all generated reports
      #
      # This setting can be overridden for a particular dashboard by using query parameter
      # ?dashboardMode=default or ?dashboardMode=full during report generation process
      #
      dashboardMode: default

      # Time zone to use the report. This should be provided in IANA format.
      # More details on IANA format can be obtained from https://www.iana.org/time-zones
      # Eg America/New_York, Asia/Singapore, Australia/Melbourne, Europe/Berlin
      #
      # If empty or an invalid format is provided, the plugin defaults to using local
      # location of the Grafana server.
      #
      # This setting can be overridden for a particular dashboard by using query parameter
      # ?timeZone=America%2FNew_York during report generation process. Note that we 
      # need to escape URL characters
      #
      timeZone: ''

      # Branding logo in the report.
      #
      # A base64 encoded of the logo can be set which will be included in the footer
      # of the report in each page.
      #
      logo: ''

      # Maximum number of workers for generating panel PNGs.
      #
      # This can be changed from Grafana UI as well and this configuration parameter
      # applies globally to all generated reports
      #
      maxRenderWorkers: 2

      # Persist PNG files, generated HTML files and PDF for debugging. These files can
      # be found at $GF_PATHS_DATA/reports/debug folder
      #
      # This can be changed from Grafana UI as well and this configuration parameter
      # applies globally to all generated reports
      #
      persistData: false

Thanks for the config. This is strange. Could you check the permissions on the /etc/grafana/provisioning folder and config file that the user that is running Grfana service can read the config file?

If you can share all the Grafana logs after restarting the Grafana instance, maybe that can give us some clues. If possible in debug mode.