* Added brief description of new configuration values.
* Documenting new header.
* Describing use of features for local debug.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
This release contains:
* record_retention_enabled configuration key: when configuration value
is enabled copies of the last 100 telemetry record payload are kept
locally.
* record_server_delivery_enabled configuration key: when this key is
set to true (default value) records are reported to server. When key
is set to false records are not sent. This configuration can be used
with record_retention_enabled to retain debug information locally
only.
* A new switch (-i/--include_record) for 'telemctl journal' command,
this switch allows the inclusion of record contents when printing
journal to standard output.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
This change contains:
* New configuration keys: record_retention_enabled and
record_server_delivery_enabled. These keys are needed to control
remote delivery of records and record retention. These keys are
optional to preserve backward compatibility with existing custom
configurations.
* Record copy implementation. This change allows to save copies of
records locally when feature is enabled in configuration. This
operation is independent of record spooling and record reporting
to remote server.
* New telem_journal argument to allow record payload print from
local copy (if it exists).
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
This change fixes memory leaks present in journal printing command line
interface and journal printing api.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
Random id generation function in telemetry.c is equivalent to function
in util.c, this change reuses the function defined in util.c in
telemetry.c and removes the no longer needed function.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
This release contains:
* A new header event_id, this value can be used by a probe or probes to
group multiple records when these records are the result of a unique
event in the system, i.e. an update could create multiple records and
these records could be tagged with a single event id.
* Telemetry record logging, this change adds a log of records reported
to telemetry server. The log can be accessed using telemctl journal
sub-command.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
Addressing comments from first code review and fixing travis-ci
check_journal error in prune test.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
This change adds a logging mechanism for records submitted to telemetry
client. A basic journal is added to keep track of the last 100 valid
records that the daemon processed.
This journal can be queried by a new command line interface that was
added as part of the change 'telem_journal'.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
* An event_id header is needed to group records when multiple records
are generated by same event.
* Adding new available parameter to telem_record_gen, making possible
for this utility to tag multiple records with same event_id.
Signed-off-by: avjarami <alex.v.jaramillo@intel.com>
This release contains:
* Fixes an issue where if the telemetry client bundle is added after
installation required directories were not created until the OS is
restarted. This change makes sure that all the required directories
are created before the telemd service is started.
* Adds an option to telemctl to indicate if telemd.service is active.
* Removes telemetry client temporary directories on telemetry opt-out.
* Add a base64 encoding routine to the nica library, this library can
be used by probes to encode binaries for http transport to telemetry
server.
* Fixes configuration parameter on hprobe.
* Adds a probe to report Boot Error Region Table if this record exists
for more information about BERT, consult ACPI spec
telemd will not start or function properly if expected directories are
not present (i.e. spool dir), this change calls systemd-tempfiles to
create dirs listed listed in telemetrics-dirs.conf
Because telemd does not restart when an update is installed the daemon
could get out of sync with probes if a new version of a probe requires a
new version of telemd. This change will trigger a restart when an update
takes place.
The call to "fprint()" is a typo and should be "fprintf()".
Also, the "error->message" string is an artifact from the time when
telemetrics-client used glib. Now it uses libnica, which propogates
errors differently. Simply remove the format specifier for now.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release bumps the record format version to account for the new
headers added in the v1.14.0 release.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Because the telemetrics-backend repo is now hosted on Github, link to it
from the client README, since it is part of a complete telemetrics
solution.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release adds three new hardware metadata fields to include in
records created by libtelemetry: board_name, cpu_model, and
bios_version.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Additional headers added: board_name, cpu_model, and bios_version.
* Board name is a combination of board_name and board_vendor from
dmi file system.
* CPU model is read from /proc/cpuinfo.
* BIOS version is taken from dmi file system.
This release introduces some changes in behavior for the crash probe and
journal probe:
* The crash probe now ensures core files are kept whenever backtraces
are scrubbed from telemetry records, or when errors occur during runtime
operation. This improves the developer experience when running ones own
programs installed at arbitrary locations on the filesystem and also
avoids data loss; either the crash backtrace is sent via telemetry, or
when unable to send the backtrace, the core file is kept.
* The journal probe, by default, now only sends telemetry for journal
log messages indicating systemd service failures. The previous behavior
of sending any log messages above a certain log level is now wrapped
behind the "opt-in-no-privacy-filters" config setting.
Bug fixes include:
* Fixing a segfault crash in the configuration code that occurred
whenever an incomplete configuration file was encountered.
* Fixing a performance issue in 'telem-record-gen' to avoid extraneous
strlen() calls in the classification input validation code.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Because log messages from services contain arbitrary data, and sometimes
this data is privacy sensitive, only enable the log level filters when
the privacy filter override is in effect.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The current behavior of the configuration code is to print a generic
error message and exit if configuration parsing fails.
To clarify the reason for exiting, and thus make the error message more
actionable, print an additional error message that describes which key
from the config is affected and the type of value it accepts.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
When a key from a INI file is missing, libnica returns NULL, so we need
to properly check for a non-NULL return value before passing it to
strdup().
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Since strlen(opt_class) is already called before this for loop, there is
no need to call it again. It also avoids repeatedly calling strlen() as
part of the for-loop conditional check.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Since the code repeats the same logic in several places, it is
convenient to split the routine into a helper function, startswith().
This also fixes a bug with the earlier port to libnica: in the
in_clr_build() function, strstr() was chosen as the replacement function
instead of strncmp(), which means a match will be found in any part of
the string. However, a match should only be found when it is a prefix.
To fix, switch the strstr() in that function to use startswith() as
well.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
During the processing of a core file or sending telemetry, any numbers
of errors may occur. Make sure the core file is not unlinked under these
conditions.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
When the path filters for privacy are in effect, backtraces are scrubbed
from records, and this results in the core files being unlinked.
However, this is not friendly behavior for the developer. A common
situation that triggers the path filters is installing custom binaries
on the system (say, under /usr/local/bin or /opt/bin) for testing
purposes. To better enable developers to debug their programs, having
the core files available to process with gdb is very valuable.
Eventually, I would like to add an opt-in to keep all core files, but
I'll wait until the configuration code is refactored.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release includes a change that results in lower memory consumption
for telemd when the service is idle.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
When the daemon is sitting idle, we are seeing libcurl consume around
2MB of memory, which had been previously allocated on-the-fly for its
global environment.
To have more control over this memory consumption, making sure the
daemon uses as little memory as possible when doing no work, explicitly
allocate the libcurl global environment before each POST and deallocate
it afterwards.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In case the value returned by SYSLOG_ACTION_SIZE_BUFFER exceeds MAX_BUF,
the buffer later allocated has size MAX_BUF, but SYSLOG_ACTION_READ may
read more than MAX_BUF bytes to store in the buffer, leading to a buffer
overrun.
Fix the issue by ensuring SYSLOG_ACTION_READ reads at most "buflen"
bytes, the size of the allocated buffer.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Since loopsize is initialized to 0, the conditional statement where
loopsize increments led to the buffer size check not being executed the
first time through the loop.
Simply remove the counter variable to fix the issue.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release completes the remaining work to remove the glib dependency
in favor of libnica.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>