テレメトリーデータの受信


Red Hat build of OpenTelemetry 3.8

インストルメント化されたアプリケーションの接続とマルチクラスターテレメトリーコレクションの設定

Red Hat OpenShift Documentation Team

概要

このドキュメントでは、OpenTelemetry Collector を設定して、インストルメント化されたアプリケーションから Telemetry データを受信する方法について説明します。エッジクラスターに Collector をデプロイし、データを中央の Collector インスタンスに転送することで、マルチクラスターテレメトリーコレクションをセットアップする方法を説明します。cert-manager を使用した証明書管理、安全な通信、サービスアカウントおよび RBAC 設定、およびトレースストレージ用の TempoStack との統合手順が含まれます。

第1章 テレメトリーデータの受信

OpenTelemetry Collector をセットアップし、アプリケーションを計装した後、OpenTelemetry Collector が計装されたアプリケーションからテレメトリーデータを受信できるように、計装と OpenTelemetry Collector を接続する必要があります。

1.1. 複数のクラスターからテレメトリーデータを受信する

Collector が複数のリモートクラスターからテレメトリーデータを受信する必要がある場合は、各リモートクラスターに 1 つの OpenTelemetry Collector インスタンスを作成し、そのすべてのテレメトリーデータを中央の OpenTelemetry Collector インスタンスに転送します。

前提条件

  • Red Hat build of OpenTelemetry Operator がインストールされている。
  • Tempo Operator がインストールされている。
  • TempoStack インスタンスがクラスターにデプロイされている。
  • 証明書 (Issuer、自己署名証明書、CA issuer、クライアントとサーバーの証明書) がマウントされている。これらの証明書のいずれかを作成するには、手順 1 を参照してください。

