Apache Flink ダッシュボードを使用すると、ログを簡単に追跡し、インストルメンテーション ソースを監視し、すべてのアプリケーション インスタンスのアップタイムとダウンタイムの概要を把握できます。インフラストラクチャ エージェントと Prometheus OpenMetrics の統合、Flink で構築 OpenMetrics エンドポイント スクレイピングを利用して、最も重要なデータをすべて 1 か所で表示できます。
New Relic で Flink を設定すると、すぐにデータがこのようなダッシュボードに表示されます。
インフラストラクチャ エージェントと Prometheus OpenMetrics 統合をインストールする
Flink データを New Relic に取り込む前に、まずインフラストラクチャ エージェントをインストールしてから、Prometheus OpenMetrics をインストールしてメトリクスを公開します。
- ガイド付きインストールに従って、システムにインフラストラクチャ エージェントをインストルメント化します。または、必要に応じて、コマンド ラインからインフラストラクチャ エージェントをインストールできます。
- Prometheus OpenMetrics 統合をインストールします。
Apache Flink 用に Prometheus OpenMetrics を構成する
Prometheus OpenMetrics をインストールしたら、 nri-prometheus-config.yml
ファイルを構成する必要があります。構成ファイルは、 nri-prometheusリポジトリのスニペットと一致する必要があります。
integrations:- name: nri-prometheus config: standalone: false # Defaults to true. When standalone is set to `false`, `nri-prometheus` requires an infrastructure agent to send data. emitters: infra-sdk # When running with infrastructure agent emitters will have to include infra-sdk cluster_name: "YOUR_CLUSTER_NAME_HERE" # Match the name of your cluster with the name seen in New Relic. targets: - description: "YOUR_DESCRIPTION_HERE" urls: ["'job-cluster:9249', 'taskmanager1:9249', 'taskmanager2:9249'"] # tls_config: # ca_file_path: "/etc/etcd/etcd-client-ca.crt" # cert_file_path: "/etc/etcd/etcd-client.crt" # key_file_path: "/etc/etcd/etcd-client.key" verbose: false # Defaults to false. This determines whether or not the integration should run in verbose mode. audit: false # Defaults to false and does not include verbose mode. Audit mode logs the uncompressed data sent to New Relic and can lead to a high log volume. # scrape_timeout: "YOUR_TIMEOUT_DURATION" # `scrape_timeout` is not a mandatory configuration and defaults to 30s. The HTTP client timeout when fetching data from endpoints. scrape_duration: "5s" # worker_threads: 4 # `worker_threads` is not a mandatory configuration and defaults to `4` for clusters with more than 400 endpoints. Slowly increase the worker thread until scrape time falls between the desired `scrape_duration`. Note: Increasing this value too much results in huge memory consumption if too many metrics are scraped at once. insecure_skip_verify: false # Defaults to false. Determins if the integration should skip TLS verification or not.timeout: 10s
ログ転送を手動で設定する
インフラストラクチャ エージェントは Flink ダッシュボードにログを送信する必要がありますが、ログ転送を手動で設定する必要がある場合があります。これをする:
logging.yml
ファイルに移動します。- 次のスニペットをファイルの任意の場所に追加します。
- name: flink-log file: /home/flink-virtualbox/flink/build-target/log/flink_taskmanager.log attributes: logtype: flink-logs
Apache Flink メトリクスをダッシュボードとして取得する
Apache Flink クイックスタートをインストールすると、重要な Apache Flink データを New Relic で確認できます。New Relic でダッシュボードを見つけるには: one.newrelic.com > Dashboardsに移動し、 Apache Flinkを選択します。データをクエリできるようになりました。例えば:
FROM Metric SELECT sum(flink_jobmanager_job_totalNumberOfCheckpoints) AS 'Total Number of Checkpoints'
次は何ですか?
Apache Flink ダッシュボードをさらにカスタマイズしたい場合は、NRQL クエリの作成と管理について詳しく学ぶことができます。 New Relic UI で:
- 基本的なクエリと高度なクエリを作成するためのクエリ ビルダーの概要。
- ダッシュボードをカスタマイズしてさまざまなアクションを実行するためのダッシュボードの概要。
- ダッシュボードを管理して、ダッシュボードの表示モードを調整したり、ダッシュボードにコンテンツを追加したりします。