Menu

Caution

Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Open source

node_exporter_config

The node_exporter_config block configures the node_exporter integration, which is an embedded version of node_exporter and allows for collecting metrics from the UNIX system that node_exporter is running on. It provides a significant amount of collectors that are responsible for monitoring various aspects of the host system.

Note that if running the Agent in a container, you will need to bind mount folders from the host system so the integration can monitor them. You can use the example below, making sure to replace /path/to/config.yaml with a path on your host machine where an Agent configuration file is:

docker run \
  --net="host" \
  --pid="host" \
  --cap-add=SYS_TIME \
  -v "/:/host/root:ro,rslave" \
  -v "/sys:/host/sys:ro,rslave" \
  -v "/proc:/host/proc:ro,rslave" \
  -v /tmp/agent:/etc/agent \
  -v /path/to/config.yaml:/etc/agent-config/agent.yaml \
  grafana/agent:v0.39.2 \
  --config.file=/etc/agent-config/agent.yaml

Use this configuration file for testing out node_exporter support, replacing the remote_write settings with settings appropriate for you:

yaml
server:
  log_level: info

metrics:
  wal_directory: /tmp/agent
  global:
    scrape_interval: 60s
    remote_write:
    - url: https://prometheus-us-central1.grafana.net/api/prom/push
      basic_auth:
        username: user-id
        password: api-token

integrations:
  node_exporter:
    enabled: true
    rootfs_path: /host/root
    sysfs_path: /host/sys
    procfs_path: /host/proc
    udev_data_path: /host/root/run/udev/data

For running on Kubernetes, ensure to set the equivalent mounts and capabilities there as well:

yaml
apiVersion: v1
kind: Pod
metadata:
  name: agent
spec:
  containers:
  - image: v0.39.2
    name: agent
    args:
    - --config.file=/etc/agent-config/agent.yaml
    securityContext:
      capabilities:
        add: ["SYS_TIME"]
      privileged: true
      runAsUser: 0
    volumeMounts:
    - name: rootfs
      mountPath: /host/root
      readOnly: true
    - name: sysfs
      mountPath: /host/sys
      readOnly: true
    - name: procfs
      mountPath: /host/proc
      readOnly: true
  hostPID: true
  hostNetwork: true
  dnsPolicy: ClusterFirstWithHostNet
  volumes:
  - name: rootfs
    hostPath:
      path: /
  - name: sysfs
    hostPath:
      path: /sys
  - name: procfs
    hostPath:
      path: /proc

The manifest and Tanka configs provided by this repository do not have the mounts or capabilities required for running this integration.

Some collectors only work on specific operating systems, documented in the table below. Enabling a collector that is not supported by the operating system the Agent is running on is a no-op.

