Override "update every" using docker compose

Problem/Question

To be able to override the update everysetting without having to edit the netdata.conf file.

Relevant docs you followed/actions you took to solve the issue

I would like to adjust the update every values for several of my docker containers. I store my docker configuration as code in git repositories.

My docker compose file mounts /etc/netdata to a host accessible location so that I can manage extra *.conf files for various plugins. Rather than pull the netdata.conf file (which may be updated over time) I’d like to pass an environment variable, or include a netdata.d.conf file, or something similar.

I note the latest stock version of netdata.conf contains the override update every under the [global statistics] section:

[global statistics]
	# update every = 1

I am trying to find a definitive and official list of environment variables. I did find an interesting note under External Plugins API section environment variables that seems to indicate that these variables may be for plugins only.

There’s also the environment variables that lists TZ, but it doesn’t seem to be a definitive list of all supported Netdata environment variables.

Q1: Where are the environment variables supported by the docker netdata image located in the documentation?

Q2: Is it possible to include a netdata.conf file that ONLY has an updated value, for example update ever = 4?

Q3: Does the NETDATA_UPDATE_EVERY environment variable do what I need?

Environment/Browser/Agent’s version etc

Here’s my docker configuration file:

version: '3'

services:
  netdata:
    image: netdata/netdata:stable
    container_name: netdata
    hostname: ${HOSTNAME}-netdata
    ports:
      - 19999:19999
    pid: host
    cap_add:
      - SYS_PTRACE
      - SYS_ADMIN
    security_opt:
      - apparmor:unconfined
    environment:
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - ${APPDATA}:/etc/netdata
      - netdatalib:/var/lib/netdata
      - netdatacache:/var/cache/netdata
      - /etc/passwd:/host/etc/passwd:ro
      - /etc/group:/host/etc/group:ro
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /etc/os-release:/host/etc/os-release:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped

volumes:
  netdatalib:
  netdatacache:

What I expected to happen

For someone with Netdata knowledge to answer my questions :slight_smile:

Hi, @InstantDreams.

Does the NETDATA_UPDATE_EVERY environment variable do what I need?

No.

Is it possible to include a netdata.conf file that ONLY has an updated value, for example update ever = 4 ?

Yes. Just a file with 2 lines, e.g.:

[db]
  update every = 4

If I include a netdata.conf file that contains the following:

[global statistics]
	update every = 4

Will this automatically set the following:

[db]
	update every = 4

[statsd]
	update every (flushInterval) = 4

[plugin:charts.d]
	update every = 4


[plugin:proc:diskspace]
	update every = 4

[plugin:perf]
	update every = 4

[plugin:apps]
	update every = 4

[plugin:ioping]
	update every = 4

[plugin:cgroups]
	update every = 4

[plugin:go.d]
	update every = 4

[plugin:fping]
	update every = 4

[plugin:python.d]
	update every = 4

[plugin:freeipmi]
	update every = 4

Or will I need to include each of these sections with their update every key value pair?

Once I’ve done this and restarted the docker container, how can I confirm the refresh value have taken?

It is supposed to do so. It is global minimum update_every.