4.7. 대상 할당자


대상 할당자는 OpenTelemetry Collector 인스턴스의 배포된 전체에서 스크래핑 대상을 분할하는 OpenTelemetry Operator의 선택적 구성 요소입니다. Target Allocator는 Prometheus PodMonitorServiceMonitor 사용자 정의 리소스(CR)와 통합됩니다. 대상 할당자가 활성화되면 OpenTelemetry Operator는 대상 할당자 서비스에 연결되는 활성화된 prometheus 수신기에 http_sd_config 필드를 추가합니다.

중요

대상 할당자는 기술 미리보기 기능일 뿐입니다. 기술 프리뷰 기능은 Red Hat 프로덕션 서비스 수준 계약(SLA)에서 지원되지 않으며 기능적으로 완전하지 않을 수 있습니다. 따라서 프로덕션 환경에서 사용하는 것은 권장하지 않습니다. 이러한 기능을 사용하면 향후 제품 기능을 조기에 이용할 수 있어 개발 과정에서 고객이 기능을 테스트하고 피드백을 제공할 수 있습니다.

Red Hat 기술 프리뷰 기능의 지원 범위에 대한 자세한 내용은 기술 프리뷰 기능 지원 범위를 참조하십시오.

활성화된 대상 할당기를 사용한 OpenTelemetryCollector CR 예제

apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
  name: otel
  namespace: observability
spec:
  mode: statefulset 
1

  targetAllocator:
    enabled: true 
2

    serviceAccount: 
3

    prometheusCR:
      enabled: true 
4

      scrapeInterval: 10s
      serviceMonitorSelector: 
5

        name: app1
      podMonitorSelector: 
6

        name: app2
  config:
    receivers:
      prometheus: 
7

        config:
          scrape_configs: []
    processors:
    exporters:
      debug: {}
    service:
      pipelines:
        metrics:
          receivers: [prometheus]
          processors: []
          exporters: [debug]
# ...
Copy to Clipboard Toggle word wrap

1
대상 할당자가 활성화된 경우 배포 모드를 statefulset 으로 설정해야 합니다.
2
대상 할당자를 활성화합니다. 기본값은 false입니다.
3
Target Allocator 배포의 서비스 계정 이름입니다. 서비스 계정에는 클러스터에서 ServiceMonitor , PodMonitor 사용자 정의 리소스 및 기타 개체를 가져와서 스크래핑된 메트릭에 레이블을 올바르게 설정하기 위한 RBAC가 있어야 합니다. 기본 서비스 이름은 <collector_name>-targetallocator 입니다.
4
Prometheus PodMonitorServiceMonitor 사용자 정의 리소스와의 통합을 활성화합니다.
5
Prometheus ServiceMonitor 사용자 정의 리소스에 대한 레이블 선택기입니다. 비어 두면 모든 서비스 모니터가 활성화됩니다.
6
Prometheus PodMonitor 사용자 정의 리소스에 대한 라벨 선택기입니다. 비어 두면 모든 포드 모니터가 활성화됩니다.
7
최소한의 빈 scrape_config: [] 구성 옵션을 갖춘 Prometheus 수신기입니다.

Target Allocator 배포는 Kubernetes API를 사용하여 클러스터에서 관련 객체를 가져오므로 사용자 지정 RBAC 구성이 필요합니다.

Target Allocator 서비스 계정에 대한 RBAC 구성

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: otel-targetallocator
rules:
  - apiGroups: [""]
    resources:
      - services
      - pods
      - namespaces
    verbs: ["get", "list", "watch"]
  - apiGroups: ["monitoring.coreos.com"]
    resources:
      - servicemonitors
      - podmonitors
      - scrapeconfigs
      - probes
    verbs: ["get", "list", "watch"]
  - apiGroups: ["discovery.k8s.io"]
    resources:
      - endpointslices
    verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: otel-targetallocator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: otel-targetallocator
subjects:
  - kind: ServiceAccount
    name: otel-targetallocator 
1

    namespace: observability 
2

# ...
Copy to Clipboard Toggle word wrap

1
Target Allocator 서비스 계정의 이름입니다.
2
Target Allocator 서비스 계정의 네임스페이스입니다.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat