18 Glances 4.0 Release Note
Nicolas Hennion edited this page 2024-05-12 09:52:55 +02:00

DRAFT UNDER CONSTRUCTION


New Features

Export individual processes stats

Thanks to the new software architecture it is now possible to export individual processes stats.

You should define the processes to export from the configuration file (section processlist /option export) or via the --export-process-filter option on the command line.

Those options are a comma separated list of Glances filter (example bellow):

  • python.*: Filter processes name or command line starting with python
  • .python.: Filter processes name or command line containing python
  • username:nicolargo: Processes belong to nicolargo user
  • cmdline:/usr/bin.*: Processes starting by /usr/bin

The following example exports all processes with the name 'python' or 'bash':

[processlist]
export=.*python.*,.*bash.*

Note: or the --export-process-filter ".python.,.bash." option in the command line.

Another example exports all processes belong to 'nicolargo' user:

[processlist]
export=username:nicolargo

Note: or the --export-process-filter "username:nicolargo" option in the command line.

Last example with the output result in a CSV file, with the following command line example:

glances -C ./conf/glances.conf --export csv --export-csv-file /tmp/glances.csv --disable-plugin all --enable-plugin processlist --quiet

the output CSV file (with the PID as primary key) will look like:

timestamp,845992.memory_percent,845992.status,845992.num_threads,845992.cpu_timesuser,845992.cpu_timessystem,845992.cpu_timeschildren_user,845992.cpu_timeschildren_system,845992.cpu_timesiowait,845992.memory_inforss,845992.memory_infovms,845992.memory_infoshared,845992.memory_infotext,845992.memory_infolib,845992.memory_infodata,845992.memory_infodirty,845992.name,845992.io_counters,845992.nice,845992.cpu_percent,845992.pid,845992.gidsreal,845992.gidseffective,845992.gidssaved,845992.key,845992.time_since_update,845992.cmdline,845992.username,total,running,sleeping,thread,pid_max
2024-04-03 18:39:55,3.692938041968513,S,138,1702.88,567.89,1752.79,244.18,0.0,288919552,12871561216,95182848,856064,0,984535040,0,firefox,1863281664,0,0.5,845992,1000,1000,1000,pid,2.2084147930145264,/snap/firefox/3836/usr/lib/firefox/firefox,nicolargo,403,1,333,1511,0
2024-04-03 18:39:57,3.692938041968513,S,138,1702.88,567.89,1752.79,244.18,0.0,288919552,12871561216,95182848,856064,0,984535040,0,firefox,1863281664,0,0.5,845992,1000,1000,1000,pid,2.2084147930145264,/snap/firefox/3836/usr/lib/firefox/firefox,nicolargo,403,1,333,1511,0

Note: more details in issue #794.

GPU plugin now support AMD GPU

Lasts Linux Kernel expose the GPU stats in the /sys/class/drm folder.

So, additionally to NVidia cards and without any external lib, Glances can display AMD GPU stats:

image

GPU plugin software architecture has been re-factorized in order to easily add others cards in the future (Intel).

Note: more details in issue #993.

Wifi plugin is back

As Glances version 4 is no longer supported Python 2, Wifi plugin has been refactor and do not need any external library.

Glances parses the /proc/net/wireless file on new Linux kernel.

image

Note: more details in issue #1377.

Refactor alias configuration

Alias has been completely refactor for all plugins in order to make it easier to configure.

Glances version 3.x and lower:

sda1_alias=InternalDisk 
sdb1_alias=ExternalDisk

Glances version 4.x and higher:

alias=sda1:InternalDisk,sdb1:ExternalDisk

Note: more details in issue #1735.

Fields descriptions and units are now available through the API

You can now get stat description and unit through the Glances version 4 API.

$ curl http://0.0.0.0:61208/api/4/cpu/total
{"total":6.3}
$ curl http://0.0.0.0:61208/api/4/cpu/total/description
"Sum of all CPU percentages (except idle)."
$ curl http://0.0.0.0:61208/api/4/cpu/total/unit
"percent"

Note: more details in issue #2630.

Make the left menu configurable

It is now possible to configure the plugins list displayed in the Curses and Web interfaces thanks to the left_menu option in the outputs section of the Glances configuration file:

[outputs]
left_menu=network,diskio

Display:

image

Quick look plugin is now configurable

By default it displays CPU, Memory and Load information.

image

Example to cam back to the Glances version 3.0 configuration (with swap instead of load):

[quicklook]
# Stats list (default is cpu,mem,load)
# Available stats are: cpu,mem,load,swap
list=cpu,mem,swap
# Graphical bar char used in the terminal user interface (default is |)
bar_char=|

Note: More information in issue #2662.

Enhance per CPU display

