11.2. 분산 추적 플랫폼(Jaeger)에서 사이드카 없이 OpenTelemetry의 Red Hat 빌드로 마이그레이션
사이드카 배포 없이 분산 추적 플랫폼(Jaeger)에서 OpenTelemetry의 Red Hat 빌드로 마이그레이션할 수 있습니다.
사전 요구 사항
- Red Hat OpenShift 분산 추적 플랫폼(Jaeger)은 클러스터에서 사용됩니다.
- Red Hat build of OpenTelemetry가 설치되어 있습니다.
프로세스
- OpenTelemetry 수집기 배포를 구성합니다.
OpenTelemetry 수집기를 배포할 프로젝트를 생성합니다.
apiVersion: project.openshift.io/v1 kind: Project metadata: name: observability
apiVersion: project.openshift.io/v1 kind: Project metadata: name: observability
Copy to Clipboard Copied! OpenTelemetry 수집기 인스턴스를 실행하기 위한 서비스 계정을 생성합니다.
apiVersion: v1 kind: ServiceAccount metadata: name: otel-collector-deployment namespace: observability
apiVersion: v1 kind: ServiceAccount metadata: name: otel-collector-deployment namespace: observability
Copy to Clipboard Copied! 프로세서에 필요한 권한을 설정하는 클러스터 역할을 생성합니다.
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: 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 Copied! ClusterRoleBinding을 생성하여 서비스 계정에 대한 권한을 설정합니다.
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: otel-collector subjects: - kind: ServiceAccount name: otel-collector-deployment namespace: observability roleRef: kind: ClusterRole name: otel-collector apiGroup: rbac.authorization.k8s.io
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: otel-collector subjects: - kind: ServiceAccount name: otel-collector-deployment namespace: observability roleRef: kind: ClusterRole name: otel-collector apiGroup: rbac.authorization.k8s.io
Copy to Clipboard Copied! OpenTelemetry 수집기 인스턴스를 생성합니다.
참고이 수집기는 추적을 TempoStack 인스턴스로 내보냅니다. Red Hat Tempo Operator를 사용하여 TempoStack 인스턴스를 생성하고 여기에 올바른 끝점을 배치해야 합니다.
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: processors: batch: k8sattributes: memory_limiter: check_interval: 1s limit_percentage: 50 spike_limit_percentage: 30 resourcedetection: detectors: [openshift] exporters: otlp: endpoint: "tempo-example-gateway:8090" tls: insecure: true service: pipelines: traces: receivers: [jaeger] processors: [memory_limiter, k8sattributes, resourcedetection, batch] exporters: [otlp]
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: processors: batch: k8sattributes: memory_limiter: check_interval: 1s limit_percentage: 50 spike_limit_percentage: 30 resourcedetection: detectors: [openshift] exporters: otlp: endpoint: "tempo-example-gateway:8090" tls: insecure: true service: pipelines: traces: receivers: [jaeger] processors: [memory_limiter, k8sattributes, resourcedetection, batch] exporters: [otlp]
Copy to Clipboard Copied! - 추적 끝점을 OpenTelemetry Operator를 가리킵니다.
애플리케이션에서 직접 추적을 Jaeger로 내보내는 경우 API 끝점을 Jaeger 끝점에서 OpenTelemetry 수집기 끝점으로 변경합니다.
Golang에서
jaegerexporter
를 사용하여 추적 내보내기 예exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url)))
exp, err := jaeger.New(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(url)))
1 Copy to Clipboard Copied! - 1
- URL은 OpenTelemetry 수집기 API 끝점을 가리킵니다.