8000 GitHub - crustymonkey/gdata_subm: A library for gdata submissions. This will build your metric data and submit it
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A library for gdata submissions. This will build your metric data and submit it

Notifications You must be signed in to change notification settings

crustymonkey/gdata_subm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

About

A library for Grafana data submissions. You can use this library to create data structures for submission that is compatible with the format of the write_http module for collectd.

Usage

The interface here is quite simple. To create a chunk of data for submission, you simply do the following:

from gdata_subm import Gdata

data = Gdata(
    plugin='plugin_name',
    dstypes=['gauge', 'derive', 'counter'],
    dsnames=['metric1', 'metric2', 'metric3'],
    values=[1.0, 2.0, 3.0],
    host='host.example.com',
    interval=5.0,
)

Then, you can use the http submitter to submit your data to the server.

from gdata_subm import GdataSubmit

subm = GdataSubmit(
    username='myuser',
    password='supersecret',
    url='https://receiver.example.com',
)

success = subm.send_data([data])

That's it. GdataSubmit.send_data() takes a list of Gdata objects and sends them to your server.

About

A library for gdata submissions. This will build your metric data and submit it

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0