• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

문제 신고

오징어 수집가

OpenTelemetry Collector를 사용하여 Squid 캐시 관리자에 대한 지표를 수집할 수 있습니다. 수집기는 원격 측정 데이터를 수집, 처리 및 New Relic(또는 관측 가능성 백엔드)으로 내보내는 OpenTelemetry의 구성 요소입니다.

Squid에서 측정항목을 수집하려면 아래 단계를 완료하세요.

1단계: 아직 가입하지 않은 경우 무료 계정에 가입

2단계: 전제 조건

Squid Prometheus 내보내기가 실행될 호스트가 squid.conf 파일에서 허용을 설정하여 Squid 캐시 관리자 에 액세스하도록 허용합니다.

squid.conf의 예:

# Given this access list
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 수집기를 다운로드하고 설치합니다.

4단계: Opentelemetry 수집기 구성

아래 예에서 config.yaml 이라는 새 파일을 만듭니다.

파일에서 다음 키를 고유한 값으로 바꿉니다.

  • 오징어:

    • SQUID_EXPORTER_HOSTNAME
    • SQUID_EXPORTER_PORT
    • SQUID_EXPORTER_METRICS_PATH
    • SQUID_CACHEMGR
  • New Relic 라이선스 키:

    • NEW_RELIC_LICENSE_KEY

SQUID_CACHEMGR 엔티티를 생성하고 연관된 대시보드를 실행하려면 레이블 squid_cachemgr: SQUID_CACHEMGR (여기서 SQUID_CACHEMGR은 고유 식별자여야 함)가 필요합니다.

receivers:
prometheus:
config:
scrape_configs:
- job_name: "squid"
static_configs:
- targets: [ "SQUID_EXPORTER_HOSTNAME:SQUID_EXPORTER_PORT" ]
labels:
squid_cachemgr: SQUID_CACHEMGR
metrics_path: SQUID_EXPORTER_METRICS_PATH
metric_relabel_configs:
- source_labels: [__name__]
regex: "^process_.*"
action: drop
exporters:
otlphttp:
endpoint: https://otlp.nr-data.net
headers:
api-key: NEW_RELIC_LICENSE_KEY
processors:
batch:
memory_limiter:
limit_mib: 400
spike_limit_mib: 100
check_interval: 5s
service:
telemetry:
logs:
pipelines:
metrics:
receivers: [prometheus]
processors: [batch, memory_limiter]
exporters: [otlphttp]

추가 구성 세부 정보는 Opentelemetry Collector 문서Prometheus 구성 문서를 확인할 수 있습니다.

4단계: 수집기 실행

Opentelemetry 수집기를 실행합니다(실행 방법은 선택한 설치 방법에 따라 다를 수 있음). 예:

/usr/bin/otelcol --config ./config.yaml

5단계: 데이터 찾기 및 사용

데이터 탐색

측정항목 탐색기를 사용하여 수집 중인 측정항목을 확인할 수 있습니다. Squid Prometheus 내보내기에서 보고하는 모든 측정항목은 SQUID_CACHEMGR 에 이름이 설정되고 squid_ 접두사로 시작하는 SQUID_CACHEMGR 항목으로 그룹화됩니다.

측정항목 데이터

squid 캐시 관리자가 보고한 스크랩된 메트릭의 두 그룹은 다음과 같습니다.

문제점 해결

문제

지표 이름이 일치하지 않습니다.

해결책

Squids 대시보드 및 엔티티는 Prometheus 메트릭 명명 규칙을 사용하여 Squid의 Prometheus 내보내기에서 보고하는 메트릭과 일치시킵니다. 그러나 OpenTelemetry Prometheus 수신기는 v076.3이후 기본적으로 OpenTelemetry 명명 규칙을 사용합니다.

Prometheus 메트릭 명명 규칙을 사용하려면 OpenTelemetry 수집기를 실행할 때 pkg.translator.prometheus.NormalizeName feature-gate 를 비활성화합니다.

bash
$
otelcol-contrib --config ./config.yaml --feature-gates=-pkg.translator.prometheus.NormalizeName
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.