第7章 テレメトリーデータの転送


テレメトリーデータは、OpenTelemetry Collector を使用して転送できます。

7.1. トレースを TempoStack インスタンスに転送する

TempoStack インスタンスへのトレースの転送を設定するには、OpenTelemetry Collector をデプロイして設定します。指定されたプロセッサー、レシーバー、エクスポーターを使用して、OpenTelemetry Collector をデプロイメントモードでデプロイできます。その他のモードについては、関連情報 に記載されたリンクを使用して、OpenTelemetry Collector ドキュメントを参照してください。

前提条件

  • Red Hat build of OpenTelemetry Operator がインストールされている。
  • Tempo Operator がインストールされている。
  • TempoStack インスタンスがクラスターにデプロイされている。

手順

  1. OpenTelemetry Collector のサービスアカウントを作成します。

    ServiceAccount の例

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: otel-collector-deployment
    Copy to clipboard

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

    ClusterRole の例

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

    1
    この例では、pods および namespaces リソースに対するこれらの権限を必要とする Kubernetes Attributes Processor を使用します。
    2
    また、Kubernetes Attributes Processor を使用するため、replicasets リソースに対するこれらの権限も必要です。
    3
    この例では、infrastructures および status リソースに対するこれらの権限を必要とする Resource Detection Processor も使用します。
  3. クラスターロールをサービスアカウントにバインドします。

    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

  4. YAML ファイルを作成して、OpenTelemetryCollector カスタムリソース (CR) を定義します。

    OpenTelemetryCollector の例

    apiVersion: opentelemetry.io/v1beta1
    kind: OpenTelemetryCollector
    metadata:
      name: otel
    spec:
      mode: deployment
      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:
          otlp:
            endpoint: "tempo-simplest-distributor:4317" 1
            tls:
              insecure: true
        service:
          pipelines:
            traces:
              receivers: [jaeger, opencensus, otlp, zipkin] 2
              processors: [memory_limiter, k8sattributes, resourcedetection, batch]
              exporters: [otlp]
    Copy to clipboard

    1
    Collector エクスポーターは、OTLP をエクスポートするように設定され、作成済みの Tempo ディストリビューターエンドポイント (この例では "tempo-simplest-distributor:4317") を指します。
    2
    Collector は、Jaeger トレース、OpenCensus プロトコル経由の OpenCensus トレース、Zipkin プロトコル経由の Zipkin トレース、および gRPC プロトコル経由の OTLP トレースのレシーバーを使用して設定されます。
ヒント

telemetrygen をテストとしてデプロイできます。

apiVersion: batch/v1
kind: Job
metadata:
  name: telemetrygen
spec:
  template:
    spec:
      containers:
        - name: telemetrygen
          image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest
          args:
            - traces
            - --otlp-endpoint=otel-collector:4317
            - --otlp-insecure
            - --duration=30s
            - --workers=1
      restartPolicy: Never
  backoffLimit: 4
Copy to clipboard

関連情報

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

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

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

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

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

会社概要

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

Theme

© 2025 Red Hat, Inc.