手順

  1. OpenTelemetry Collector インスタンスに次の証明書をマウントし、すでにマウントされている証明書を省略します。

    1. Red Hat OpenShift の cert-manager Operator を使用して証明書を生成する Issuer

      apiVersion: cert-manager.io/v1
      kind: Issuer
      metadata:
        name: selfsigned-issuer
      spec:
        selfSigned: {}
      Copy to Clipboard Toggle word wrap
    2. 自己署名証明書

      apiVersion: cert-manager.io/v1
      kind: Certificate
      metadata:
        name: ca
      spec:
        isCA: true
        commonName: ca
        subject:
          organizations:
            - <your_organization_name>
          organizationalUnits:
            - Widgets
        secretName: ca-secret
        privateKey:
          algorithm: ECDSA
          size: 256
        issuerRef:
          name: selfsigned-issuer
          kind: Issuer
          group: cert-manager.io
      Copy to Clipboard Toggle word wrap
    3. CA issuer

      apiVersion: cert-manager.io/v1
      kind: Issuer
      metadata:
        name: test-ca-issuer
      spec:
        ca:
          secretName: ca-secret
      Copy to Clipboard Toggle word wrap
    4. クライアントとサーバーの証明書

      apiVersion: cert-manager.io/v1
      kind: Certificate
      metadata:
        name: server
      spec:
        secretName: server-tls
        isCA: false
        usages:
          - server auth
          - client auth
        dnsNames:
        - "otel.observability.svc.cluster.local" 
      1
      
        issuerRef:
          name: ca-issuer
      ---
      apiVersion: cert-manager.io/v1
      kind: Certificate
      metadata:
        name: client
      spec:
        secretName: client-tls
        isCA: false
        usages:
          - server auth
          - client auth
        dnsNames:
        - "otel.observability.svc.cluster.local" 
      2
      
        issuerRef:
          name: ca-issuer
      Copy to Clipboard Toggle word wrap
      1
      サーバー OpenTelemetry Collector インスタンスのソルバーにマップされる正確な DNS 名のリスト。
      2
      クライアント OpenTelemetry Collector インスタンスのソルバーにマップされる正確な DNS 名のリスト。
  2. OpenTelemetry Collector インスタンスのサービスアカウントを作成します。

    ServiceAccount の例

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: otel-collector-deployment
    Copy to Clipboard Toggle word wrap

  3. サービスアカウントのクラスターロールを作成します。

    ClusterRole の例

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: otel-collector
    rules:
      
    1
    
      
    2
    
    - apiGroups: ["", "config.openshift.io"]
      resources: ["pods", "namespaces", "infrastructures", "infrastructures/status"]
      verbs: ["get", "watch", "list"]
    Copy to Clipboard Toggle word wrap

    1
    k8sattributesprocessor には、Pod と namespace リソースに対する権限が必要です。
    2
    resourcedetectionprocessor には、インフラストラクチャーとステータスに対する権限が必要です。
  4. クラスターロールをサービスアカウントにバインドします。

    ClusterRoleBinding の例

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: otel-collector
    subjects:
    - kind: ServiceAccount
      name: otel-collector-deployment
      namespace: otel-collector-<example>
    roleRef:
      kind: ClusterRole
      name: otel-collector
      apiGroup: rbac.authorization.k8s.io
    Copy to Clipboard Toggle word wrap

  5. YAML ファイルを作成して、エッジクラスターで OpenTelemetryCollector カスタムリソース (CR) を定義します。

    エッジクラスター用の OpenTelemetryCollector カスタムリソースの例

    apiVersion: opentelemetry.io/v1beta1
    kind: OpenTelemetryCollector
    metadata:
      name: otel
      namespace: otel-collector-<example>
    spec:
      mode: daemonset
      serviceAccount: otel-collector-deployment
      config:
        receivers:
          jaeger:
            protocols:
              grpc: {}
              thrift_binary: {}
              thrift_compact: {}
              thrift_http: {}
          opencensus:
          otlp:
            protocols:
              grpc: {}
              http: {}
          zipkin: {}
        processors:
          batch: {}
          k8sattributes: {}
          memory_limiter:
            check_interval: 1s
            limit_percentage: 50
            spike_limit_percentage: 30
          resourcedetection:
            detectors: [openshift]
        exporters:
          otlphttp:
            endpoint: https://observability-cluster.com:443 
    1
    
            tls:
              insecure: false
              cert_file: /certs/server.crt
              key_file: /certs/server.key
              ca_file: /certs/ca.crt
        service:
          pipelines:
            traces:
              receivers: [jaeger, opencensus, otlp, zipkin]
              processors: [memory_limiter, k8sattributes, resourcedetection, batch]
              exporters: [otlp]
      volumes:
        - name: otel-certs
          secret:
            name: otel-certs
      volumeMounts:
        - name: otel-certs
          mountPath: /certs
    Copy to Clipboard Toggle word wrap

    1
    Collector エクスポーターは、OTLP HTTP をエクスポートするように設定されており、中央クラスターから OpenTelemetry Collector を指します。
  6. YAML ファイルを作成して、中央クラスターに OpenTelemetryCollector カスタムリソース (CR) を定義します。

    中央クラスターの OpenTelemetryCollector カスタムリソースの例

    apiVersion: opentelemetry.io/v1beta1
    kind: OpenTelemetryCollector
    metadata:
      name: otlp-receiver
      namespace: observability
    spec:
      mode: "deployment"
      ingress:
        type: route
        route:
          termination: "passthrough"
      config:
        receivers:
          otlp:
            protocols:
              http:
                tls: 
    1
    
                  cert_file: /certs/server.crt
                  key_file: /certs/server.key
                  client_ca_file: /certs/ca.crt
        exporters:
          otlp:
            endpoint: "tempo-<simplest>-distributor:4317" 
    2
    
            tls:
              insecure: true
        service:
          pipelines:
            traces:
              receivers: [otlp]
              processors: []
              exporters: [otlp]
      volumes:
        - name: otel-certs
          secret:
            name: otel-certs
      volumeMounts:
        - name: otel-certs
          mountPath: /certs
    Copy to Clipboard Toggle word wrap

    1
    Collector レシーバーには、最初の手順にリストされている証明書が必要です。
    2
    Collector エクスポーターは、OTLP をエクスポートするように設定され、Tempo ディストリビュータエンドポイントを指します。この例では、これは "tempo-simplest-distributor:4317" で、すでに作成されています。

法律上の通知

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る