Telegraf Input プラグインと OpenTelemetry によりサービスを監視 🔗
Splunk Observability Cloud でネイティブ OpenTelemetry を使用して Telegraf でサービスを監視するには、サービスの Telegraf Input プラグインをインストールし、OTLP経由で Splunk Opentelemetry Collector にメトリクスをプッシュします。
注釈
このセットアップは Linux Ubuntu OS 用に設計されていますが、Debian フレーバーの Linux OS を実行しているマシンであれば再現できるはずです。これらの手順は、他のOS(MacOS/Windows)では動作しない可能性があります。
メリット 🔗
インテグレーションを設定すると、これらの機能にアクセスできるようになります:
メトリクスを表示します。独自のカスタム・ダッシュボードを作成することができ、ほとんどのモニターは組み込みのダッシュボードも提供しています。ダッシュボードについては、Splunk Observability Cloudでダッシュボードを表示する を参照してください。
Infrastructure Monitoring に表示される環境内の物理サーバー、仮想マシン、AWS インスタンス、およびその他のリソースのデータ駆動型の視覚化を表示します。ナビゲーターについては、Splunk Infrastructure Monitoring でナビゲーターを使用する を参照してください。
Metric Finder にアクセスして、モニターから送信されたメトリクスを検索します。詳細については、Search the Metric Finder and Metadata Catalog を参照してください。
設定 🔗
Follow these steps to scrape Telegraf metrics with the OTel Collector:
Install Telegraf
サービスの Telegraf Input プラグインをセットアップする
Set up the Telegraf OpenTelemetry Output plugin
Configure the OpenTelemetry Collector
5. Install Telegraf 🔗
Run the following commands to install Telegraf from the InfluxData repository:
curl --silent --location -O \ https://repos.influxdata.com/influxdata-archive.key \ && echo "943666881a1b8d9b849b74caebf02d3465d6beb716510d86a39f6c8e8dac7515 influxdata-archive.key" \
| sha256sum -c - && cat influxdata-archive.key \
| gpg --dearmor \
| sudo tee /etc/apt/trusted.gpg.d/influxdata-archive.gpg > /dev/null \
&& echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' \
| sudo tee /etc/apt/sources.list.d/influxdata.list
sudo apt-get update && sudo apt-get install telegraf
2. サービスの Telegraf Input プラグインをセットアップする 🔗
次に、監視したいサービスの Telegraf Input プラグインをインストールします。利用可能なプラグインには、Chrony、Consul、Docker、Elasticsearch、Fluentd、GitHub、Jenkins、RabbitMQ、SQL があります。利用可能なプラグインの完全なリストは、GitHub の Telegraf Input plugins にあります。
例えば、Exec Input プラグインで実行コマンドをインターバルごとに監視し、その出力からメトリクスを解析したい場合は、次のようなセットアップを使用します:
# Read metrics from one or more commands that can output to stdout
[[inputs.exec]]
## Commands array
commands = ["sh /testfolder/testscript.sh"]
timeout = "30s"
data_format = "influx"
## Environment variables
## Array of "key=value" pairs to pass as environment variables
## e.g. "KEY=value", "USERNAME=John Doe",
## "LD_LIBRARY_PATH=/opt/custom/lib64:/usr/local/libs"
# environment = []
## Measurement name suffix
## Used for separating different commands
# name_suffix = ""
## Ignore Error Code
## If set to true, a non-zero error code in not considered an error and the
## plugin will continue to parse the output.
# ignore_error = false
3. Set up the Telegraf OpenTelemetry Output plugin 🔗
Next, add the OTel Output plugin to your Telegraf configuration file:
# Send OpenTelemetry metrics over gRPC
[[outputs.opentelemetry]]
設定ファイルは通常、./etc/telegraf/telegraf.d ディレクトリにあります。
For detailed information see Telegraf’s OpenTelemetry Output plugin documentation in GitHub.
4. Configure the OpenTelemetry Collector 🔗
以下の設定を OTel Collector に追加して、Telegraf インストールからメトリクスを取得します:
receivers:
otlp:
protocols:
http:
grpc:
signalfx:
exporters:
signalfx:
access_token: "SPLUNK_TOKEN"
realm: "us0"
service:
pipelines:
metrics:
receivers: [otlp]
exporters: [signalfx]
metrics/internal:
receivers: [signalfx]
processors:
exporters: [signalfx]
トラブルシューティング 🔗
Splunk Observability Cloudをご利用のお客様で、Splunk Observability Cloudでデータを確認できない場合は、以下の方法でサポートを受けることができます。
Splunk Observability Cloudをご利用のお客様
Submit a case in the Splunk Support Portal .
Contact Splunk Support .
見込み客および無料トライアルユーザー様
Splunk Answers のコミュニティサポートで質問し、回答を得る
Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.