infra-lite

command module
v0.0.0-...-57da3e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

README

infra-lite

Sends CPU, Memory, Network and Storage metrics to NR metric api

Overview

To use this utility, configure the following environment variables:

  • NEW_RELIC_LICENSE_KEY
  • NEW_RELIC_APP_NAME
  • NRIA_LOG_FILE
  • NRIA_VERBOSE
  • WORKLOAD_NAME
  • POLL_INTERVAL
  • METRIC_PREFIX

The NEW_RELIC_LICENSE_KEY environment variable is required. The others have default values.

This utility will sample every 30s, pulling CPU, Memory, Network and Storage metrics from the host or container. You can adjust POLL_INTERVAL as needed, to override the default 30s.

The agent will log startup information and errors to ./infra-lite.log by default. Use NRIA_LOG_FILE to override this filename. Set NRIA_VERBOSE to 1 to log any warnings.

It will then send the following Metric data to the NR Metric API:

  • container.CpuPercent
  • container.CpuUserPercent
  • container.CpuSystemPercent
  • container.MemoryTotalBytes
  • container.MemoryFreeBytes
  • container.MemoryUsedBytes
  • container.MemoryFreePercent
  • container.MemoryUsedPercent
  • container.MemoryCachedBytes
  • container.SwapTotalBytes
  • container.SwapFreeBytes
  • container.SwapUsedBytes
  • container.NetworkReceiveBytesPerSec
  • container.NetworkReceiveErrorsPerSec
  • container.NetworkTransmitBytesPerSec
  • container.NetworkTransmitErrorsPerSec
  • container.DiskUsedBytes
  • container.DiskUsedPercent
  • container.DiskFreeBytes
  • container.DiskFreePercent
  • container.DiskTotalBytes
  • container.DiskReadBytesPerSec
  • container.DiskWriteBytesPerSec
  • container.DiskReadWriteBytesPerSecond

Adjust the metric name prefix "container" if desired with the environment variable METRIC_PREFIX

You can then query these meterics in NR1 from the Metric namespace using NRQL.

Build

Requires Go installed. To build:

go get
go build

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL