Skip to content

Instantly share code, notes, and snippets.

@tyzbit
Last active October 21, 2021 13:52
Show Gist options
  • Save tyzbit/f075e3b49b05892d3062dbb65390d56d to your computer and use it in GitHub Desktop.
Save tyzbit/f075e3b49b05892d3062dbb65390d56d to your computer and use it in GitHub Desktop.
New Relic Days until k8s Volume is full (reaches 99%)
FROM K8sVolumeSample 
SELECT min(fsAvailableBytes / 1024 / 1024 / 1024) as 'GiB Free',
       clamp_min(
         (100 - 1 - stddev(fsUsedPercent) - max(fsUsedPercent))
           /
         clamp_min(
           deriv(fsUsedPercent, 1 days)
         ,0.00000313)
       ,0) as 'Days until full'
WHERE fsAvailableBytes > 0
AND volumeName NOT LIKE '%token%'
FACET pvcName SINCE 1 day ago
LIMIT MAX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment