5.2. 사이드카 삽입 없이 OpenTelemetry 수집기에 추적 및 메트릭 전송


여러 환경 변수를 수동으로 설정해야 하는 사이드카 삽입 없이 OpenTelemetry 수집기 인스턴스로 원격 분석 데이터를 보낼 수 있습니다.

사전 요구 사항

  • Red Hat OpenShift distributed tracing platform(Tempo)이 설치되고 TempoStack 인스턴스가 배포됩니다.
  • 웹 콘솔 또는 OpenShift CLI(oc)를 통해 클러스터에 액세스할 수 있습니다.

    • cluster-admin 역할의 클러스터 관리자로 웹 콘솔에 로그인되어 있습니다.
    • cluster-admin 역할의 클러스터 관리자가 활성 OpenShift CLI(oc) 세션입니다.
    • Red Hat OpenShift Dedicated의 경우 dedicated-admin 역할의 계정이 있어야 합니다.

프로세스

  1. OpenTelemetry 수집기 인스턴스에 대한 프로젝트를 생성합니다.

    apiVersion: project.openshift.io/v1
    kind: Project
    metadata:
      name: observability
  2. 서비스 계정을 생성합니다.

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: otel-collector-deployment
      namespace: observability
  3. k8sattributesresourcedetection 프로세서에 대한 서비스 계정에 권한을 부여합니다.

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: otel-collector
    rules:
    - apiGroups: ["", "config.openshift.io"]
      resources: ["pods", "namespaces", "infrastructures", "infrastructures/status"]
      verbs: ["get", "watch", "list"]
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: otel-collector
    subjects:
    - kind: ServiceAccount
      name: otel-collector
      namespace: observability
    roleRef:
      kind: ClusterRole
      name: otel-collector
      apiGroup: rbac.authorization.k8s.io
  4. OpenTelemetryCollector 사용자 정의 리소스를 사용하여 OpenTelemetry 수집기 인스턴스를 배포합니다.

    apiVersion: opentelemetry.io/v1alpha1
    kind: OpenTelemetryCollector
    metadata:
      name: otel
      namespace: observability
    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-<example>-distributor:4317" 1
            tls:
              insecure: true
        service:
          pipelines:
            traces:
              receivers: [jaeger, opencensus, otlp, zipkin]
              processors: [memory_limiter, k8sattributes, resourcedetection, batch]
              exporters: [otlp]
    1
    이는 Tempo Operator를 사용하여 <example> 배포된 TempoStack 인스턴스의 게이트웨이를 가리킵니다.
  5. 조정된 애플리케이션을 사용하여 컨테이너의 환경 변수를 설정합니다.

    이름설명기본값
    OTEL_SERVICE_NAME

    service.name 리소스 속성 값을 설정합니다.

    ""

    OTEL_EXPORTER_OTLP_ENDPOINT

    선택적으로 지정된 포트 번호가 있는 모든 신호 유형의 기본 끝점 URL입니다.

    https://localhost:4317

    OTEL_EXPORTER_OTLP_CERTIFICATE

    gRPC 클라이언트의 TLS 자격 증명에 대한 인증서 파일의 경로입니다.

    https://localhost:4317

    OTEL_TRACES_SAMPLER

    추적에 사용할 샘플입니다.

    parentbased_always_on

    OTEL_EXPORTER_OTLP_PROTOCOL

    OTLP 내보내기를 위한 전송 프로토콜입니다.

    grpc

    OTEL_EXPORTER_OTLP_TIMEOUT

    OTLP 내보내기가 각 배치 내보내기에 대해 대기하는 최대 시간 간격입니다.

    10s

    OTEL_EXPORTER_OTLP_INSECURE

    gRPC 요청에 대한 클라이언트 전송 보안을 비활성화합니다. HTTPS 스키마는 이를 덮어씁니다.

    False

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.