Grafana 대시보드를 pdf 형식으로 추출 하여 구글 드라이브에 자동으로 업로드하는 방법에 대해 설명하려고 합니다.
그중 첫번째 포스팅에서는 Grafana 대시보드를 추출하는 방법에 대해서 작성하였습니다.
설치 전 필요사항
#pdf 파일을 위한 패키지 설치
sudo apt-get install texlive-full
#grafana-reporter 설치
go get github.com/IzakMarais/reporter/...
go install -v github.com/IzakMarais/reporter/cmd/grafana-reporterGrafana apikey 생성

특정 대시보드를 pdf로 추출
./grafana-reporter -grid-layout=1 -cmd_enable=1  -cmd_o -cmd_dashboard <dashboardUID> -cmd_apiKey <apikey>grafana-reporter 참고 옵션
grafana-reporter --help
-cmd_apiKey string
      Grafana api key. Required (and only used) in command line mode.
-cmd_apiVersion string
      Api version: [v4, v5]. Required (and only used) in command line mode, example: -apiVersion v5. (default "v5")
-cmd_dashboard string
      Dashboard identifier. Required (and only used) in command line mode.
-cmd_enable
      Enable command line mode. Generate report from command line without starting webserver (-cmd_enable=1).
-cmd_o string
      Output file. Required (and only used) in command line mode. (default "out.pdf")
-cmd_template string
      Specify a custom TeX template file. Only used in command line mode, but is optional even there.
-cmd_ts string
      Time span. Required (and only used) in command line mode. (default "from=now-3h&to=now")
-grid-layout
      Enable grid layout (-grid-layout=1). Panel width and height will be calculated based off Grafana gridPos width and height.
-ip string
      Grafana IP and port. (default "localhost:3000")
-port string
      Port to serve on. (default ":8686")
-proto string
      Grafana Protocol. Change to 'https://' if Grafana is using https. Reporter will still serve http. (default "http://")
-ssl-check
      Check the SSL issuer and validity. Set this to false if your Grafana serves https using an unverified, self-signed certificate. (default true)
-templates string
      Directory for custom TeX templates. (default "templates/")구글 드라이브 업로드를 위한 자격증명 생성은 다름 포스팅에서 이어서..
참고 사이트