Authenticator - ベアラー拡張機能

configauth.ServerAuthenticatorconfigauth.ClientAuthenticator の両方を実装します。http と gRPC の両方のエクスポータで auth 設定内で使用して、RPC コールのたびに静的トークンを埋め込むことができます。

bearertokenauth 拡張は、configauth.ServerAuthenticatorconfigauth.ClientAuthenticator の両方を実装します。http と gRPC の両方のエクスポータで auth 設定内で使用して、RPC コールのたびに静的トークンを埋め込むことができます。

以下が必要です:

  • 認証タイプをbearertokenauthに設定する必要があります。

  • エクスポーターでトランスポートレイヤーセキュリティを有効にする必要があります。

はじめに

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

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

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

  3. Collector を再起動します。

設定オプション

以下の設定オプションが利用可能です:

  • filenameします。各クライアントコールで送信される認証トークンを含むファイル名。

  • tokenします。gRPC クライアントコールごとにメタデータとして送信される静的認証トークン。このトークンの値は、送信時にリクエストヘッダー(HTTP の場合)やメタデータ(gRPC の場合)の認証キーの値として使用される前に、先頭に ${scheme} が付加されます。

注: filename または token のいずれかが必要です。両方が指定されている場合、tokenフィールドの値は無視されます。

オプションで、次を設定することもできます。

  • scheme。デフォルトでは Bearer です。認証スキーム名を指定します。

サンプル構成

コンポーネントを有効にするには、設定ファイルの extensions セクションに bearertokenauth を追加し、service セクションの任意のパイプラインに拡張子を含めます。例:

extensions:
  bearertokenauth:
    token: "somerandomtoken"
    filename: "file-containing.token"
  bearertokenauth/withscheme:
    scheme: "Bearer"
    token: "randomtoken"

receivers:
  hostmetrics:
    scrapers:
      memory:
  otlp:
    protocols:
      grpc:

exporters:
  otlp/withauth:
    endpoint: 0.0.0.0:5000
    ca_file: /tmp/certs/ca.pem
    auth:
      authenticator: bearertokenauth

  otlphttp/withauth:
    endpoint: http://localhost:9000
    auth:
      authenticator: bearertokenauth/withscheme

service:
  extensions: [bearertokenauth, bearertokenauth/withscheme]
  pipelines:
    metrics:
      receivers: [hostmetrics]
      processors: []
      exporters: [otlp/withauth, otlphttp/withauth]

設定

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

トラブルシューティング

__ ___ ___ _ ______ _____________ _____ ________ ___ ___ ___ ____ __ ___ ____ ____ __ ______ _____________ ______ ___ ___ ___ ____ __ ___ _________ _____

_________ __ ______ _____________ _____ _________

_________ __ ___________ _________ ___ ____ _____ _____

  • ___ _ ________ ___ ___ _______ _______ _________ _______ __ ______ ________

  • ____ ___ ______ ______________ ____ _____ _____ _______ __ ___________ ____ __________ _________ ___ ______ _________ __________ __ _____ ___ ____ _______