Docs » Splunk Distribution of the OpenTelemetry Collector の利用開始 » Collector コンポーネント » Collectorコンポーネント: エクステンション » Basicauth 拡張

Basicauth 拡張 🔗

The basicauth extension implements both configauth.ServerAuthenticator and configauth.ClientAuthenticator to authenticate clients and servers using basic authentication. The authenticator type has to be set to basicauth.

サーバーの認証に使用すると、認証が成功した場合、client.Info.Auth 、以下の属性が公開されます:

  • username:認証されたユーザーのユーザー名。

  • raw:Base64エンコードされた生の認証情報。

注意

この拡張機能では、サーバーまたはクライアントのどちらかを認証できます。両方のオプションを設定すると、拡張モジュールはエラーをスローします。詳しくは 設定 を参照してください。

はじめに 🔗

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

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

  1. 次のセクションで説明するように、basicauth エクステンションを設定します。

  2. Collector を再起動します。

サンプル構成 🔗

リソースプロセッサーを有効にするには、次の例のように、設定ファイルの extensions セクションに basicauth を追加します:

extensions:
  basicauth/server:
    htpasswd:
      file: .htpasswd
      inline: |
        ${env:BASIC_AUTH_USERNAME}:${env:BASIC_AUTH_PASSWORD}

  basicauth/client:
    client_auth:
      username: username
      password: password

receivers:
  otlp:
    protocols:
      http:
        auth:
          authenticator: basicauth/server

processors:

exporters:
  otlp:
    auth:
      authenticator: basicauth/client

コンフィギュレーションを完了するには、コンフィギュレーションファイルの service セクションの任意のパイプラインに拡張子を含めます。例:

service:
  extensions: [basicauth/server, basicauth/client]
  pipelines:
    traces:
      receivers: [otlp]
      processors: []
      exporters: [otlp]

設定例:シンプルなPrometheusレシーバー 🔗

次の例は、シンプルなPrometheusレシーバーbasicauth 拡張を設定する方法を示しています:

receivers:
  lightprometheus/myjob:
    auth:
      authenticator: basicauth
    collection_interval: 1s
    endpoint: "http://localhost:8000/metrics"

exporters:
  otlp:
    endpoint: "${OTLP_ENDPOINT}"
    tls:
      insecure: true

extensions:
  basicauth:
    client_auth:
      username: foo
      password: bar

service:
  extensions: [ basicauth ]
  pipelines:
    metrics:
      receivers: [ lightprometheus/myjob ]
      exporters: [ otlp ]

設定 🔗

次の表は、basicauth エクステンションの設定オプションを示しています:

サーバーまたはクライアントの認証 🔗

この拡張機能では、サーバーまたはクライアントのどちらかを認証できます。両方のオプションを設定すると、拡張モジュールはエラーをスローします。

  • 拡張機能をサーバー認証機能として設定するには、htpasswd.file または htpasswd.inline のいずれかを設定します。両方を設定した場合は、 htpasswd.inline の認証情報が優先されます。

  • 拡張機能をクライアント認証機能として設定するには、client_auth を設定します。

トラブルシューティング 🔗

Splunk Observability Cloudをご利用のお客様で、Splunk Observability Cloudでデータを確認できない場合は、以下の方法でサポートを受けることができます。

Splunk Observability Cloudをご利用のお客様

見込み客および無料トライアルユーザー様

  • Splunk Answers のコミュニティサポートで質問し、回答を得る

  • Splunk #observability ユーザーグループの Slack チャンネルに参加して、世界中の顧客、パートナー、Splunk 社員とのコミュニケーションを図る。参加するには、Get Started with Splunk Community マニュアルの チャットグループ を参照してください。

This page was last updated on 2024年05月29日.