AWS Athena Datasource


grafana/athena-datasource

記事:


日付と時刻

例: 前月を指定: dateがstring型


時系列のログからグラフを作る

時系列のログから、グラフを作りたい場合:


mtanda/grafana-aws-athena-datasource

更新されてないので、grafana公式のathena pluginの方がオススメ


Cache Durationの指定

問題:


Time Formatの指定


Timestamp Columnの指定

ELB logの場合: timestampカラムがiso-8601形式


トラブルシューティング


実行時間が長いqueryがNo dataと表示される

現象:

解決:

その他:


「AccessDenied (Service: Amazon S3; ...)」で失敗する場合

S3のどのAPIが失敗したのか表示されないため、getなのかputなのかの区別が付かず、原因解決が難しい


Table Panelで一覧表示されない

athena-legend.png


Datasourceの説明を見る

athena-datasource-help.png


Query String: GrafanaからSQLを実行


クロスアカウントの場合のs3 bucket policy


インストール

Athenaの仕組みを理解している必要がある。

grafana-aws-athena-datasourceのバージョン:

  1. https://github.com/mtanda/grafana-aws-athena-datasource/releases からzipのurlをコピー
    sudo grafana-cli --pluginUrl https://github.com/mtanda/grafana-aws-athena-datasource/releases/download/2.2.7/grafana-aws-athena-datasource-2.2.7.zip plugins install mtanda-aws-athena-datasource
    
    # CentOS 7の場合: /var/lib/grafana/plugins/ に展開された。
  2. Grafana v7.xでは unsignedなpluginがloadされないため、allow_loading_unsigned_plugins に許可するpluginをカンマ区切りで入力する
    sudo vim /etc/grafana/grafana.ini
    --
    [plugins]
    allow_loading_unsigned_plugins =  mtanda-aws-athena-datasource
    --
    sudo service grafana-server restart
  3. Grafana > Configration > Data Souces > Add Data Sourceから追加。Test&Saveでエラーが出なければOK
    • Name: Athena(account + region ?)
    • Auth Provider: Access & SecretKey
    • Access Key ID: (athenaと同アカウント、同リージョンのec2のinstance profileの場合は空)
    • Secret Access Key: (athenaと同アカウント、同リージョンのec2のinstance profileの場合は空)
    • Default Region: ap-northeast-1
    • Output Location: s3:///aws-athena-query-results-123456789012-ap-northeast-1/output/grafana/
    • Save&Test

添付ファイル: fileathena-legend.png 522件 [詳細] fileathena-datasource-help.png 519件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-08-24 (水) 18:26:48