-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
Bug description
A custom python.d plugin collects integer counter values every second.
The chart uses algorithm: absolute, and data is queried via Netdata’s API with tier=0 and raw options.
However, the API response occasionally includes fractional numbers, even though only integers are collected.
Example API response (/api/v3/data):
[1760926238,[689,0,0,1]],
[1760926237,[687,0,0,1]],
[1760926236,[686.0026,0,0,1]], // fractional value
[1760926235,[686,0,0,1]],
[1760926234,[685,0,0,1]],
[1760926233,[684,0,0,1]],
[1760926232,[683,0,0,1]],
[1760926231,[681,0,0,1]],
[1760926230,[680.002,0,0,1]], // fractional value
[1760926229,[680,0,0,1]]Query used:
/api/v3/data?contexts=test
&options=raw,seconds,natural-points,unaligned,selected-tier
&tier=0
&time_group=sumPython.d Plugin code:
from bases.FrameworkServices.SimpleService import SimpleService
update_every = 1
priority = 2
ORDER = ['test']
CHARTS = {
'test': {
'options': [None, 'Bandwidth', 'bytes/s', 'traffic', 'test.test', 'line'],
'lines': [['test', 'test', 'absolute']]
}
}
class Service(SimpleService):
def __init__(self, configuration=None, name=None):
super().__init__(configuration=configuration, name=name)
self.counter = 0
def check(self):
return True
def _get_data(self):
self.counter += 1
return {'test': int(self.counter)}Observed behavior:
- Even though integer values are stored, small fractional offsets occasionally appear (e.g., 686.0026).
- It’s unclear if this is expected due to normalization/interpolation, or a precision artifact.
- I would like to know how to retrieve the exact raw integer samples that were collected by the plugin, without any adjustments.
Environment:
- Netdata Agent: (version / build hash)
- Plugin: Custom python.d
- Host OS: (e.g., Rocky Linux 9.x)
- Update interval: update_every = 1
Expected behavior
I’d like to confirm whether there’s an official or recommended way to retrieve the exact integer samples as they were collected, including their original timestamps,
Specifically:
Is there an option or query parameter combination that guarantees “raw unprocessed samples” from the DB (tier 0)?
If not, is this behavior (floating-point interpolation/normalization) by design?
In that case, could you clarify whether there’s no mode to access the literal stored integers, and whether this should be documented as intended behavior?
Steps to reproduce
Add the above custom python.d plugin and restart Netdata.
update_every = 1, algorithm: absolute.
Let the plugin collect data for 10–20 seconds.
Query the same time window using either:
API:
curl -s "http://127.0.0.1:19999/api/v3/data?contexts=test&options=raw,seconds,natural-points,unaligned,selected-tier&tier=0&time_group=sum"Observe that some samples include fractional values (686.0026, 680.002, etc.),
even when after/before align to whole seconds and points/gtime are omitted.
(My assumption — not confirmed — is that this may be caused by time-slot normalization or interpolation in the query engine.)
Expected outcome:
A documented or supported method to obtain the exact raw integer values as collected.
If that’s not technically possible by design, clarification of why (e.g., normalization for visualization consistency) would be very helpful.
Installation method
kickstart.sh
System info
/etc/os-release:NAME="Rocky Linux"
/etc/os-release:VERSION="9.4 (Blue Onyx)"
/etc/os-release:ID="rocky"
/etc/os-release:ID_LIKE="rhel centos fedora"
/etc/os-release:VERSION_ID="9.4"
/etc/os-release:PLATFORM_ID="platform:el9"
/etc/os-release:PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
/etc/os-release:ANSI_COLOR="0;32"
/etc/os-release:LOGO="fedora-logo-icon"
/etc/os-release:CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
/etc/os-release:SUPPORT_END="2032-05-31"
/etc/os-release:ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
/etc/os-release:ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
/etc/os-release:REDHAT_SUPPORT_PRODUCT="Rocky Linux"
/etc/os-release:REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
/etc/redhat-release:Rocky Linux release 9.4 (Blue Onyx)
/etc/rocky-release:Rocky Linux release 9.4 (Blue Onyx)
/etc/system-release:Rocky Linux release 9.4 (Blue Onyx)Netdata build info
time=2025-10-21T10:47:09.214+09:00 comm=netdata source=daemon level=notice errno="2, No such file or directory" tid=964926 msg="SSL: streaming senders will skip SSL certificates verification."
Packaging:
Netdata Version ____________________________________________ : v2.5.4
Installation Type __________________________________________ : kickstart-static
Package Architecture _______________________________________ : x86_64
Package Distro _____________________________________________ : unknown
Configure Options __________________________________________ : cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_STANDARD=11 -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=Off -DCMAKE_C_FLAGS='-march=x86-64 -ffunction-sections -fdata-sections -static -O2 -funroll-loops -DNETDATA_STATIC_BUILD=1 -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/curl-local/include/curl -I/usr/include/libmnl -pipe -fexceptions -fstack-protector-strong -fstack-clash-protection -fcf-protection=full -Wno-builtin-macro-redefined -fexceptions -fno-omit-frame-pointer -funwind-tables -fasynchronous-unwind-tables' -DCMAKE_CXX_FLAGS=' -march=x86-64 -ffunction-sections -fdata-sections -static -O2 -funroll-loops -DNETDATA_STATIC_BUILD=1 -I/openssl-static/include -I/libnetfilter-acct-static/include/libnetfilter_acct -I/curl-local/include/curl -I/usr/include/libmnl -pipe -fexceptions -fstack-protector-strong -fstack-clash-protection -fcf-protection=full -Wno-builtin-macro-redefined -fexceptions -fno-omit-frame-pointer -funwind-tables -fasynchronous-unwind-tables' -DCMAKE_COMPILE_DEFINITIONS='_GNU_SOURCE' -DCMAKE_EXE_LINKER_FLAGS='-Wl,--gc-sections -static -L/openssl-static/lib64 -L/libnetfilter-acct-static/lib -lnetfilter_acct -L/usr/lib -lmnl -L/usr/lib -lzstd -L/curl-local/lib -fexceptions -fstack-protector-strong -fstack-clash-protection -fcf-protection=full -Wno-builtin-macro-redefined -fexceptions -rdynamic' -DCMAKE_SHARED_LINKER_FLAGS='-Wl,--gc-sections -static -L/openssl-static/lib64 -L/libnetfilter-acct-static/lib -lnetfilter_acct -L/usr/lib -lmnl -L/usr/lib -lzstd -L/curl-local/lib'
Default Directories:
User Configurations ________________________________________ : /opt/netdata/etc/netdata
Stock Configurations _______________________________________ : /opt/netdata/usr/lib/netdata/conf.d
Ephemeral Databases (metrics data, metadata) _______________ : /opt/netdata/var/cache/netdata
Permanent Databases ________________________________________ : /opt/netdata/var/lib/netdata
Plugins ____________________________________________________ : /opt/netdata/usr/libexec/netdata/plugins.d
Static Web Files ___________________________________________ : /opt/netdata/usr/share/netdata/web
Log Files __________________________________________________ : /opt/netdata/var/log/netdata
Lock Files _________________________________________________ : /opt/netdata/var/lib/netdata/lock
Home _______________________________________________________ : /opt/netdata/var/lib/netdata
Operating System:
Kernel _____________________________________________________ : Linux
Kernel Version _____________________________________________ : 5.14.0-503.16.1.el9_5.x86_64
Operating System ___________________________________________ : Rocky Linux
Operating System ID ________________________________________ : rocky
Operating System ID Like ___________________________________ : rhel centos fedora
Operating System Version ___________________________________ : 9.4 (Blue Onyx)
Operating System Version ID ________________________________ : none
Detection __________________________________________________ : /etc/os-release
Hardware:
CPU Cores __________________________________________________ : 8
CPU Frequency ______________________________________________ : 2200000000
RAM Bytes __________________________________________________ : 33385648128
Disk Capacity ______________________________________________ : 53687091200
CPU Architecture ___________________________________________ : x86_64
Virtualization Technology __________________________________ : kvm
Virtualization Detection ___________________________________ : systemd-detect-virt
Container:
Container __________________________________________________ : none
Container Detection ________________________________________ : systemd-detect-virt
Container Orchestrator _____________________________________ : none
Container Operating System _________________________________ : none
Container Operating System ID ______________________________ : none
Container Operating System ID Like _________________________ : none
Container Operating System Version _________________________ : none
Container Operating System Version ID ______________________ : none
Container Operating System Detection _______________________ : none
Features:
Built For __________________________________________________ : Linux
Netdata Cloud ______________________________________________ : YES
Health (trigger alerts and send notifications) _____________ : YES
Streaming (stream metrics to parent Netdata servers) _______ : YES
Back-filling (of higher database tiers) ____________________ : YES
Replication (fill the gaps of parent Netdata servers) ______ : YES
Streaming and Replication Compression ______________________ : YES (zstd lz4 gzip)
Contexts (index all active and archived metrics) ___________ : YES
Tiering (multiple dbs with different metrics resolution) ___ : YES (5)
Machine Learning ___________________________________________ : YES
Memory Allocator ___________________________________________ : system
Database Engines:
dbengine (compression) _____________________________________ : YES (zstd lz4)
alloc ______________________________________________________ : YES
ram ________________________________________________________ : YES
none _______________________________________________________ : YES
Connectivity Capabilities:
ACLK (Agent-Cloud Link: MQTT over WebSockets over TLS) _____ : YES
static (Netdata internal web server) _______________________ : YES
h2o (web server) ___________________________________________ : NO
WebRTC (experimental) ______________________________________ : NO
Native HTTPS (TLS Support) _________________________________ : YES
TLS Host Verification ______________________________________ : YES
Libraries:
LZ4 (extremely fast lossless compression algorithm) ________ : YES
ZSTD (fast, lossless compression algorithm) ________________ : YES
zlib (lossless data-compression library) ___________________ : YES
Brotli (generic-purpose lossless compression algorithm) ____ : NO
protobuf (platform-neutral data serialization protocol) ____ : YES (system)
OpenSSL (cryptography) _____________________________________ : YES
libdatachannel (stand-alone WebRTC data channels) __________ : NO
JSON-C (lightweight JSON manipulation) _____________________ : YES
libcap (Linux capabilities system operations) ______________ : NO
libcrypto (cryptographic functions) ________________________ : YES
libyaml (library for parsing and emitting YAML) ____________ : YES
libmnl (library for working with netfilter) ________________ : YES
stacktraces (library for getting stack traces) _____________ : libbacktrace (mmap, threads, data)
Plugins:
apps (monitor processes) ___________________________________ : YES
cgroups (monitor containers and VMs) _______________________ : YES
cgroup-network (associate interfaces to CGROUPS) ___________ : YES
proc (monitor Linux systems) _______________________________ : YES
tc (monitor Linux network QoS) _____________________________ : YES
diskspace (monitor Linux mount points) _____________________ : YES
freebsd (monitor FreeBSD systems) __________________________ : NO
macos (monitor MacOS systems) ______________________________ : NO
windows (monitor Windows systems) __________________________ : NO
statsd (collect custom application metrics) ________________ : YES
timex (check system clock synchronization) _________________ : YES
idlejitter (check system latency and jitter) _______________ : YES
bash (support shell data collection jobs - charts.d) _______ : YES
debugfs (kernel debugging metrics) _________________________ : YES
cups (monitor printers and print jobs) _____________________ : NO
ebpf (monitor system calls) ________________________________ : YES
freeipmi (monitor enterprise server H/W) ___________________ : NO
network-viewer (monitor TCP/UDP IPv4/6 sockets) ____________ : YES
systemd-journal (monitor journal logs) _____________________ : NO
windows-events (monitor Windows events) ____________________ : NO
nfacct (gather netfilter accounting) _______________________ : YES
perf (collect kernel performance events) ___________________ : YES
slabinfo (monitor kernel object caching) ___________________ : YES
Xen ________________________________________________________ : NO
Xen VBD Error Tracking _____________________________________ : NO
Exporters:
AWS Kinesis ________________________________________________ : NO
GCP PubSub _________________________________________________ : NO
MongoDB ____________________________________________________ : NO
Prometheus (OpenMetrics) Exporter __________________________ : YES
Prometheus Remote Write ____________________________________ : YES
Graphite ___________________________________________________ : YES
Graphite HTTP / HTTPS ______________________________________ : YES
JSON _______________________________________________________ : YES
JSON HTTP / HTTPS __________________________________________ : YES
OpenTSDB ___________________________________________________ : YES
OpenTSDB HTTP / HTTPS ______________________________________ : YES
All Metrics API ____________________________________________ : YES
Shell (use metrics in shell scripts) _______________________ : YES
Debug/Developer Features:
Trace All Netdata Allocations (with charts) ________________ : NO
Developer Mode (more runtime checks, slower) _______________ : NO
Runtime Information:
Profile ____________________________________________________ : child
Stream Parent (accept data from Children) __________________ : NO
Stream Child (send data to a Parent) _______________________ : YES
Total System Memory ________________________________________ : 33385648128
Available System Memory ____________________________________ : 23463739392Additional info
No response