Prometheus를 Freshservice 경고 관리와 통합하기

통합에 대하여:

Prometheus는 신뢰성과 확장성을 위해 설계된 강력한 오픈 소스 모니터링 및 알림 도구입니다. 이 가이드는 Freshservice 환경에 Prometheus를 통합하는 과정을 안내합니다.


Freshservice에서의 구성:


1단계:

관리자 패널로 이동하여 IT 운영 관리로 스크롤한 후 모니터링 도구를 선택합니다.

: ; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ;">

2단계:

현재 모니터링 도구 목록 페이지에 있습니다. 새로운 통합을 추가하려면 모니터링 도구 추가를 선택하세요.

; --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; margin-bottom: 0px; margin-left: 0px; font-size: 16px; line-height: 1.6; word-break: normal; overflow-wrap: break-word; font-weight: 400; text-align: start; text-indent: 0px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif;">


3단계:

사전 구성된 통합 목록, 웹훅을 사용한 사용자 정의 통합의 게이트웨이 및 경고를 위한 채널로 이메일을 사용하는 옵션을 볼 수 있습니다. Prometheus.

opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; font-family: Arial, Helvetica, sans-serif;">

4단계:

URL과 인증 키가 생성됩니다. Prometheus에서 통합을 설정할 때 필요합니다.


Prometheus에서의 구성:

  1. 다음 파일/애플리케이션에 접근할 수 있고 최신 버전을 다운로드했는지 확인하십시오:
    • Prometheus - 기기에 적합한 Prometheus 모니터링 시스템 버전을 다운로드하십시오
-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-shadow: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; font-size: 16px; line-height: 1.6; margin-bottom: 0px; margin-left: 0px; word-break: normal; overflow-wrap: break-word; font-weight: 400; text-align: start; text-indent: 0px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif;">Alert Manager - Prometheus를 사용하여 경고를 구성하기 위해 Alert Manager를 다운로드합니다.
  • Node Exporter - Freshservice에 테스트 경고를 보내기 위해 Node Exporter를 다운로드합니다.
  • zip 파일을 추출하고 prometheus-2.47.0.darwin-amd64 폴더의 alert.rules.yml 파일을 엽니다. 경고 규칙은 경고 알림이 전송되는 조건을 정의하는 데 도움이 됩니다. 다음은 alert.rules.yml에 추가할 수 있는 샘플 경고 규칙입니다.
    groups:
    - name: server_monitoring
      rules:
      - alert: ServerStatus
        expr: up == 0
        for: 2s
        labels:
          severity: '{{ if eq .Value "0" }}critical{{ else }}info{{ end }}'
        annotations:
          summary: Server status is {{ if eq .Value "0" }}down{{ else }}up{{ end }}.
          description: The server status has changed to {{ if eq .Value "0" }}down{{ else }}up{{ end }} for more than 2 seconds.
  • prometheus.yml 파일을 엽니다. 이 파일에는 실행해야 하는 경고 규칙을 지정할 수 있는 글로벌 구성이 포함되어 있습니다. 이에 대한 자세한 정보는 여기에서 찾을 수 있습니다. 3번 항목에 명시된 경고 규칙을 실행하려면 다음 코드를 prometheus.yml에 추가하십시오.
    # Global configurationglobal:
      scrape_interval: 15s
      evaluation_interval: 15s
    
    
    # Alertmanager configuration
    alerting:
      alertmanagers:
      - static_configs:
        - targets:
          - localhost:9093
    
    
    # Load rules for evaluation
    rule_files:
    - 'prometheus.rules.yml'
    - 'alert.rules.yml'
    
    
    # Scrape configurations
    scrape_configs:
    - job_name: "prometheus"
      static_configs:
      - targets: ["localhost:9090"]
      - targets: ["127.0.0.1:8080"]
  • 이제 alertmanager-0.26.0.darwin-amd64로 이동하여 alertmanager.yml 파일을 엽니다. 여기에서 Prometheus가 경고를 보낼 엔드포인트를 설정합니다. 이에 대한 자세한 정보는 여기에서 찾을 수 있습니다. 다음 코드를 alertmanager.yml에 추가하십시오. 
    global:
      resolve_timeout: 5m
    
    
    route:
      group_by: ['alertname', 'severity']
      group_wait: 10s
      group_interval: 1m
      repeat_interval: 3m
      receiver: 'webhook'
    
    
    receivers:
    - name: 'webhook'
      webhook_configs:
      - url: 'http://your-freshservice-webhook-url-here'
        send_resolved: true
    
    
    templates:
    - 'alertmanager/default.tmpl'

  • 통합 테스트


    1. 시스템에서 터미널을 열고 Prometheus 폴더로 이동합니다. 다음 명령을 실행하십시오. 

    prometheus --config.file=prometheus.yml

    2. alertmanager 폴더로 이동하여 다음 명령어를 실행하세요

    ./alertmanager --config.file=alertmanager.yml

    3. Node Exporter로 이동하여 다음 명령어를 실행하세요

      ./node_exporter --web.listen-address 127.0.0.1:8080
    


    4. 다음 링크를 사용하여 로컬에서 Prometheus와 Alert Manager를 확인하세요:

    • Prometheus: http://localhost:9090/alerts
    • AlertManager: http://localhost:9093/#/alerts

    • 5. 치명적인 경고를 생성하려면, 터미널에서 Node Exporter 프로세스를 중지하여 서버 중단을 시뮬레이션하세요. 그런 다음 통합 테스트의 3단계에서 제공된 명령어를 다시 실행하여 서버를 온라인으로 복구하고 경고를 해제할 수 있습니다.


    이 문서가 도움이 되었나요?

    Freshservice AI 도우미

    Prometheus를 Freshservice 경고 관리와 통합하기

    AI 어시스턴트 초기화 중...