Added support to influxdb v.2 with compatible v.1 buckets (#3764)

This commit is contained in:
Matteo Biscosi 2024-06-19 17:16:54 +02:00
parent 344a2b4736
commit d65b78ecbf
3 changed files with 138 additions and 105 deletions

View file

@ -73,11 +73,19 @@ end
-- ##############################################
function influxdb_export_api.exportStorageSize(when, influxdb)
local disk_bytes = influxdb:getDiskUsage()
local ifid = getSystemInterfaceId()
local skip = ntop.getCache(influxdb:getSkipRetentionAndCreationKey())
if isEmptyString(skip) then
skip = false
else
skip = toboolean(skip) or false
end
if(disk_bytes ~= nil) then
ts_utils_core.append("influxdb:storage_size", { ifid = ifid, disk_bytes = disk_bytes }, when)
if (not skip) then
local disk_bytes = influxdb:getDiskUsage()
local ifid = getSystemInterfaceId()
if(disk_bytes ~= nil) then
ts_utils_core.append("influxdb:storage_size", { ifid = ifid, disk_bytes = disk_bytes }, when)
end
end
end