2 sudo docker build -t my-flask-app .
4 To run the app and see collectd metrics:
6 sudo docker run -d --net=host my-flask-app
8 sudo docker run -d -p 5000:5000 my-flask-app
10 and configure collectd to use the write_http plugin:
16 URL "http://127.0.0.1:5000"
22 Format Command is used to make the output more readable for humans.
23 You can also use JSON.
25 Later the server will do something more useful.
26 To view the metrics that are being sent by collectd, run::
28 sudo docker inspect <container_id>
30 sudo docker logs <container_id>
32 Metrics from collectd-5.x will use PUTVAL
33 Metrics from collectd-6.x will use PUTMETRIC
37 127.0.0.1 - - [21/Apr/2021 19:31:49] "POST / HTTP/1.1" 200 -
38 PUTVAL fbae30cc-2f20-11b2-a85c-819293100691/turbostat-cpu00/gauge-TSC interval=10.000 1619029909.268:2112.02271161789
39 PUTVAL fbae30cc-2f20-11b2-a85c-819293100691/turbostat-cpu00/frequency-busy interval=10.000 1619029909.268:1613.51555288381
40 PUTVAL fbae30cc-2f20-11b2-a85c-819293100691/turbostat-cpu00/percent-c1 interval=10.000 1619029909.268:86.2353665532377
41 PUTVAL fbae30cc-2f20-11b2-a85c-819293100691/turbostat-cpu00/frequency-average interval=10.000 1619029909.268:222.094501460956
42 PUTVAL fbae30cc-2f20-11b2-a85c-819293100691/turbostat-pkg00/temperature interval=10.000 1619029909.268:53
43 PUTVAL fbae30cc-2f20-11b2-a85c-819293100691/turbostat-pkg00/temperature-tcc_activation interval=10.000 1619029909.268:100
44 PUTVAL fbae30cc-2f20-11b2-a85c-819293100691/turbostat-cpu04/frequency-average interval=10.000 1619029909.268:206.978572579757