16.2. Apache Karaf 컨테이너에서 노출된 메트릭을 스크랩하도록 Prometheus 서버 구성

Prometheus 서버가 Apache Karaf 컨테이너에서 지표를 스크랩하도록 활성화하려면 지표를 노출하는 끝점을 Prometheus 구성 파일의 target 속성에 추가해야 합니다.

절차

  1. Prometheus 설치 디렉터리의 /prometheus.yml 구성 파일로 이동합니다.
  2. 스크랩에 Apache Karaf 끝점을 추가합니다.

    scrape_configs:
      - job_name: 'prometheus'
    
        # metrics_path defaults to '/metrics'
        # scheme defaults to 'http'.
        static_configs:
        - targets: ['localhost:9779']