OpenTelemetry Collector를 사용하여 Squid 캐시 관리자에 대한 지표를 수집할 수 있습니다. 수집기는 원격 측정 데이터를 수집, 처리 및 New Relic(또는 관측 가능성 백엔드)으로 내보내는 OpenTelemetry의 구성 요소입니다.
Squid에서 측정항목을 수집하려면 아래 단계를 완료하세요.
1단계: 아직 가입하지 않은 경우 무료 계정에 가입 2단계: 전제 조건 Squid Prometheus 내보내기가 실행될 호스트가 squid.conf
파일에서 허용을 설정하여 Squid 캐시 관리자 에 액세스하도록 허용합니다.
squid.conf
의 예:
acl localnet src 192.168.0.0/16
# We would allow that ip range to access the manager by setting this directive
http_access allow localnet manager
Squid 캐시 관리자용Squid Prometheus 내보내기를 설치 하고 모니터링하려는 Squid 캐시 관리자를 가리키도록 설정합니다.
익스포터 실행 예시:
squid-exporter -squid-hostname localhost -squid-port 3128 -listen ":9301" -squid-login admin -squid-password admin
팁 Squid Prometheus 내보내기 v1.10.4 이상이 필요하며 사용 가능한 최신 버전을 권장합니다.
3단계: Opentelemetry 수집기 설치 Opentelemetry 문서 에 따라 Opentelemetry 수집기를 다운로드하고 설치합니다.
아래 예에서 config.yaml
이라는 새 파일을 만듭니다.
파일에서 다음 키를 고유한 값으로 바꿉니다.
오징어:
SQUID_EXPORTER_HOSTNAME
SQUID_EXPORTER_PORT
SQUID_EXPORTER_METRICS_PATH
SQUID_CACHEMGR
New Relic 라이선스 키 :
SQUID_CACHEMGR
엔티티를 생성하고 연관된 대시보드를 실행하려면 레이블 squid_cachemgr: SQUID_CACHEMGR
(여기서 SQUID_CACHEMGR은 고유 식별자여야 함)가 필요합니다.
- targets : [ "SQUID_EXPORTER_HOSTNAME:SQUID_EXPORTER_PORT" ]
squid_cachemgr : SQUID_CACHEMGR
metrics_path : SQUID_EXPORTER_METRICS_PATH
- source_labels : [ __name__ ]
endpoint : https : //otlp.nr - data.net : 4317
api-key : NEW_RELIC_LICENSE_KEY
processors : [ batch , memory_limiter ]
추가 구성 세부 정보는 Opentelemetry Collector 문서 및 Prometheus 구성 문서를 확인할 수 있습니다.
4단계: 수집기 실행 Opentelemetry 수집기를 실행합니다(실행 방법은 선택한 설치 방법에 따라 다를 수 있음). 예:
/usr/bin/otelcol - - config ./config.yaml
5단계: 데이터 찾기 및 사용 데이터 탐색측정항목 탐색기를 사용하여 수집 중인 측정항목을 확인할 수 있습니다. Squid Prometheus 내보내기에서 보고하는 모든 측정항목은 SQUID_CACHEMGR
에 이름이 설정되고 squid_
접두사로 시작하는 SQUID_CACHEMGR
항목으로 그룹화됩니다.
측정항목 데이터 squid 캐시 관리자가 보고한 스크랩된 메트릭의 두 그룹은 다음과 같습니다.
오징어 카운터 메트릭 이름
측정항목 유형
설명
squid_client_http_errors_total
카운터
총 클라이언트 http 오류 수
squid_client_http_hit_kbytes_out_bytes_total
카운터
총 클라이언트 KB 캐시 적중 수
squid_client_http_hits_total
카운터
총 클라이언트 캐시 적중 수
squid_client_http_kbytes_in_kbytes_total
카운터
수신된 총 클라이언트 킬로바이트 수
squid_client_http_kbytes_out_kbytes_total
카운터
전송된 총 클라이언트 KB 수
squid_client_http_requests_total
카운터
총 클라이언트 요청 수
squid_exporter_build_info
gauge
squid_exporter
가) 빌드된 버전, 버전, 분기 및 goversion으로 라벨이 지정된 상수 '1' 값이 있는 측정항목입니다.
squid_server_all_errors_total
카운터
총 서버 모든 오류 수
squid_server_all_kbytes_in_kbytes_total
카운터
수신된 총 서버 킬로바이트 수
squid_server_all_kbytes_out_kbytes_total
카운터
전송된 총 서버 KB 수
squid_server_all_requests_total
카운터
총 서버 모든 요청 수
squid_server_ftp_errors_total
카운터
총 서버 FTP 오류 수
squid_server_ftp_kbytes_in_kbytes_total
카운터
수신된 총 서버 ftp KB 수
squid_server_ftp_kbytes_out_kbytes_total
카운터
전송된 총 서버 ftp KB 수
squid_server_ftp_requests_total
카운터
총 서버 FTP 요청 수
squid_server_http_errors_total
카운터
총 서버 http 오류 수
squid_server_http_kbytes_in_kbytes_total
카운터
수신된 총 서버 http 킬로바이트 수
squid_server_http_kbytes_out_kbytes_total
카운터
전송된 총 서버 http 킬로바이트 수
squid_server_http_requests_total
카운터
총 서버 http 요청 수
squid_server_other_errors_total
카운터
총 서버 기타 오류 수
squid_server_other_kbytes_in_kbytes_total
카운터
받은 총 서버 기타 킬로바이트 수
squid_server_other_kbytes_out_kbytes_total
카운터
전송된 총 서버 기타 킬로바이트 수
squid_server_other_requests_total
카운터
총 서버 기타 요청 수
squid_swap_files_cleaned_total
카운터
주기적 정리 절차에 의해 제거된 고아 캐시 파일 수
squid_swap_ins_total
카운터
디스크에서 읽은 개체 수
squid_swap_outs_total
카운터
디스크에 저장된 개체 수
squid_up
gauge
squid의 마지막 쿼리는 성공했습니까?
오징어 서비스 시간 메트릭 이름
측정항목 유형
squid_Cache_Hits_5
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_10
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_15
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_20
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_25
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_30
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_35
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_40
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_45
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_50
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_55
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_60
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_65
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_70
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_75
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_80
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_85
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_90
카운터
서비스 시간 백분위수 5분
squid_Cache_Hits_95
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_5
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_10
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_15
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_20
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_25
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_30
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_35
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_40
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_45
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_50
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_55
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_60
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_65
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_70
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_75
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_80
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_85
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_90
카운터
서비스 시간 백분위수 5분
squid_Cache_Misses_95
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_5
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_10
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_15
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_20
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_25
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_30
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_35
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_40
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_45
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_50
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_55
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_60
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_65
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_70
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_75
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_80
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_85
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_90
카운터
서비스 시간 백분위수 5분
squid_DNS_Lookups_95
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_5
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_10
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_15
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_20
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_25
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_30
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_35
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_40
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_45
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_5
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_50
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_55
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_60
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_65
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_70
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_75
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_80
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_85
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_90
카운터
서비스 시간 백분위수 5분
squid_HTTP_Requests_All_95
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_5
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_10
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_15
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_20
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_25
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_30
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_35
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_40
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_45
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_50
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_55
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_60
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_65
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_70
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_75
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_80
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_85
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_90
카운터
서비스 시간 백분위수 5분
squid_Near_Hits_95
카운터
서비스 시간 백분위수 5분
문제점 해결 Squid 대시보드가 작동하지 않습니다. Squid 대시보드는 누적 합계 메트릭을 사용하지만 Opentelemetry 누적 합계 메트릭에 대한 전환 가이드 에 명시된 대로 누적 합계를 사용하는 계정은 전환 EOL까지 게이지 로 계속 보고합니다.
이 경우 전환 가이드 에 제안된 대로 전환 EOL 전에 누적 카운터로 보고하기 위해 squid 측정항목에 속성을 일시적으로 포함해야 합니다.
이렇게 하려면 Opentelemetry 수집기 구성의 스퀴드 파이프라인에서 Opentelemetry 특성 프로세서를 사용할 수 있습니다. 예:
- key : newrelic_metric_type
측정항목 이름이 일치하지 않습니다. Squids 대시보드 및 엔티티는 Prometheus 메트릭 명명 규칙을 사용하여 Squid의 Prometheus 내보내기에서 보고하는 메트릭과 일치시킵니다. 그러나 OpenTelemetry Prometheus 수신기는 v076.3 이후 기본적으로 OpenTelemetry 명명 규칙을 사용합니다.
Prometheus 메트릭 명명 규칙을 사용하려면 OpenTelemetry 수집기를 실행할 때 pkg.translator.prometheus.NormalizeName
feature-gate
를 비활성화합니다.
$ otelcol-contrib --config ./config.yaml --feature-gates = -pkg.translator.prometheus.NormalizeName