Skip to content

detect netdata exit reasons#19617

Merged
ktsaou merged 110 commits intonetdata:masterfrom
ktsaou:restart-reason
Feb 24, 2025
Merged

detect netdata exit reasons#19617
ktsaou merged 110 commits intonetdata:masterfrom
ktsaou:restart-reason

Conversation

@ktsaou
Copy link
Member

@ktsaou ktsaou commented Feb 11, 2025

Exit reasons

  • track the reason of exit, including signals, api quit command, cmd exit command, windows service stop.
  • detects a netdata update by comparing the existing netdata binary file timestamp and size to the one found during exiting
  • detects system shutdown my monitoring for systemd dbus events for PrepareForShutdown events (and PrepareForSleep - which we don't do anything with currently)

Status file

  • a status file now keeps on disk information about the running agent, including the first fatal message encountered and its stack trace (with libunwind).
  • the file is JSON and is serialized back, when netdata restarts
  • crash detection is now based on the new status file
  • interrupted shutdown is now based on the new status file

Runtime ephmemeral files

  • Netdata uses /run/netdata (or an equivalent on all operating systems) for all ephemeral runtime files (.pid, .pipe, .lock)
  • Netdata uses file lock to ensure it does not start multiple times.

JSON/logfmt generation and parsing

  • Netdata now generates json that \n, \r, \t, \f and \b are printed like this, instead of \uXXXX.
  • Logfmt strings are also escaping these sequences the same way.
  • systemd-cat-native now defaults in treating \n as newline characters (it was disabled by default).

External plugins logging to journal

  • fixed a bug that prevented external plugins log to native journal format.

High-Performance tuning

  • use more replication threads
  • spread tier1+ points collection over time, to remove sudden spikes in data collection
  • eliminate most BUFFER rellocs for normal data collection and replication
  • use 4 libc arenas on parents

@ktsaou ktsaou merged commit d28b61e into netdata:master Feb 24, 2025
101 of 103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants