성능 모니터링 지표
Entry, Enterprise, Enterprise Advanced 플랜에서 사용할 수 있습니다(Professional에서는 제공되지 않습니다).
Mattermost는 Prometheus 및 Grafana와 연동할 수 있도록 다음과 같은 성능 모니터링 통계를 제공합니다.
맞춤 Mattermost 지표
다음은 시스템 성능을 모니터링하는 데 사용할 수 있는 맞춤 Mattermost 지표 목록입니다.
API 지표
mattermost_api_time: 특정 API 핸들러를 실행하는 데 걸린 총 시간(초).
캐싱 지표
mattermost_cache_etag_hit_total: 특정 캐시의 ETag 캐시 적중 총 횟수.mattermost_cache_etag_miss_total: API 호출의 ETag 캐시 미스 총 횟수.mattermost_cache_mem_hit_total: 특정 캐시의 메모리 캐시 적중 총 횟수.mattermost_cache_mem_invalidation_total: 특정 캐시의 메모리 캐시 무효화 총 횟수.mattermost_cache_mem_miss_total: 특정 캐시의 캐시 미스 총 횟수.
위 지표들은 시간 경과에 따른 ETag 및 메모리 캐시 적중률을 계산하는 데 사용할 수 있습니다.
클러스터 지표
mattermost_cluster_cluster_request_duration_seconds: 노드 간 클러스터 요청의 총 소요 시간(초).mattermost_cluster_cluster_health_score: 가십 프로토콜의 소프트 실시간 요구 사항을 얼마나 잘 충족하고 있는지 가늠할 수 있는 점수.mattermost_cluster_cluster_requests_total: 노드 간 요청의 총 횟수.mattermost_cluster_cluster_event_type_totals: 유형과 무관하게 전송된 클러스터 요청의 총 횟수.mattermost_cluster_reliable_fallback_tcp: 메시지 길이 때문에SendReliable(TCP)로 대체되어야 했던SendBestEffort호출(UDP)의 총 길이(바이트). 32KiB부터 4MiB까지 8개 버킷을 갖는 히스토그램입니다. 이상적으로 이 지표의 카운트는 항상 0이어야 하지만, 플러그인이 웹소켓 API를 잘못 사용해 큰 메시지를 UDP로 전송하려 할 수 있습니다. 그런 경우 해당 플러그인이 ReliableClusterSend를 true로 설정하도록 수정해야 합니다.
데이터베이스 지표
mattermost_db_active_users: 활성 사용자 총 수.mattermost_db_cache_time: 캐시 핸들러를 실행하는 데 걸린 시간.mattermost_db_master_connections_total: 마스터 데이터베이스에 대한 연결 총 수.mattermost_db_read_replica_connections_total: 모든 읽기 복제본 데이터베이스에 대한 연결 총 수.mattermost_db_search_replica_connections_total: 모든 검색 복제본 데이터베이스에 대한 연결 총 수.mattermost_db_store_time: 특정 데이터베이스 저장 메서드를 실행하는 데 걸린 총 시간(초).mattermost_db_replica_lag_abs: binlog 거리 또는 트랜잭션 큐 길이를 기준으로 한 절대 지연 시간.mattermost_db_replica_lag_time: 복제본이 따라잡는 데 걸린 시간.
데이터베이스 연결 지표
go_sql_max_open_connections: 데이터베이스에 대한 최대 열린 연결 수.go_sql_open_connections: 사용 중이거나 유휴 상태인 확립된 연결 수.go_sql_in_use_connections: 현재 사용 중인 연결 수.go_sql_idle_connections: 유휴 연결 수.go_sql_wait_count_total: 대기한 연결의 총 수.go_sql_wait_duration_seconds_total: 새 연결을 기다리며 차단된 총 시간.go_sql_max_idle_closed_total: SetMaxIdleConns로 인해 닫힌 연결의 총 수.go_sql_max_idle_time_closed_total: SetConnMaxIdleTime으로 인해 닫힌 연결의 총 수.go_sql_max_lifetime_closed_total: SetConnMaxLifetime으로 인해 닫힌 연결의 총 수.
HTTP 지표
mattermost_http_errors_total: HTTP API 오류의 총 수.mattermost_http_requests_total: HTTP API 요청의 총 수.mattermost_http_websockets_total: 이 서버에 대한 웹소켓 연결의 총 수.
Mattermost 버전 v9.9부터 이 값에는 인증되지 않았을 수 있는 연결도 포함됩니다. 또한 이 지표에는 origin_client 레이블이 함께 제공되어 클라이언트 유형별(즉, 웹, 모바일, 데스크톱) 연결 분포를 확인할 수 있습니다.
로그인 및 세션 지표
mattermost_login_logins_fail_total: 실패한 로그인의 총 수.mattermost_login_logins_total: 성공한 로그인의 총 수.
Mattermost 채널 지표
mattermost_post_broadcasts_total: 게시물 생성으로 인해 전송된 웹소켓 브로드캐스트의 총 수.mattermost_post_emails_sent_total: 게시물 생성으로 인해 발송된 이메일의 총 수.mattermost_post_file_attachments_total: 게시물 생성으로 인해 만들어진 파일 첨부의 총 수.mattermost_post_pushes_sent_total: 게시물 생성으로 인해 전송된 모바일 푸시 알림의 총 수.mattermost_post_total: 생성된 게시물의 총 수.mattermost_post_webhooks_total: 생성된 웹훅 게시물의 총 수.
프로세스 지표
mattermost_process_cpu_seconds_total: 사용자 및 시스템 CPU 시간의 총합(초).mattermost_process_max_fds: 열린 파일 디스크립터의 최대 수.mattermost_process_open_fds: 열린 파일 디스크립터 수.mattermost_process_resident_memory_bytes: 상주 메모리 크기(바이트).mattermost_process_start_time_seconds: 유닉스 에포크 이후 프로세스의 시작 시각(초).mattermost_process_virtual_memory_bytes: 가상 메모리 크기(바이트).mattermost_process_virtual_memory_max_bytes: 사용 가능한 가상 메모리의 최대 크기(바이트).
검색 지표
mattermost_search_posts_searches_duration_seconds: 게시물 검색의 총 소요 시간(초).mattermost_search_channel_index_total: 수행된 채널 인덱싱의 총 횟수.mattermost_search_file_index_total: 수행된 파일 인덱싱의 총 횟수.mattermost_search_files_searches_duration_seconds: 파일 검색의 총 소요 시간(초).mattermost_search_files_searches_total: 수행된 파일 검색의 총 횟수.mattermost_search_post_index_total: 수행된 게시물 인덱싱의 총 횟수.mattermost_search_posts_searches_total: 수행된 게시물 검색의 총 횟수.mattermost_search_user_index_total: 수행된 사용자 인덱싱의 총 횟수.mattermost_search_engine_status: 구성된 검색 엔진의 상태.1= 정상이거나 구성되지 않음,0= 구성되었으나 사용할 수 없음. 검색 엔진 장애에 대한 알림을 설정할 때 이 지표를 사용하세요.
WebSocket 지표
mattermost_websocket_broadcast_buffer_size: 처리를 기다리며 웹소켓 브로드캐스트 버퍼에 있는 이벤트 수.mattermost_websocket_broadcast_buffer_users_registered: 브로드캐스트 버퍼 허브에 등록된 사용자 수.mattermost_websocket_broadcasts_total: 유형과 무관하게 전송된 웹소켓 브로드캐스트의 총 수.mattermost_websocket_event_total: 웹소켓 이벤트의 총 수.mattermost_websocket_reconnects_total: 웹소켓 재연결 시도의 총 수.
로깅 지표
mattermost_logging_logger_queue_used: 로그 대상 큐에 있는 레코드 수.mattermost_logging_logger_logged_total: 기록된 레코드의 총 수.mattermost_logging_logger_error_total: 로거 오류의 총 수.mattermost_logging_logger_dropped_total: 유실된 로그 레코드의 총 수.mattermost_logging_logger_blocked_total: 차단되거나 지연된 로그 레코드의 총 수.
디버깅 지표 - 시스템
mattermost_system_server_start_time: 서버가 시작된 시각.
해당 이벤트에 대응하는 주석(annotation)을 동적으로 추가하려면 mattermost_system_server_start_time을 사용하세요.
디버깅 지표 - 작업
mattermost_jobs_active: 활성 작업 수.
활성 작업 차트를 표시하려면 mattermost_jobs_active를 사용하세요.
또는 작업이 활성 상태인 구간에 대응하는 범위 주석을 동적으로 추가하는 데 mattermost_jobs_active를 사용할 수도 있습니다.
LDAP 동기화 작업처럼 실행 시간이 긴 작업을 분석할 때 주석을 활용하면 분석이 수월해집니다.
실행 시간이 Prometheus 폴링 간격보다 짧은 작업은 표시되지 않을 가능성이 큽니다. Grafana가 원시 Prometheus 시계열 데이터에 대해 범위 쿼리를 수행하고 값이 변경될 때마다 이벤트를 렌더링하기 때문입니다.
플러그인 지표
mattermost_plugin_api_time: 플러그인 API 핸들러를 실행하는 데 걸린 시간(초).mattermost_plugin_hook_time: 플러그인 훅 핸들러를 실행하는 데 걸린 시간(초).mattermost_plugin_multi_hook_server_time: 서버가 여러 플러그인 훅 핸들러를 실행하는 데 걸린 시간(초).mattermost_plugin_multi_hook_time: 여러 플러그인 훅 핸들러를 실행하는 데 걸린 시간(초).
위 지표들은 Mattermost 서버가 플러그인 코드를 실행하면서 측정합니다. Mattermost v11.8.0부터는 AggregatePluginMetrics 기능 플래그가 활성화된 경우 플러그인이 제공하는 Prometheus 지표도 표준 Mattermost /metrics 엔드포인트를 통해 노출할 수 있습니다. 집계된 플러그인 지표에는 플러그인 매니페스트 ID를 기반으로 한 plugin_id 레이블이 포함되므로, 관리자는 어떤 플러그인이 각 지표를 생성했는지 식별할 수 있습니다.
AggregatePluginMetrics는 기본적으로 비활성화되어 있으며, 플러그인이 제공하는 지표가 /metrics 응답에 포함되려면 먼저 활성화해야 합니다.
공유 지표
mattermost_shared_channels_sync_collection_duration_seconds: 작업이 동기화 데이터를 수집하는 데 소요한 시간(초).mattermost_shared_channels_sync_collection_step_duration_seconds: 작업이 데이터를 수집하는 각 단계에 소요한 시간(초).mattermost_shared_channels_sync_count: 각 원격지에 대해 처리된 동기화 이벤트 수.mattermost_shared_channels_sync_send_duration_seconds: 작업이 동기화 데이터를 전송하는 데 소요한 시간(초).mattermost_shared_channels_sync_send_step_duration_seconds: 작업이 데이터를 전송하는 각 단계에 소요한 시간(초).mattermost_shared_channels_task_in_queue_duration_seconds: 작업이 큐에서 대기한 시간(초).mattermost_shared_channels_task_queue_size: 현재 큐에 있는 작업 수.
원격 클러스터 지표
mattermost_remote_cluster_clock_skew: 클러스터 간 시계 오차의 근사값.mattermost_remote_cluster_conn_state_change_total: 연결 상태 변경의 총 횟수.mattermost_remote_cluster_msg_errors_total: 메시지 오류의 총 횟수.mattermost_remote_cluster_msg_received_total: 원격 클러스터로부터 수신한 메시지의 총 수.mattermost_remote_cluster_msg_sent_total: 원격 클러스터로 전송한 메시지의 총 수.mattermost_remote_cluster_ping_time: 원격 클러스터에 대한 핑 왕복 시간.
알림 지표
mattermost_notifications_error: 알림 흐름을 중단시키는 오류의 총 수.mattermost_notifications_not_sent: 시스템이 의도적으로 보내지 않은 알림의 총 수.mattermost_notifications_success: 성공적으로 전송된 알림의 총 수.mattermost_notifications_total: 알림 이벤트의 총 수.mattermost_notifications_total_ack: 확인 응답된 알림 이벤트의 총 수.mattermost_notifications_unsupported: 지원되지 않는 앱 버전으로 인해 추적할 수 없는 알림의 총 수.
모바일 앱 지표
mattermost_mobileapp_mobile_channel_switch: 사용자가 채널 이름을 클릭한 시점부터 전체 채널 화면이 로드될 때까지 걸린 시간(초).mattermost_mobileapp_mobile_load: 사용자가 앱을 연 시점부터 앱이 모든 관련 정보를 최종적으로 로드할 때까지 걸린 시간(초).mattermost_mobileapp_mobile_team_switch: 사용자가 팀을 클릭한 시점부터 전체 카테고리 화면이 로드될 때까지 걸린 시간(초).
웹 앱 지표
mattermost_webapp_channel_switch: 사용자가 LHS에서 채널을 클릭한 시점부터 해당 채널의 게시물이 표시될 때까지 걸린 시간(초).mattermost_webapp_cumulative_layout_shift: 페이지 콘텐츠가 예기치 않게 얼마나 이동하는지를 나타내는 측정값.mattermost_webapp_first_contentful_paint: 사용자 화면에 어떤 콘텐츠든 표시되기까지 걸린 시간(초).mattermost_webapp_global_threads_load: 사용자가 LHS에서 Threads를 열기 위해 클릭한 시점부터 전역 스레드 화면이 표시될 때까지 걸린 시간(밀리초).mattermost_webapp_interaction_to_next_paint: 사용자가 마우스로 클릭하거나 터치스크린을 탭하거나 키보드를 누른 결과를 확인하기까지 걸리는 시간을 나타내는 측정값(초).mattermost_webapp_largest_contentful_paint: 사용자 화면에 큰 콘텐츠가 표시되기까지 걸린 시간(초).mattermost_webapp_long_tasks: 브라우저의 메인 UI 스레드가 단일 작업으로 인해 50ms를 초과해 차단된 횟수의 카운터.mattermost_webapp_page_load: 브라우저가 웹 앱 로딩을 시작한 시점부터 웹 앱의 load 이벤트가 완료될 때까지의 시간(초).mattermost_webapp_rhs_load: 사용자가 RHS에서 스레드를 열기 위해 클릭한 시점부터 해당 스레드의 게시물이 표시될 때까지 걸린 시간(초).mattermost_webapp_team_switch: 사용자가 LHS에서 팀을 클릭한 시점부터 해당 팀의 게시물이 표시될 때까지 걸린 시간(초).mattermost_webapp_time_to_first_byte: 브라우저가 서버에 페이지를 요청하기 시작한 시점부터 응답 데이터를 받기 시작할 때까지의 시간(초).
표준 Go 지표
Entry, Professional, Enterprise, Enterprise Advanced 플랜에서 사용할 수 있습니다.
성능 모니터링 기능은 HTTP 서버 런타임 프로파일링 데이터와 시스템 모니터링을 위한 표준 Go 지표를 다음과 같이 제공합니다.
- 메모리 사용량을 나타내는
go_memstats_alloc_bytes - 고루틴 수를 나타내는
go_goroutines - 가비지 컬렉션 소요 시간을 나타내는
go_gc_duration_seconds - 힙의 객체 추적을 위한
go_memstats_heap_objects
런타임 프로파일링을 설정하는 방법은 pprof 패키지 Go 문서를 참고하세요. ip:port 페이지에 접속하면 설명이 포함된 전체 지표 목록도 확인할 수 있습니다.
HTTP를 통해 /metrics에 연결하려면 Mattermost Enterprise 라이선스가 필요합니다.
활성화되어 있다면 다음 명령으로 프로파일러를 실행할 수 있습니다.
go tool pprof http://localhost:<port>/debug/pprof/profile?seconds=<duration>
여기서 localhost는 서버 이름으로 바꿀 수 있습니다. 프로파일링 보고서는 <ip>:<port>에서 확인할 수 있으며 다음 항목이 포함됩니다.
- CPU 프로파일링을 위한
/debug/pprof/profile?seconds=30 - 명령줄 프로파일링을 위한
/debug/pprof/cmdline - 심볼 프로파일링을 위한
/debug/pprof/symbol - 트레이스 프로파일링을 위한
/debug/pprof/trace - 고루틴 프로파일링을 위한
/debug/pprof/goroutine - 힙 프로파일링을 위한
/debug/pprof/heap - 스레드 프로파일링을 위한
/debug/pprof/threadcreate - 블록 프로파일링을 위한
/debug/pprof/block - 과거 메모리 할당 내역을 위한
/debug/pprof/allocs - 경합이 발생한 뮤텍스 보유자 로그를 위한
/debug/pprof/mutex
호스트/시스템 지표
Metrics 플러그인 v0.7.0부터는 node exporter 대상에서 지표를 가져와 Mattermost Calls의 네트워크 관련 패널에 접근할 수 있습니다.
자주 묻는 질문
차트 레이블을 구분하기 어려운 이유는 무엇인가요?
서버 필터와 범례에 사용되는 차트 레이블은 머신의 호스트명을 기반으로 합니다. 호스트명이 서로 비슷하면 레이블을 구분하기 어렵습니다.
머신에 더 알아보기 쉬운 호스트명을 설정하거나, Prometheus 구성의 relabel_config로 표시 이름을 변경할 수 있습니다.