LoginSignup
0
0

More than 1 year has passed since last update.

「Amazon TimestreamのデータをGrafanaで可視化してみた | DevelopersIO」をやってみた

Last updated at Posted at 2021-06-07

はじめに

Amazon TimestreamのデータをGrafanaで可視化してみた | DevelopersIOをやってみたときのメモです。

手順

  1. Grafana公式リポジトリからソースコードを取得します。

    実際に使用するのは、Dockerfileの1ファイルのみです。

    mkdir grafana
    cd grafana
    wget https://raw.githubusercontent.com/grafana/grafana/main/packaging/docker/custom/Dockerfile
    
  2. Dockerイメージをビルドします。

    docker build \
      --build-arg "GRAFANA_VERSION=latest" \
      --build-arg "GF_INSTALL_PLUGINS=grafana-timestream-datasource" \
      -t grafana-custom -f Dockerfile .
    
  3. Dockerコンテナを起動します。

    docker run -d -p 3000:3000 --name=grafana grafana-custom
    
  4. ブラウザでhttp://localhost:3000にアクセスします。

  5. admin/adminでログインします。

  6. Grafanaの画面で、Configuration > Data Sources > Add data source で Amazon Timestreamを選択します。

  7. AWSのアクセスキーとシークレットアクセスキーを入力します。

  8. us-east-1リージョンを選択します。

    Timestreamは、現時点では、東京リージョンでGAされていません。

  9. 次のコマンドでエンドポイントを取得します。

    https://を補います

    aws timestream-query describe-endpoints \
        --region us-east-1 --profile HOGEHOGE \
        | jq -r '.Endpoints[].Address'
    
  10. Query Editorに次のクエリーを入力します。

    SELECT
        measure_name,
        measure_value::double AS load,
        time
    FROM
        "sampledb".IoT
    WHERE
        measure_name = 'load'
    ORDER BY time
    
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0