검색

3.3. 모니터링 스택에 메트릭을 전송하기 위한 구성

download PDF

OpenTelemetry Collector CR(사용자 정의 리소스)을 구성하여 수집기의 파이프라인 지표 및 활성화된 Prometheus 내보내기를 스크랩하는 Prometheus ServiceMonitor CR을 생성할 수 있습니다.

Prometheus 내보내기를 사용한 OpenTelemetry 수집기 사용자 정의 리소스의 예

spec:
  mode: deployment
  observability:
    metrics:
      enableMetrics: true 1
  config: |
    exporters:
      prometheus:
        endpoint: 0.0.0.0:8889
        resource_to_telemetry_conversion:
          enabled: true # by default resource attributes are dropped
    service:
      telemetry:
        metrics:
          address: ":8888"
      pipelines:
        metrics:
          receivers: [otlp]
          exporters: [prometheus]

1
수집기의 내부 지표 끝점 및 Prometheus 내보내기 메트릭 끝점을 스크랩하도록 Prometheus ServiceMonitor CR을 생성하도록 Operator를 구성합니다. 지표는 OpenShift 모니터링 스택에 저장됩니다.

또는 수동으로 생성한 Prometheus PodMonitor 는 Prometheus 스크랩 중에 추가된 중복된 라벨 제거와 같은 미세한 제어를 제공할 수 있습니다.

수집기 메트릭을 스크랩하도록 모니터링 스택을 구성하는 PodMonitor 사용자 정의 리소스의 예

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: otel-collector
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: `<cr_name>-collector` 1
  podMetricsEndpoints:
  - port: metrics 2
  - port: promexporter 3
    relabelings:
    - action: labeldrop
      regex: pod
    - action: labeldrop
      regex: container
    - action: labeldrop
      regex: endpoint
    metricRelabelings:
    - action: labeldrop
      regex: instance
    - action: labeldrop
      regex: job

1
OpenTelemetry 수집기 사용자 정의 리소스의 이름입니다.
2
OpenTelemetry 수집기의 내부 메트릭 포트의 이름입니다. 이 포트 이름은 항상 metrics 입니다.
3
OpenTelemetry 수집기의 Prometheus 내보내기 포트의 이름입니다.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.