검색

5장. Red Hat build of OpenTelemetry 사용

download PDF

OpenTelemetry의 Red Hat 빌드를 설정하고 사용하여 OpenTelemetry 수집기 또는 TempoStack에 추적을 보낼 수 있습니다.

5.1. OpenTelemetry 수집기를 사용하여 TempoStack으로 추적 전달

TempoStack으로 전달 추적을 구성하려면 OpenTelemetry 수집기를 배포하고 구성할 수 있습니다. 지정된 프로세서, 수신자 및 내보내기를 사용하여 배포 모드에서 OpenTelemetry 수집기를 배포할 수 있습니다. 다른 모드는 추가 리소스에 연결된 OpenTelemetry 수집기 설명서를 참조하십시오.

사전 요구 사항

  • Red Hat build of OpenTelemetry Operator가 설치되어 있습니다.
  • Tempo Operator가 설치되어 있습니다.
  • TempoStack은 클러스터에 배포됩니다.

프로세스

  1. OpenTelemetry 수집기의 서비스 계정을 생성합니다.

    서비스 계정의 예

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: otel-collector-deployment

  2. 서비스 계정에 대한 클러스터 역할을 생성합니다.

    클러스터 역할의 예

    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"]

    1
    k8sattributesprocessor에는 Pod 및 네임스페이스 리소스에 대한 권한이 필요합니다.
    2
    resourcedetectionprocessor에는 인프라 및 상태에 대한 권한이 필요합니다.
  3. 클러스터 역할을 서비스 계정에 바인딩합니다.

    클러스터 역할 바인딩 예

    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

  4. YAML 파일을 생성하여 OpenTelemetryCollector CR(사용자 정의 리소스)을 정의합니다.

    OpenTelemetry 수집기 예

    apiVersion: opentelemetry.io/v1alpha1
    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]

    1
    수집기 내보내기는 OTLP를 내보내도록 구성되어 있으며 이 예에서는 이미 생성된 Tempo 배포자 엔드포인트인 "tempo-simplest-distributor:4317" 을 가리킵니다.
    2
    수집기는 Jaeger 추적을 위한 수신기로 구성되며 OpenCensus는 OpenCensus 프로토콜을 통해 추적, Zipkin 프로토콜을 통한 Zipkin 추적 및 GRPC 프로토콜을 통해 OTLP 추적을 사용합니다.
작은 정보

tracegen 을 테스트로 배포할 수 있습니다.

apiVersion: batch/v1
kind: Job
metadata:
  name: tracegen
spec:
  template:
    spec:
      containers:
        - name: tracegen
          image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/tracegen:latest
          command:
            - "./tracegen"
          args:
            - -otlp-endpoint=otel-collector:4317
            - -otlp-insecure
            - -duration=30s
            - -workers=1
      restartPolicy: Never
  backoffLimit: 4
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.