클린 시스템을 계측합니다.
팁
에이전트 컨트롤은 수퍼바이저 서비스이며, 자체적으로 텔레메트리를 수집하거나 전송하지 않습니다. 뉴렐릭에서 데이터를 보려면 에이전트 컨트롤을 설치한 후 플릿 컨트롤을 통해 에이전트(예: 인프라 에이전트 또는 NRDOT)를 배포해야 합니다.
Kubernetes
플릿 컨트롤에서 쿠버네티스 클러스터 유형의 플릿을 생성하십시오. 자세한 단계는 첫 번째 플릿 생성을 참조하십시오.
에이전트 컨트롤을 설치합니다. Kubernetes 설치 가이드를 따라 1단계에서 생성한 플릿을 선택합니다.
플릿 컨트롤에서 각 에이전트에 대한 설정을 생성하십시오. 에이전트 컨트롤이 플릿 컨트롤에 연결된 후 각 에이전트에 대한 설정을 생성하십시오. 플릿 컨트롤은 모든 에이전트 설정에 대한 권한이 있는 소스이므로, 로컬
values.yaml에 에이전트별 값을 추가하지 마십시오.
사용자 지정 설정으로 인프라 에이전트, Fluent Bit, Prometheus 및 NRDOT를 추가하는 예시이며, 이러한 각 설정은 플릿 컨트롤에서 별도의 원격 설정으로 생성되어야 합니다:
사용자 지정 톨러레이션 및 30초 수집 간격으로 뉴렐릭 인프라 에이전트를 활성화합니다.
chart_values: newrelic-infrastructure: kubelet: tolerations: - operator: "Exists" effect: "NoSchedule" - operator: "Exists" effect: "NoExecute" common: config: interval: 30s제한된 CPU 리소스로 Fluent Bit 로그 전달자를 배포합니다.
chart_values: newrelic-logging: resources: limits: cpu: 200m requests: cpu: 200m텔레메트리 볼륨을 줄이기 위해 로우 데이터 모드로 Prometheus 에이전트를 배포합니다.
chart_values: newrelic-prometheus-agent: lowDataMode: true config: kubernetes: integrations_filter: enabled: falseOpenTelemetry 수집기의 뉴렐릭 배포판을 배포합니다. 여기서는 filelog 수신기가 비활성화되어 있습니다 ― 로그 수집을 원하면 활성화하십시오.
chart_values: nr-k8s-otel-collector: receivers: filelog: enabled: false방금 생성한 원격 설정을 플릿에 추가하여 새 배포를 생성하십시오. 에이전트 컨트롤이 새 설정을 클러스터에 자동으로 적용합니다. 첫 번째 배포 생성 및 실행의 단계를 따르십시오.
데이터가 흐르고 있는지 확인하십시오. 뉴렐릭 UI에서 Infrastructure > Kubernetes로 이동하십시오. 원격 설정이 적용된 후 1~2분 이내에 클러스터가 나타나야 합니다. 나타나지 않으면 Agent Control 문제 진단, 해결을 참조하십시오.
Linux
플릿 컨트롤에서 Linux Host 유형의 플릿을 생성합니다. 자세한 단계는 첫 번째 플릿 생성을 참조하십시오.
에이전트 컨트롤을 설치합니다. Linux 설치 가이드를 따르고 1단계에서 생성한 플릿을 선택하십시오.
플릿 컨트롤에서 각 에이전트에 대한 설정을 생성하십시오. 에이전트 컨트롤이 플릿 컨트롤에 연결된 후, 각 에이전트에 대한 설정을 생성하십시오.
인프라 에이전트, nri-MySQL, nri-flex, fluentbit 및 nrdot를 추가하는 예시로, 이러한 각 설정은 플릿 컨트롤에서 별도의 원격 설정으로 생성해야 합니다:
config_agent 최소 필수 설정이 포함되어 있습니다. license_key은(는) nr-env 값 공급자를 사용하여 NEW_RELIC_LICENSE_KEY 환경 변수에서 런타임에 해석되며, custom_attributes은(는) 선택 사항이지만 필터링을 위해 권장됩니다. config_logging은(는) 시스템 syslog를 뉴렐릭 Logs로 전달합니다.
config_agent: license_key: '${nr-env:NEW_RELIC_LICENSE_KEY}' custom_attributes: env: productionconfig_logging: logging.yml: logs: - name: syslog file: /var/log/syslog attributes: logtype: linux_sysloglocalhost에서 실행 중인 MySQL 인스턴스를 모니터링합니다. 비밀번호는 nr-env 값 제공자를 사용하여 MYSQL_PASSWORD 환경 변수에서 런타임에 확인됩니다 — 자격 증명을 절대 하드코딩하지 마십시오.
config: integrations: - name: nri-mysql env: HOSTNAME: localhost PORT: 3306 USERNAME: newrelic PASSWORD: ${nr-env:MYSQL_PASSWORD} REMOTE_MONITORING: true interval: 30sdf을(를) 사용하여 루트 파일 시스템에서 디스크 사용량 통계를 수집합니다. 이 예시는 셸 명령을 실행하고 그 출력을 뉴렐릭 이벤트로 구문 분석하는 방법을 보여줍니다.
config: integrations: - name: nri-flex config: name: diskUsage apis: - event_type: DiskUsageSample commands: - run: df -kP / split: horizontal split_by: \s+ set_header: [filesystem, blocks, used, available, usePercent, mountpoint] row_start: 1호스트 메트릭 및 시스템 로그를 수집하고, APM 서비스를 위한 OTLP 수신기를 엽니다. 라이선스 키와 OTLP 엔드포인트는 에이전트 컨트롤에 의해 자동으로 주입됩니다.
config: # Variables set automatically by Agent Control: # - NEW_RELIC_LICENSE_KEY: New Relic ingest license key. # - OTEL_EXPORTER_OTLP_ENDPOINT: OTLP endpoint (see: https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/).
extensions: health_check:
receivers: otlp: protocols: grpc: http:
hostmetrics: collection_interval: 60s scrapers: cpu: metrics: system.cpu.time: enabled: false system.cpu.utilization: enabled: true load: memory: metrics: system.memory.utilization: enabled: true paging: metrics: system.paging.utilization: enabled: false system.paging.faults: enabled: false filesystem: metrics: system.filesystem.utilization: enabled: true disk: metrics: system.disk.merged: enabled: false system.disk.pending_operations: enabled: false system.disk.weighted_io_time: enabled: false network: metrics: system.network.connections: enabled: false # Uncomment to enable process metrics, which can be noisy but valuable. # processes: # process: # metrics: # process.cpu.utilization: # enabled: true # process.cpu.time: # enabled: false
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: metricstransform: transforms: - include: system.cpu.utilization action: update operations: - action: aggregate_labels label_set: [state] aggregation_type: mean - include: system.paging.operations action: update operations: - action: aggregate_labels label_set: [direction] aggregation_type: sum filter/exclude_cpu_utilization: metrics: datapoint: - 'metric.name == "system.cpu.utilization" and attributes["state"] == "interrupt"' - 'metric.name == "system.cpu.utilization" and attributes["state"] == "nice"' - 'metric.name == "system.cpu.utilization" and attributes["state"] == "softirq"' filter/exclude_memory_utilization: metrics: datapoint: - 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_unreclaimable"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "inactive"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "cached"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "buffered"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_reclaimable"' filter/exclude_memory_usage: metrics: datapoint: - 'metric.name == "system.memory.usage" and attributes["state"] == "slab_unreclaimable"' - 'metric.name == "system.memory.usage" and attributes["state"] == "inactive"' filter/exclude_filesystem_utilization: metrics: datapoint: - 'metric.name == "system.filesystem.utilization" and attributes["type"] == "squashfs"' filter/exclude_filesystem_usage: metrics: datapoint: - 'metric.name == "system.filesystem.usage" and attributes["type"] == "squashfs"' - 'metric.name == "system.filesystem.usage" and attributes["state"] == "reserved"' filter/exclude_filesystem_inodes_usage: metrics: datapoint: - 'metric.name == "system.filesystem.inodes.usage" and attributes["type"] == "squashfs"' - 'metric.name == "system.filesystem.inodes.usage" and attributes["state"] == "reserved"' filter/exclude_system_disk: metrics: datapoint: - 'metric.name == "system.disk.operations" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.merged" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.io" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.io_time" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.operation_time" and IsMatch(attributes["device"], "^loop.*") == true' filter/exclude_system_paging: metrics: datapoint: - 'metric.name == "system.paging.usage" and attributes["state"] == "cached"' - 'metric.name == "system.paging.operations" and attributes["type"] == "cached"' filter/exclude_network: metrics: datapoint: - 'IsMatch(metric.name, "^system.network.*") == true and attributes["device"] == "lo"' attributes/exclude_system_paging: include: match_type: strict metric_names: - system.paging.operations actions: - key: type action: delete cumulativetodelta: transform/host: metric_statements: - context: metric statements: - set(description, "") - set(unit, "") transform: 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: 100 batch: resourcedetection: detectors: ["system"] system: hostname_sources: ["os"] resource_attributes: host.id: enabled: true resourcedetection/cloud: detectors: ["gcp", "ec2", "azure"] timeout: 2s ec2: resource_attributes: host.name: enabled: false resourcedetection/env: detectors: ["env"] timeout: 2s override: true
exporters: otlphttp: endpoint: ${nr-env:OTEL_EXPORTER_OTLP_ENDPOINT} headers: api-key: ${nr-env:NEW_RELIC_LICENSE_KEY}
service: pipelines: metrics/host: receivers: [hostmetrics] processors: - memory_limiter - metricstransform - filter/exclude_cpu_utilization - filter/exclude_memory_utilization - filter/exclude_memory_usage - filter/exclude_filesystem_utilization - filter/exclude_filesystem_usage - filter/exclude_filesystem_inodes_usage - filter/exclude_system_disk - filter/exclude_network - attributes/exclude_system_paging - transform/host - resourcedetection - resourcedetection/cloud - resourcedetection/env - cumulativetodelta - batch exporters: [otlphttp] logs/host: receivers: [filelog] processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] exporters: [otlphttp] traces: receivers: [otlp] processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] exporters: [otlphttp] metrics: receivers: [otlp] processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] exporters: [otlphttp] logs: receivers: [otlp] processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] exporters: [otlphttp] extensions: [health_check]방금 생성한 원격 설정을 플릿에 추가하여 새 배포를 생성하십시오. 에이전트 컨트롤이 새 설정을 호스트에 자동으로 적용하고, 각 에이전트에 대한 OCI 패키지를 다운로드하여 설치합니다. 첫 번째 배포 생성 및 실행의 단계를 따르십시오.
데이터가 흐르고 있는지 확인합니다. 뉴렐릭 UI에서 Infrastructure > Hosts로 이동하십시오. 1~2분 내에 호스트가 표시됩니다. 표시되지 않는 경우 Agent Control 문제 진단, 해결을 참조하십시오.
윈도우
플릿 컨트롤에서 Windows 호스트 유형의 플릿을 생성하십시오. 자세한 단계는 첫 번째 플릿 생성을 참조하십시오.
에이전트 컨트롤을 설치합니다. Windows 설치 가이드를 따르고 1단계에서 생성한 플릿을 선택하십시오.
플릿 컨트롤에서 각 에이전트에 대한 설정을 생성하십시오. 에이전트 컨트롤이 플릿 컨트롤에 연결된 후, 각 에이전트에 대한 설정을 생성하십시오.
인프라 에이전트, nri-MySQL, nri-flex, fluentbit 및 nrdot를 추가하는 예시로, 이러한 각 설정은 플릿 컨트롤에서 별도의 원격 설정으로 생성해야 합니다:
config_agent 최소 필수 설정을 포함합니다. license_key은(는) nr-env 값 제공자를 사용하여 NEW_RELIC_LICENSE_KEY 환경 변수에서 런타임에 해석되며, custom_attributes은(는) 선택 사항이지만 필터링을 위해 권장됩니다. config_logging은(는) Windows 이벤트 로그를 뉴렐릭 Logs에 전달합니다.
config_agent: license_key: '${nr-env:NEW_RELIC_LICENSE_KEY}' custom_attributes: env: productionconfig_logging: windows-event-log.yml: logs: - name: windows-event-log winevtlog: channel: System attributes: logtype: windows_event_loglocalhost에서 실행 중인 MySQL 인스턴스를 모니터링합니다. 암호는 nr-env 값 공급자를 사용하여 MYSQL_PASSWORD 환경 변수에서 런타임에 확인됩니다.
config: integrations: - name: nri-mysql env: HOSTNAME: localhost PORT: 3306 USERNAME: newrelic PASSWORD: ${nr-env:MYSQL_PASSWORD} REMOTE_MONITORING: true interval: 30sPowerShell을 통해 Get-CimInstance을(를) 사용하여 논리 디스크 성능 메트릭을 수집합니다. 이 예제는 nri-flex가 PowerShell 명령을 실행하고 해당 JSON 출력을 뉴렐릭 이벤트로 구문 분석하는 방법을 보여줍니다. PowerShell v3+가 필요합니다.
config: integrations: - name: nri-flex config: name: winDiskPerf apis: - event_type: WinDiskPerfSample shell: powershell commands: - run: > Get-CimInstance -ClassName Win32_PerfFormattedData_PerfDisk_LogicalDisk | Select-Object -Property Name, PercentFreeSpace, FreeMegabytes | ConvertTo-Json호스트 메트릭을 수집하고 APM 서비스를 위한 OTLP 수신기를 엽니다. 라이선스 키와 OTLP 엔드포인트는 Agent Control에 의해 자동으로 주입됩니다.
config: # Variables set automatically by Agent Control: # - NEW_RELIC_LICENSE_KEY: New Relic ingest license key. # - OTEL_EXPORTER_OTLP_ENDPOINT: OTLP endpoint (see: https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/).
extensions: health_check:
receivers: otlp: protocols: grpc: http:
hostmetrics: collection_interval: 60s scrapers: cpu: metrics: system.cpu.time: enabled: false system.cpu.utilization: enabled: true load: memory: metrics: system.memory.utilization: enabled: true paging: metrics: system.paging.utilization: enabled: false system.paging.faults: enabled: false filesystem: metrics: system.filesystem.utilization: enabled: true disk: metrics: system.disk.merged: enabled: false system.disk.pending_operations: enabled: false system.disk.weighted_io_time: enabled: false network: metrics: system.network.connections: enabled: false
processors: metricstransform: transforms: - include: system.cpu.utilization action: update operations: - action: aggregate_labels label_set: [state] aggregation_type: mean - include: system.paging.operations action: update operations: - action: aggregate_labels label_set: [direction] aggregation_type: sum filter/exclude_cpu_utilization: metrics: datapoint: - 'metric.name == "system.cpu.utilization" and attributes["state"] == "interrupt"' - 'metric.name == "system.cpu.utilization" and attributes["state"] == "nice"' - 'metric.name == "system.cpu.utilization" and attributes["state"] == "softirq"' filter/exclude_memory_utilization: metrics: datapoint: - 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_unreclaimable"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "inactive"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "cached"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "buffered"' - 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_reclaimable"' filter/exclude_memory_usage: metrics: datapoint: - 'metric.name == "system.memory.usage" and attributes["state"] == "slab_unreclaimable"' - 'metric.name == "system.memory.usage" and attributes["state"] == "inactive"' filter/exclude_filesystem_utilization: metrics: datapoint: - 'metric.name == "system.filesystem.utilization" and attributes["type"] == "squashfs"' filter/exclude_filesystem_usage: metrics: datapoint: - 'metric.name == "system.filesystem.usage" and attributes["type"] == "squashfs"' - 'metric.name == "system.filesystem.usage" and attributes["state"] == "reserved"' filter/exclude_filesystem_inodes_usage: metrics: datapoint: - 'metric.name == "system.filesystem.inodes.usage" and attributes["type"] == "squashfs"' - 'metric.name == "system.filesystem.inodes.usage" and attributes["state"] == "reserved"' filter/exclude_system_disk: metrics: datapoint: - 'metric.name == "system.disk.operations" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.merged" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.io" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.io_time" and IsMatch(attributes["device"], "^loop.*") == true' - 'metric.name == "system.disk.operation_time" and IsMatch(attributes["device"], "^loop.*") == true' filter/exclude_system_paging: metrics: datapoint: - 'metric.name == "system.paging.usage" and attributes["state"] == "cached"' - 'metric.name == "system.paging.operations" and attributes["type"] == "cached"' filter/exclude_network: metrics: datapoint: - 'IsMatch(metric.name, "^system.network.*") == true and attributes["device"] == "lo"' attributes/exclude_system_paging: include: match_type: strict metric_names: - system.paging.operations actions: - key: type action: delete cumulativetodelta: transform/host: metric_statements: - context: metric statements: - set(description, "") - set(unit, "") transform: 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: 100 batch: resourcedetection: detectors: ["system"] system: hostname_sources: ["os"] resource_attributes: host.id: enabled: true resourcedetection/cloud: detectors: ["gcp", "ec2", "azure"] timeout: 2s ec2: resource_attributes: host.name: enabled: false resourcedetection/env: detectors: ["env"] timeout: 2s override: true
exporters: otlphttp: endpoint: ${nr-env:OTEL_EXPORTER_OTLP_ENDPOINT} headers: api-key: ${nr-env:NEW_RELIC_LICENSE_KEY}
service: pipelines: metrics/host: receivers: [hostmetrics] processors: - memory_limiter - metricstransform - filter/exclude_cpu_utilization - filter/exclude_memory_utilization - filter/exclude_memory_usage - filter/exclude_filesystem_utilization - filter/exclude_filesystem_usage - filter/exclude_filesystem_inodes_usage - filter/exclude_system_disk - filter/exclude_network - attributes/exclude_system_paging - transform/host - resourcedetection - resourcedetection/cloud - resourcedetection/env - cumulativetodelta - batch exporters: [otlphttp] traces: receivers: [otlp] processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] exporters: [otlphttp] metrics: receivers: [otlp] processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] exporters: [otlphttp] logs: receivers: [otlp] processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] exporters: [otlphttp] extensions: [health_check]방금 생성한 원격 설정을 플릿에 추가하여 새 배포를 생성하십시오. 에이전트 컨트롤이 새 설정을 호스트에 자동으로 적용하고, 각 에이전트에 대한 OCI 패키지를 다운로드하여 설치합니다. 첫 번째 배포 생성 및 실행의 단계를 따르십시오.
데이터가 흐르고 있는지 확인합니다. 뉴렐릭 UI에서 Infrastructure > Hosts로 이동하십시오. 1~2분 내에 호스트가 표시됩니다. 표시되지 않는 경우 Agent Control 문제 진단, 해결을 참조하십시오.
이미 에이전트가 설치되어 있는 경우, 대신 에이전트 제어로 마이그레이션을 참조하십시오.