PostgreSQLレシーバー
PostgreSQL レシーバーを使用すると、Splunk Distribution of OpenTelemetry Collector の統計コレクタを通じて PostgreSQL からメトリクスを収集できます。
PostgreSQL レシーバーを使用すると、Splunk Distribution of OpenTelemetry Collector は PostgreSQL の統計コレクタを使用して PostgreSQL からメトリクスを収集できます。サポートされているパイプラインのタイプは metrics です。詳細については「パイプラインでデータを処理する」を参照してください。
postgresql モニタータイプの代わりに PostgreSQL レシーバーを使用します。
要件
このレシーバーは PostgreSQL バージョン 9.6 以降をサポートしています。
レシーバーにデータを収集させるには、監視ユーザーに pg_stat_database の SELECT 権限を与えます。詳細については 、「PostgreSQL statistics collector」の公式ドキュメントを参照してください。
はじめに
以下の手順に従って、コンポーネントの設定とアクティベーションを行ってください:
-
Splunk Distribution of the OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:
-
次のセクションで説明するように、PostgreSQL レシーバーを設定します。
-
Collector を再起動します。
サンプル構成
PostgreSQLレシーバーを有効にするには、以下の例のように、設定ファイルの receivers セクションにpostgresql を追加します:
receivers:
postgresql:
endpoint: localhost:5432
transport: tcp
username: otel
password: ${env:PGSQL_PASSWORD}
databases:
- otel
collection_interval: 10s
tls:
insecure: false
insecure_skip_verify: false
ca_file: /home/otel/authorities.crt
cert_file: /home/otel/mypostgrescert.crt
key_file: /home/otel/mypostgreskey.key
username と password のフィールドは必須です。デフォルトでは、レシーバーは localhost:5432 で PostgreSQL サーバーを検索します。endpoint フィールドの値を編集して、アドレスをカスタマイズできます。
設定を完了するには、構成ファイルの service セクションの metrics パイプラインにレシーバーを含めます。例:
service:
pipelines:
metrics:
receivers: [postgresql]
設定
次の表は、PostgreSQLの設定オプションを示したものです:
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/receiver/postgresql.yaml
メトリクス
以下のメトリクス、リソース属性、および属性が使用できます。
同梱
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/postgresqlreceiver.yaml
特定のメトリクスをアクティブまたは非アクティブにする
各メトリクスの metrics セクションの enabled フィールドを設定することで、特定のメトリクスをアクティブまたは非アクティブにできます。例:
receivers:
samplereceiver:
metrics:
metric-one:
enabled: true
metric-two:
enabled: false
以下は、アクティブ化されたメトリクスを持つホスト・メトリクス・レシーバーの構成例です:
receivers:
hostmetrics:
scrapers:
process:
metrics:
process.cpu.utilization:
enabled: true
-
MTS ベースのサブスクリプションの場合、すべてのメトリックがメトリックの使用にカウントされます。
-
ホストベースのプランを使用している場合、このドキュメントでアクティブ(アクティブ:はい)としてリストされているメトリックはデフォルトと見なされ、無料で含まれています。
詳細については、「Infrastructure Monitoringのサブスクリプション使用状況(ホストとメトリクスのプラン)」を参照してください。
トラブルシューティング
If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.
Available to Splunk Observability Cloud customers
-
Submit a case in the Splunk Support Portal.
-
Contact Splunk Support.
Available to prospective customers and free trial users
-
Ask a question and get answers through community support at Splunk Answers.
-
Join the Splunk community #observability Slack channel to communicate with customers, partners, and Splunk employees worldwide.