NameDescriptionOSEnabled by default
arpExposes ARP statistics from /proc/net/arp.Linuxyes
bcacheExposes bcache statistics from /sys/fs/bcache.Linuxyes
bondingExposes the number of configured and active slaves of Linux bonding interfaces.Linuxyes
boottimeExposes system boot time derived from the kern.boottime sysctl.Darwin, Dragonfly, FreeBSD, NetBSD, OpenBSD, Solarisyes
btrfsExposes statistics on btrfs.Linuxyes
buddyinfoExposes statistics of memory fragments as reported by /proc/buddyinfo.Linuxno
cgroupsExposes number of active and enabled cgroups.Linuxno
conntrackShows conntrack statistics (does nothing if no /proc/sys/net/netfilter/ present).Linuxyes
cpuExposes CPU statistics.Darwin, Dragonfly, FreeBSD, Linux, Solaris, NetBSDyes
cpufreqExposes CPU frequency statistics.Linux, Solarisyes
devstatExposes device statistics.Dragonfly, FreeBSDno
diskstatsExposes disk I/O statistics.Darwin, Linux, OpenBSDyes
dmiExposes DMI information.Linuxyes
drbdExposes Distributed Replicated Block Device statistics (to version 8.4).Linuxno
drmExposes GPU card info from /sys/class/drm/card?/deviceLinuxno
edacExposes error detection and correction statistics.Linuxyes
entropyExposes available entropy.Linuxyes
ethtoolExposes ethtool statsLinuxno
execExposes execution statistics.Dragonfly, FreeBSDyes
fibrechannelExposes FibreChannel statistics.Linuxyes
filefdExposes file descriptor statistics from /proc/sys/fs/file-nr.Linuxyes
filesystemExposes filesystem statistics, such as disk space used.Darwin, Dragonfly, FreeBSD, Linux, OpenBSDyes
hwmonExposes hardware monitoring and sensor data from /sys/class/hwmon.Linuxyes
infinibandExposes network statistics specific to InfiniBand and Intel OmniPath configurations.Linuxyes
interruptsExposes detailed interrupts statistics.Linux, OpenBSDno
ipvsExposes IPVS status from /proc/net/ip_vs and stats from /proc/net/ip_vs_stats.Linuxyes
ksmdExposes kernel and system statistics from /sys/kernel/mm/ksm.Linuxno
lnstatExposes Linux network cache statsLinuxno
loadavgExposes load average.Darwin, Dragonfly, FreeBSD, Linux, NetBSD, OpenBSD, Solarisyes
logindExposes session counts from logind.Linuxno
mdadmExposes statistics about devices in /proc/mdstat (does nothing if no /proc/mdstat present).Linuxyes
meminfoExposes memory statistics.Darwin, Dragonfly, FreeBSD, Linux, OpenBSD, NetBSDyes
meminfo_numaExposes memory statistics from /proc/meminfo_numa.Linuxno
mountstatsExposes filesystem statistics from /proc/self/mountstats. Exposes detailed NFS client statistics.Linuxno
netclassExposes network interface info from /sys/class/net.Linuxyes
netisrExposes netisr statistics.FreeBSDyes
netdevExposes network interface statistics such as bytes transferred.Darwin, Dragonfly, FreeBSD, Linux, OpenBSDyes
netstatExposes network statistics from /proc/net/netstat. This is the same information as netstat -s.Linuxyes
network_routeExposes network route statistics.Linuxno
nfsExposes NFS client statistics from /proc/net/rpc/nfs. This is the same information as nfsstat -c.Linuxyes
nfsdExposes NFS kernel server statistics from /proc/net/rpc/nfsd. This is the same information as nfsstat -s.Linuxyes
ntpExposes local NTP daemon health to check time.anyno
nvmeExposes NVMe statistics.Linuxyes
osExposes os-release information.Linuxyes
perfExposes perf based metrics (Warning: Metrics are dependent on kernel configuration and settings).Linuxno
powersupplyclassCollects information on power supplies.anyyes
pressureExposes pressure stall statistics from /proc/pressure/.Linux (kernel 4.20+ and/or CONFIG_PSI)yes
processesExposes aggregate process statistics from /proc.Linuxno
qdiscExposes queuing discipline statistics.Linuxno
raplExposes various statistics from /sys/class/powercap.Linuxyes
runitExposes service status from runit.anyno
schedstatExposes task scheduler statistics from /proc/schedstat.Linuxyes
selinuxExposes SELinux statistics.Linuxyes
slabinfoExposes slab statistics from /proc/slabinfo.Linuxno
softirqsExposes detailed softirq statistics from /proc/softirqs.Linuxno
sockstatExposes various statistics from /proc/net/sockstat.Linuxyes
softnetExposes statistics from /proc/net/softnet_stat.Linuxyes
statExposes various statistics from /proc/stat. This includes boot time, forks and interrupts.Linuxyes
supervisordExposes service status from supervisord.anyno
sysctlExpose sysctl values from /proc/sys.Linuxno
systemdExposes service and system status from systemd.Linuxno
tapestatsExposes tape device stats.Linuxyes
tcpstatExposes TCP connection status information from /proc/net/tcp and /proc/net/tcp6. (Warning: the current version has potential performance issues in high load situations).Linuxno
textfileCollects metrics from files in a directory matching the filename pattern *.prom. The files must be using the text format defined here: https://prometheus.io/docs/instrumenting/exposition_formats/anyyes
thermalExposes thermal statistics.Darwinyes
thermal_zoneExposes thermal zone & cooling device statistics from /sys/class/thermal.Linuxyes
timeExposes the current system time.anyyes
timexExposes selected adjtimex(2) system call stats.Linuxyes
udp_queuesExposes UDP total lengths of the rx_queue and tx_queue from /proc/net/udp and /proc/net/udp6.Linuxyes
unameExposes system information as provided by the uname system call.Darwin, FreeBSD, Linux, OpenBSD, NetBSDyes
vmstatExposes statistics from /proc/vmstat.Linuxyes
wifiExposes WiFi device and station statistics.Linuxno
xfsExposes XFS runtime statistics.Linux (kernel 4.4+)yes
zfsExposes ZFS performance statistics.Linux, Solarisyes
zoneinfoExposes zone stats.Linuxno
yaml
  # Enables the node_exporter integration, allowing the Agent to automatically
  # collect system metrics from the host UNIX system.
  [enabled: <boolean> | default = false]

  # Sets an explicit value for the instance label when the integration is
  # self-scraped. Overrides inferred values.
  #
  # The default value for this integration is inferred from the agent hostname
  # and HTTP listen port, delimited by a colon.
  [instance: <string>]

  # Automatically collect metrics from this integration. If disabled,
  # the node_exporter integration will be run but not scraped and thus not remote-written. Metrics for the
  # integration will be exposed at /integrations/node_exporter/metrics and can
  # be scraped by an external process.
  [scrape_integration: <boolean> | default = <integrations_config.scrape_integrations>]

  # How often should the metrics be collected? Defaults to
  # prometheus.global.scrape_interval.
  [scrape_interval: <duration> | default = <global_config.scrape_interval>]

  # The timtout before considering the scrape a failure. Defaults to
  # prometheus.global.scrape_timeout.
  [scrape_timeout: <duration> | default = <global_config.scrape_timeout>]

  # Allows for relabeling labels on the target.
  relabel_configs:
    [- <relabel_config> ... ]

  # Relabel metrics coming from the integration, allowing to drop series
  # from the integration that you don't care about.
  metric_relabel_configs:
    [ - <relabel_config> ... ]

  # How frequent to truncate the WAL for this integration.
  [wal_truncate_frequency: <duration> | default = "60m"]

  # Monitor the exporter itself and include those metrics in the results.
  [include_exporter_metrics: <boolean> | default = false]

  # Optionally defines the list of enabled-by-default collectors.
  # Anything not provided in the list below will be disabled by default,
  # but requires at least one element to be treated as defined.
  #
  # This is useful if you have a very explicit set of collectors you wish
  # to run.
  set_collectors:
    - [<string>]

  # Additional collectors to enable on top of the default set of enabled
  # collectors or on top of the list provided by set_collectors.
  #
  # This is useful if you have a few collectors you wish to run that are
  # not enabled by default, but do not want to explicitly provide an entire
  # list through set_collectors.
  enable_collectors:
    - [<string>]

  # Additional collectors to disable on top of the default set of disabled
  # collectors. Takes precedence over enable_collectors.
  #
  # This is useful if you have a few collectors you do not want to run that
  # are enabled by default, but do not want to explicitly provide an entire
  # list through set_collectors.
  disable_collectors:
    - [<string>]

  # procfs mountpoint.
  [procfs_path: <string> | default = "/proc"]

  # sysfs mountpoint.
  [sysfs_path: <string> | default = "/sys"]

  # rootfs mountpoint. If running in docker, the root filesystem of the host
  # machine should be mounted and this value should be changed to the mount
  # directory.
  [rootfs_path: <string> | default = "/"]

  # udev data path needed for diskstats from Node exporter. When running
  # in Kubernetes it should be set to /host/root/run/udev/data.
  [udev_data_path: <string> | default = "/run/udev/data"]

  # Expose expensive bcache priority stats.
  [enable_bcache_priority_stats: <boolean>]

  # Regexp of `bugs` field in cpu info to filter.
  [cpu_bugs_include: <string>]

  # Enable the node_cpu_guest_seconds_total metric.
  [enable_cpu_guest_seconds_metric: <boolean> | default = true]

  # Enable the cpu_info metric for the cpu collector.
  [enable_cpu_info_metric: <boolean> | default = true]

  # Regexp of `flags` field in cpu info to filter.
  [cpu_flags_include: <string>]

  # Regexp of devices to ignore for diskstats.
  [diskstats_device_exclude: <string> | default = "^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$"]

  # Regexp of devices to include for diskstats. If set, the diskstat_device_exclude field is ignored.
  [diskstats_device_include: <string>]

  # Regexp of ethtool devices to exclude (mutually exclusive with ethtool_device_include)
  [ethtool_device_exclude: <string>]

  # Regexp of ethtool devices to include (mutually exclusive with ethtool_device_exclude)
  [ethtool_device_include: <string>]

  # Regexp of ethtool stats to include.
  [ethtool_metrics_include: <string> | default = ".*"]

  # Regexp of mount points to ignore for filesystem collector.
  [filesystem_mount_points_exclude: <string> | default = "^/(dev|proc|sys|var/lib/docker/.+)($|/)"]

  # Regexp of filesystem types to ignore for filesystem collector.
  [filesystem_fs_types_exclude: <string> | default = "^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$"]

  # How long to wait for a mount to respond before marking it as stale.
  [filesystem_mount_timeout: <duration> | default = "5s"]

  # Array of IPVS backend stats labels.
  #
  # The default is [local_address, local_port, remote_address, remote_port, proto, local_mark].
  ipvs_backend_labels:
    [- <string>]

  # NTP server to use for ntp collector
  [ntp_server: <string> | default = "127.0.0.1"]

  # NTP protocol version
  [ntp_protocol_version: <int> | default = 4]

  # Certify that the server address is not a public ntp server.
  [ntp_server_is_local: <boolean> | default = false]

  # IP TTL to use wile sending NTP query.
  [ntp_ip_ttl: <int> | default = 1]

  # Max accumulated distance to the root.
  [ntp_max_distance: <duration> | default = "3466080us"]

  # Offset between local clock and local ntpd time to tolerate.
  [ntp_local_offset_tolerance: <duration> | default = "1ms"]

  # Regexp of net devices to ignore for netclass collector.
  [netclass_ignored_devices: <string> | default = "^$"]

  # Ignore net devices with invalid speed values. This will default to true in
  # node_exporter 2.0.
  [netclass_ignore_invalid_speed_device: <boolean> | default = false]

  # Enable collecting address-info for every device.
  [netdev_address_info: <boolean>]

  # Regexp of net devices to exclude (mutually exclusive with include)
  [netdev_device_exclude: <string> | default = ""]

  # Regexp of net devices to include (mutually exclusive with exclude)
  [netdev_device_include: <string> | default = ""]

  # Regexp of fields to return for netstat collector.
  [netstat_fields: <string> | default = "^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans|TCPTimeouts)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$"]

  # List of CPUs from which perf metrics should be collected.
  [perf_cpus: <string> | default = ""]

  # Array of perf tracepoints that should be collected.
  perf_tracepoint:
    [- <string>]

  # Disable perf hardware profilers.
  [perf_disable_hardware_profilers: <boolean> | default = false]

  # Perf hardware profilers that should be collected.
  perf_hardware_profilers:
    [- <string>]

  # Disable perf software profilers.
  [perf_disable_software_profilers: <boolean> | default = false]

  # Perf software profilers that should be collected.
  perf_software_profilers:
    [- <string>]

  # Disable perf cache profilers.
  [perf_disable_cache_profilers: <boolean> | default = false]

  # Perf cache profilers that should be collected.
  perf_cache_profilers:
    [- <string>]

  # Regexp of power supplies to ignore for the powersupplyclass collector.
  [powersupply_ignored_supplies: <string> | default = "^$"]

  # Path to runit service directory.
  [runit_service_dir: <string> | default = "/etc/service"]

  # XML RPC endpoint for the supervisord collector.
  #
  # Setting SUPERVISORD_URL in the environment will override the default value.
  # An explicit value in the YAML config takes precedence over the environment
  # variable.
  [supervisord_url: <string> | default = "http://localhost:9001/RPC2"]

  # Numeric sysctl values to expose.
  # For sysctl with multiple numeric values,
  # an optional mapping can be given to expose each value as its own metric.
  sysctl_include:
    [- <string>]

  # String sysctl values to expose.
  sysctl_include_info:
    [- <string>]

  # Regexp of systemd units to include. Units must both match include and not
  # match exclude to be collected.
  [systemd_unit_include: <string> | default = ".+"]

  # Regexp of systemd units to exclude. Units must both match include and not
  # match exclude to be collected.
  [systemd_unit_exclude: <string> | default = ".+\\.(automount|device|mount|scope|slice)"]

  # Enables service unit tasks metrics unit_tasks_current and unit_tasks_max
  [systemd_enable_task_metrics: <boolean> | default = false]

  # Enables service unit metric service_restart_total
  [systemd_enable_restarts_metrics: <boolean> | default = false]

  # Enables service unit metric unit_start_time_seconds
  [systemd_enable_start_time_metrics: <boolean> | default = false]

  # Regexp of tapestats devices to ignore.
  [tapestats_ignored_devices: <string> | default = "^$"]

  # Directory to read *.prom files from for the textfile collector.
  [textfile_directory: <string> | default = ""]

  # Regexp of fields to return for the vmstat collector.
  [vmstat_fields: <string> | default = "^(oom_kill|pgpg|pswp|pg.*fault).*"]