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

이 한글 문서는 사용자의 편의를 위해 기계 번역되었습니다.

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

호스트 모니터링을 위한 수집기

OpenTelemetry를 사용하여 인프라 호스트에서 메트릭 및 로그를 수집하고 New Relic 에이전트에 사용할 수 있는 것과 동일한 인프라 경험을 활용할 수 있습니다. 호스트 원격 측정을 수집하고 보고하려면 OTel 수집기에 특정 수신기와 프로세서가 필요합니다.

다른 수집기 사용 사례에 대한 도움말을 찾고 있다면 newrelic-opentelemetry-examples 리포지토리를 참조하세요.

1단계: 전제 조건

계속 진행하기 전에 다음을 완료했는지 확인하세요.

  • 아직 등록하지 않았다면 무료 New Relic 계정 에 등록하십시오.

  • 데이터를 보고하려는 뉴렐릭 계정의

    를 가져옵니다.

2단계: OpenTelemetry 수집기 설치

클라우드 또는 온프레미스의 단일 호스트에 대한 기본 설치를 수행하려면 커뮤니티의 최신 설치 단계에 대한 OpenTelemetry의 지침 을 참조하십시오. 다음에 대한 지침을 사용할 수 있습니다.

  • 리눅스: 데비안 시스템
  • 리눅스: 레드햇
  • 윈도우
  • Docker, Kubernetes 및 기타 옵션

배포 환경은 사용하는 공급업체별 배포에 따라 다를 수 있습니다. 예를 들어 패키지 관리자를 통한 설치는 Linux 호스트에서 사용할 수 있습니다.

중요

인프라 모니터링을 설정하려면 collector-contrib 릴리스에 포함된 구성요소를 설치하고 구성해야 합니다. 예를 들어 호스트 수신기는 CPU, 메모리, 디스크 및 네트워크 통계와 같은 기본 호스트 메트릭을 수집하는 데 필요하며 OpenTelemetry Collector-contrib 릴리스에서만 사용할 수 있습니다.

3단계: 호스트 메트릭 및 로그 구성

이 수집기 예제는 프로덕션에서 사용하기 전에 구성을 확장, 사용자 정의 및 검증할 수 있는 시작점 역할을 합니다.

collector-contrib 릴리스에는 다음이 포함됩니다.

  • 다양한 소스에서 스크랩한 시스템에 대한 측정항목을 생성하는 hostmetrics 수신자입니다. hostmetrics 수신기를 사용할 때 수집기를 에이전트로 배포합니다.
  • 파일의 로그를 추적하고 파싱하는 filelog 수신자입니다.

수집기 구성의 일부로 hostmetrics 수신기를 사용하는 경우 New Relic은 호스트 측정항목을 Host 항목의 일부로 감지합니다. 이는 New Relic 인프라 에이전트와 동일한 경험을 갖게 된다는 것을 의미합니다. 이 작업을 수행하려면 다음 구성 요구 사항을 충족해야 합니다.

  • host.id 속성이 호스트 메트릭에 있습니다.
  • service.namecontainer.id 속성은 호스트 측정항목에 없습니다.

GitHub의 OpenTelemetry 설명서에서 사용 가능한 지표 및 고급 구성에 대해 자세히 알아보세요.

다음은 Linux 호스트에 대한 샘플 구성 YAML 파일입니다. 다음을 수행하십시오.

  • $NEW_RELIC_OTLP_ENDPOINT env var를 적절한 엔드포인트 로 설정합니다.

  • $NEW_RELIC_API_KEY 환경 변수를

    로 설정합니다.

  • 요구 사항에 따라 filelog 수신기 섹션에서 대상 로그 파일을 조정합니다.

  • 환경 요구사항에 따라 memory_limiter 기본값을 조정합니다.

  • 일부 구성은 로컬 데모에 유용하지만 프로덕션 배포에는 필요하지 않을 수 있습니다. 이러한 섹션과 설명 주석을 검토하고 필요에 따라 제거하십시오.

작업 코드 예제는 OpenTelemetry 수집 설정을 통한 호스트 모니터링을 참조하세요.

extensions:
health_check:
receivers:
otlp:
protocols:
grpc:
http:
hostmetrics:
# Mount the host file system when running in docker so we can monitor the host system,
# not the docker container. For more info see:
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver#collecting-host-metrics-from-inside-a-container-linux-only
# Delete for production deployments.
root_path: ${HOST_METRICS_ROOT_PATH}
collection_interval: 20s
scrapers:
cpu:
metrics:
system.cpu.utilization:
enabled: true
load:
memory:
metrics:
system.memory.utilization:
enabled: true
disk:
filesystem:
metrics:
system.filesystem.utilization:
enabled: true
# Reading /containers/services causes error running in docker.
# Delete for production deployments.
exclude_mount_points:
mount_points: ["/containers/services"]
match_type: strict
network:
paging:
metrics:
system.paging.utilization:
enabled: true
processes:
process:
metrics:
process.cpu.utilization:
enabled: true
process.cpu.time:
enabled: false
# Mute various errors reading process metrics running locally in docker.
# Delete for production deployments.
mute_process_exe_error: true
mute_process_user_error: true
mute_process_io_error: true
filelog:
include:
- /var/log/alternatives.log
- /var/log/cloud-init.log
- /var/log/auth.log
- /var/log/dpkg.log
- /var/log/syslog
- /var/log/messages
- /var/log/secure
- /var/log/yum.log
processors:
transform/truncate:
trace_statements:
- context: span
statements:
- truncate_all(attributes, 4095)
- truncate_all(resource.attributes, 4095)
log_statements:
- context: log
statements:
- truncate_all(attributes, 4095)
- truncate_all(resource.attributes, 4095)
memory_limiter:
check_interval: 1s
limit_mib: 1000
spike_limit_mib: 200
batch:
resourcedetection:
detectors: ["env", "system"]
system:
hostname_sources: ["os"]
resource_attributes:
host.id:
enabled: true
resourcedetection/cloud:
detectors: ["gcp", "ec2", "azure"]
timeout: 2s
override: false
# host.id is required for NewRelic host entity synthesis and relationships, but is
# not included by any resourcedetection detector when running with docker on macOS.
# We include a fallback value for demonstration purposes.
# Delete for production deployments.
resource:
attributes:
- key: host.id
value: localhost
action: upsert
exporters:
otlphttp:
endpoint: $NEW_RELIC_OTLP_ENDPOINT
headers:
api-key: $NEW_RELIC_API_KEY
service:
pipelines:
metrics/hostmetrics:
receivers: [hostmetrics]
processors: [memory_limiter, resourcedetection, resourcedetection/cloud, resource, batch]
exporters: [otlphttp]
metrics:
receivers: [otlp]
processors: [memory_limiter, transform/truncate, resourcedetection, resourcedetection/cloud, resource, batch]
exporters: [otlphttp]
traces:
receivers: [otlp]
processors: [memory_limiter, transform/truncate, resourcedetection, resourcedetection/cloud, resource, batch]
exporters: [otlphttp]
logs:
receivers: [otlp, filelog]
processors: [memory_limiter, transform/truncate, resourcedetection, resourcedetection/cloud, resource, batch]
exporters: [otlphttp]
extensions: [health_check]

4단계: 데이터 보기

New Relic UI의 다양한 위치에서 수집가 데이터를 볼 수 있습니다.

인프라 UI에서 호스트 데이터 찾아보기

수집기에서 권장 구성을 사용하면 인프라 UI 환경의 표준 기능을 통해 데이터를 볼 수 있습니다.

쿼리 호스트 메트릭 및 로그

원격 분석이 New Relic에서 성공적으로 수집되면 메트릭 및 이벤트쿼리 빌더 에서 사용할 수 있습니다.

다음 NRQL 쿼리는 수신한 메트릭을 탐색하는 데 도움이 되는 예를 보여줍니다.

  • 측정항목 이름으로 수집된 측정항목 업데이트 수 나열

    SELECT count(*) FROM Metric WHERE metricName LIKE 'system.%' FACET metricName LIMIT max
  • 호스트가 패싯 처리한 특정 메트릭 쿼리

    SELECT average(system.disk.operations) FROM Metric FACET host.name TIMESERIES
  • 특정 측정항목에 사용할 수 있는 측정기준 나열

    SELECT keyset() FROM Metric WHERE metricName = 'system.disk.operations'
  • 호스트당 로그 이벤트 수 조회

    SELECT count(*) FROM Log FACET host.name TIMESERIES

측정항목 데이터 유형 쿼리에 대해 자세히 알아보세요.

다음은 뭐지?

수집기를 설정한 후 모범 사례 가이드에서 OpenTelemetry 및 New Relic 사용을 개선하기 위한 팁을 확인하세요.

Copyright © 2024 New Relic Inc.

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