summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/pandas/pandas.conf
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/python.d.plugin/pandas/pandas.conf')
-rw-r--r--collectors/python.d.plugin/pandas/pandas.conf24
1 files changed, 23 insertions, 1 deletions
diff --git a/collectors/python.d.plugin/pandas/pandas.conf b/collectors/python.d.plugin/pandas/pandas.conf
index 6684af9d..ca523ed3 100644
--- a/collectors/python.d.plugin/pandas/pandas.conf
+++ b/collectors/python.d.plugin/pandas/pandas.conf
@@ -188,4 +188,26 @@ update_every: 5
# df_steps: >
# pd.read_xml('http://metwdb-openaccess.ichec.ie/metno-wdb2ts/locationforecast?lat=54.7210798611;long=-8.7237392806', xpath='./product/time[1]/location/temperature', parser='etree')|
# df.rename(columns={'value': 'dublin'})|
-# df[['dublin']]| \ No newline at end of file
+# df[['dublin']]|
+
+# example showing a read_sql from a postgres database using sqlalchemy.
+# note: example assumes a running postgress db on localhost with a netdata users and password netdata.
+# sql:
+# name: "sql"
+# update_every: 5
+# chart_configs:
+# - name: "sql"
+# title: "SQL Example"
+# family: "sql.example"
+# context: "example"
+# type: "line"
+# units: "percent"
+# df_steps: >
+# pd.read_sql_query(
+# sql='\
+# select \
+# random()*100 as metric_1, \
+# random()*100 as metric_2 \
+# ',
+# con=create_engine('postgresql://localhost/postgres?user=netdata&password=netdata')
+# );