Skip to content

Commit 42b344b

Browse files
committed
add curl post example
1 parent e983d0a commit 42b344b

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,26 @@ SELECT string_agg(v,'') AS ret FROM results
574574
![Example statsd graph](/pics/metrics-statsd.png)
575575

576576

577+
## Simple POST to couchdb metric host with curl
578+
579+
```
580+
echo "{ \"name\": \"myhost.mymetric\", \"type\": \"mymetric\", \"ts\": `date +%s`, \"value\": 321 }" | \
581+
curl -s -H "Accept: application/json" -H 'Content-Type: application/json' -X POST -d @- http://192.168.3.21:5984/abtest
582+
```
583+
584+
Will add the below metric doc:
585+
```
586+
{
587+
"_id": "3ad893cb4cf1560add7b4caffd4b6515",
588+
"_rev": "1-eaccefb96599f0543cf5053ffb36595d",
589+
"name": "myhost.mymetric",
590+
"type": "mymetric",
591+
"ts": 1445787153,
592+
"value": 321
593+
}
594+
```
595+
596+
577597
## TODO
578598

579599
Simple stuff to do:
@@ -590,8 +610,6 @@ Needs a better name - suggestions please.
590610

591611
Further metrics data sources ideas:
592612

593-
couch monitoring - https://github.com/gws/munin-plugin-couchdb - maybe just dump /_stats periodically as a new doc into couch?
594-
595613
snmp - add metric data from snmp source
596614

597615
fluentd - https://github.com/ixixi/fluent-plugin-couch - log stuff instead of logstash and elasticsearch
@@ -602,7 +620,5 @@ maybe add a filer $text for sql like $interval on normal graph panel for quick d
602620

603621
example pouchdb to couchdb collecting metrics from mobile device / web browser
604622

605-
example adding metric via curl post/put to couch
606-
607623
example rollup stuff for aggregate/archiving/make new tables in postgres based on timestamp - pg function(s) to be run periodically to automate? - note with over 2 million docs the dashboard with 6 graphs and multiple series takes under 3 secs to redraw all of them with where clause on the timestamps at 24hrs so all datapoints for last 24hrs are being loaded. - note on http_pgsql extension to deal with managing/archivng couchdbs.
608624

0 commit comments

Comments
 (0)