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
역할의 계정이 있어야 합니다.
-
프로세스
OpenTelemetry 수집기 인스턴스에 대한 프로젝트를 생성합니다.
apiVersion: project.openshift.io/v1 kind: Project metadata: name: observability
서비스 계정을 생성합니다.
apiVersion: v1 kind: ServiceAccount metadata: name: otel-collector-deployment namespace: observability
k8sattributes
및resourcedetection
프로세서에 대한 서비스 계정에 권한을 부여합니다.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
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 인스턴스의 게이트웨이를 가리킵니다.
조정된 애플리케이션을 사용하여 컨테이너의 환경 변수를 설정합니다.
이름 설명 기본값 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