Skip to main content

A helper library for pulling data from netdata into a pandas dataframe.

Project description

netdata-pandas

A helper library to pull data from netdata api into a pandas dataframe.

pypi package CI

Install

pip install netdata-pandas

Documentation

More detailed documentation can be found at https://netdata.github.io/netdata-pandas

Quickstart

Get some data into a pandas dataframe.

from netdata_pandas.data import get_data

df = get_data('london.my-netdata.io', ['system.cpu','system.load'], after=-60, before=0)
print(df.shape)
print(df.head())
(60, 12)
            system.cpu|guest  system.cpu|guest_nice  system.cpu|iowait  \
time_idx                                                                 
1604928205               0.0                    0.0                0.0   
1604928206               0.0                    0.0                0.0   
1604928207               0.0                    0.0                0.0   
1604928208               0.0                    0.0                0.0   
1604928209               0.0                    0.0                0.0   

            system.cpu|irq  system.cpu|nice  system.cpu|softirq  \
time_idx                                                          
1604928205             0.0              0.0                 0.0   
1604928206             0.0              0.0                 0.0   
1604928207             0.0              0.0                 0.0   
1604928208             0.0              0.0                 0.0   
1604928209             0.0              0.0                 0.0   

            system.cpu|steal  system.cpu|system  system.cpu|user  \
time_idx                                                           
1604928205          0.000000           0.501253         0.501253   
1604928206          0.000000           0.753769         0.502513   
1604928207          0.000000           0.505050         0.505050   
1604928208          0.000000           0.751880         0.501253   
1604928209          0.251256           0.251256         0.502513   

            system.load|load1  system.load|load15  system.load|load5  
time_idx                                                              
1604928205               0.03                 0.0               0.04  
1604928206               0.03                 0.0               0.04  
1604928207               0.03                 0.0               0.04  
1604928208               0.03                 0.0               0.04  
1604928209               0.03                 0.0               0.04  

An alternative way to call get_data() is to define what hosts and charts you want via the host_charts_dict param:

# define list of charts for each host you want data for
host_charts_dict = {
    "london.my-netdata.io" : ['system.io','system.ip'],
    "newyork.my-netdata.io" : ['system.io','system.net'],
}
df = get_data(host_charts_dict=host_charts_dict, host_prefix=True)
print(df.shape)
print(df.head())
(61, 8)
            london.my-netdata.io::system.io|in  \
time_idx                                         
1604928340                                 NaN   
1604928341                                 0.0   
1604928342                                 0.0   
1604928343                                 0.0   
1604928344                                 0.0   

            london.my-netdata.io::system.io|out  \
time_idx                                          
1604928340                                  NaN   
1604928341                            -53.89722   
1604928342                            -26.10278   
1604928343                              0.00000   
1604928344                              0.00000   

            london.my-netdata.io::system.ip|received  \
time_idx                                               
1604928340                                       NaN   
1604928341                                  49.25227   
1604928342                                 227.22840   
1604928343                                 123.56787   
1604928344                                  31.99060   

            london.my-netdata.io::system.ip|sent  \
time_idx                                           
1604928340                                   NaN   
1604928341                             -51.85469   
1604928342                             -85.22854   
1604928343                             -43.00154   
1604928344                             -19.55536   

            newyork.my-netdata.io::system.io|in  \
time_idx                                          
1604928340                                  0.0   
1604928341                                  0.0   
1604928342                                  0.0   
1604928343                                  0.0   
1604928344                                  0.0   

            newyork.my-netdata.io::system.io|out  \
time_idx                                           
1604928340                              0.000000   
1604928341                             -6.545929   
1604928342                             -9.454071   
1604928343                              0.000000   
1604928344                              0.000000   

            newyork.my-netdata.io::system.net|received  \
time_idx                                                 
1604928340                                   13.778033   
1604928341                                   18.281470   
1604928342                                   24.811770   
1604928343                                   26.406000   
1604928344                                   26.457510   

            newyork.my-netdata.io::system.net|sent  
time_idx                                            
1604928340                               -16.97193  
1604928341                               -19.23857  
1604928342                               -76.86994  
1604928343                              -165.55492  
1604928344                              -115.83034  

Examples

You can find some more examples in the examples folder.

Or if you just want to play with it right now you can use this Google Colab notebook to quickly get started.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netdata_pandas-0.0.39.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

netdata_pandas-0.0.39-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file netdata_pandas-0.0.39.tar.gz.

File metadata

  • Download URL: netdata_pandas-0.0.39.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for netdata_pandas-0.0.39.tar.gz
Algorithm Hash digest
SHA256 1c5a2f1a29a500758f128160663c7750ddef25e88f8afb333de831d1e3e72cd4
MD5 d4afb464b0f367421e2df33b0af709a8
BLAKE2b-256 c8026962612775e5033b4bee2c1506ef6a24b0a1930d9512d24211b58b858225

See more details on using hashes here.

File details

Details for the file netdata_pandas-0.0.39-py3-none-any.whl.

File metadata

  • Download URL: netdata_pandas-0.0.39-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for netdata_pandas-0.0.39-py3-none-any.whl
Algorithm Hash digest
SHA256 e80d1b42bda3b4f29d10a71fd4e13ce7ad54c63af553ce0c2f6eecdbc7ac3e8b
MD5 c40d3556a56df78b77d905cbb4adbf29
BLAKE2b-256 43834c04593e301bb5f2d32496c99a86182e2af5328844f81693b169cc964864

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page