PostgreSQLレシーバー

PostgreSQL レシーバーを使用すると、Splunk Distribution of OpenTelemetry Collector の統計コレクタを通じて PostgreSQL からメトリクスを収集できます。

PostgreSQL レシーバーを使用すると、Splunk Distribution of OpenTelemetry Collector は PostgreSQL の統計コレクタを使用して PostgreSQL からメトリクスを収集できます。サポートされているパイプラインのタイプは metrics です。詳細については「パイプラインでデータを処理する」を参照してください。

注: SignalFx Smart Agent postgresql モニタータイプの代わりに PostgreSQL レシーバーを使用します。

要件

このレシーバーは PostgreSQL バージョン 9.6 以降をサポートしています。

レシーバーにデータを収集させるには、監視ユーザーに pg_stat_databaseSELECT 権限を与えます。詳細については 、「PostgreSQL statistics collector」の公式ドキュメントを参照してください。

はじめに

以下の手順に従って、コンポーネントの設定とアクティベーションを行ってください:

  1. Splunk Distribution of the OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:

  2. 次のセクションで説明するように、PostgreSQL レシーバーを設定します。

  3. Collector を再起動します。

サンプル構成

PostgreSQLレシーバーを有効にするには、以下の例のように、設定ファイルの receivers セクションにpostgresql を追加します:

YAML
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

usernamepassword のフィールドは必須です。デフォルトでは、レシーバーは localhost:5432 で PostgreSQL サーバーを検索します。endpoint フィールドの値を編集して、アドレスをカスタマイズできます。

設定を完了するには、構成ファイルの service セクションの metrics パイプラインにレシーバーを含めます。例:

YAML
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 フィールドを設定することで、特定のメトリクスをアクティブまたは非アクティブにできます。例:

YAML
receivers:
  samplereceiver:
    metrics:
      metric-one:
        enabled: true
      metric-two:
        enabled: false

以下は、アクティブ化されたメトリクスを持つホスト・メトリクス・レシーバーの構成例です:

YAML
receivers:
  hostmetrics:
    scrapers:
      process:
        metrics:
          process.cpu.utilization:
            enabled: true
注: 非アクティブ化されたメトリックは Splunk Observability Cloud に送信されません。
請求
  • 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

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.