Number of cores increase, so the "Per CPU" plugin has been adpated in order to display the top 'n' CPU consuption ('n' is configurable from the Glances configuration file through the max_cpu_display option in the percpu section (default is 4 CPUs).

image

Note: see more details in issue #2734.

Display guest CPU statistic in the CPU plugin

On Linux, guest CPU is percentage of time a virtual CPU spends servicing another virtual CPU under the control of the kernel.

image

  • Ability to hide Engine and Pod columns in Containers #2423

A new logo !

Last and not least, thanks to Elad @eBarazi...

image

a new logo is released...

image

Improvements

Speed up Glances launch

Glances version 3 takes between 2 and 3 seconds to start. Glances version 4 takes less than 1 seconds to start, with all plugins.

See #1534 for more information.

Huge improvement of the Restful API documentation

More example and information available in the single page documentation: https://github.com/nicolargo/glances/blob/develop/docs/api.rst

Breaking changes

Python version

Support of Python 2 has been removed. Glances needs Python 3.8 or higher.

Python dependencies

For package maintainers, please note that standards dependencies have changed.

Minimal requirements for Glances version 4 are:

  • psutil
  • defusedxml
  • packaging
  • ujson
  • pydantic
  • fastapi (for WebUI / RestFull API)
  • uvicorn (for WebUI / RestFull API)
  • jinja2 (for WebUI / RestFull API)

Majors changes between Glances version 3 and version 4:

  • Bottle has been replaced by FastAPI and Uvicorn
  • CouchDB has been replaced by PyCouchDB
  • nvidia-ml-py has been replaced by py3nvml
  • pysnmp has been replaced by pysnmp-lextudio

APIs

  • XML/RPC API have changed between Glances 3 and Glances 4. It is not possible to use a Glances 3.x client with a Glances 4.x.
  • Restful API upgraded to version 4 (default entry point is http://localhost:61208/api/4).

Alias definition change in the configuration file

Glances version 3.x and lower:

sda1_alias=InternalDisk
sdb1_alias=ExternalDisk

Glances version 4.x and higher:

alias=sda1:InternalDisk,sdb1:ExternalDisk

More details in issue #1735.

Others

  • Alert data model change from a list of list to a list of dict #2633
  • Docker memory usage uses the same algorithm than docker stats #2637

All the issues corrected in this version

Enhancements:

  • Export individual processes stats #794
  • [WebUI] Feature Request: Ability to hide Engine and Pod columns in Containers #2423
  • [IP plugin] Make the public ip information more configurable (not only from the Censys service) #2732
  • Getting field information (description, unit) from the API #2630
  • Refactor alias configuration and allow alias for fs devices #1735
  • Improve alert with mininimal interval/duration configuration keys #2558
  • --stdout plugin.attr is not compliant with plugins returning list of dicts #2446
  • Lot's of log messages when a proxy is used with the Podman plugin #2714
  • [WEBUI & CURSES] Make the left menu configurable #2648
  • [WEBUI] Custom system header information #2695
  • [CURSES] Use normal color for normal text instead of an arbitrary color #2687
  • [WEBUI] Showing the full arguments on the command column of the TASKS #2634
  • Add graph export for GPU plugin (related to #2542)
  • Refactor Alert data model from list of list to list of dict #2633
  • Use enum instead of int for callback API version. #2712
  • Make the alerts number configurable (related to #2558)
  • [WebUI] Added smart plugin support #2435
  • No more threshold display in the WebUI cpu/mem and memswap plugins #2420
  • Refactor Glances curses code #2580
  • Replace Bottle by FastAPI #2181
  • Replace py3nvml with nvidia-ml-py #2688

Bug corrected:

  • Crash when reading timezone for generating alert #2659
  • Newline in container command corrupts display / hides container #2733
  • RAID plugin not showing up in Glances web UI (Docker install) #2716
  • Alerts showing different time than time plugin #2214
  • OpenBSD crash on start without a swap file/partition #2719
  • Folders plugin always fails on special directories #2518
  • Update dependency urllib3 to v2 #2397
  • Crach when ENTER key is pressed in the Alpine minimal image #2658
  • Crash when a process is pinned in the develop branch of Glances #2639
  • TERM setting causes glances to crash #2598
  • macOS: Read user config from ~/.config/glances #2641
  • Docker Prometheus issue with IRQ plugin #2564
  • Remove systemd from Curses (related to #2595)
  • Screen frequently flickers when outputting to local display #2490
  • Incorrect linux_distro in docker version glances #2439
  • Influxdb2 export not working #2407
  • Ignore/detect symlink loops in folders plugin #2494
  • Remove Clear-text logging of sensitive information - Code Scanning #36
  • Cannot start Glances 3.4.0.1 on Windows 10: SIGHUP not defined #2408
  • 3.4.0 crash on startupwith minimal deps #2401

CI and documentation:

  • New logo for Glances version 4.0 #2713
  • Update api.rst documentation #2496
  • Change Renovate config #2729
  • Docker compose password unrecognized arguments when applying docs #2698
  • Docker includes OS Release Volume mount info #2473
  • Update prometheus.rst, fix minor typos #2640
  • Fix typos and make grammatical and stylistic edits in project documentation #2625
  • MongoDB and CouchDB documentation flipped #2565
  • No module named 'influxdb' on the snap version of glances #1738

Many thinks to the contributors:

  • Bharath Vignesh J K
  • Christoph Zimmermann
  • RazCrimson
  • Robin Candau
  • Github GPG acces
  • Continuous Integration
  • Georgiy Timchenko
  • turbocrime
  • Kiskae
  • snyk-bot
  • Alexander Grigoryev
  • Claes Hallström
  • Francois Pires
  • Maarten Kossen (mpkossen)
  • Osama Albahrani
  • csteiner
  • k26pl
  • kdkd
  • monochromec
  • and all the beta testers !

Ready to install/upgrade ?

Have a look to the documentation.