Comments (7)
Check if the following can be used for this.
https://www.influxdata.com/blog/instrumenting-your-node-express-application/
which is based on https://github.com/RuntimeTools/appmetrics
The configuration of some of the appmetrics.properties is defined here: https://www.ibm.com/support/knowledgecenter/SS3KLZ/com.ibm.java.diagnostics.healthcenter.doc/topics/configproperties.html
To check first: if appmetrics is supported for arm architecture.
from balena-node-red-mqtt-nginx-tig-stack.
It is possible to install appmetrics on arm device (raspberry) by issuing the following command in one of the node-red containers:
npm install appmetrics
it takes some time as it has to compile several source files ... in the end you should get something like:
...
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
+ [email protected]
added 48 packages in 202.314s
npm info ok
node-red@84ce20ee0b54:~$
we should also in
- node_modules/appmetrics/appmetrics.properties properly set the mqtt host.
- node_modules/node-red/red.js add the require and monitor instruction.
from balena-node-red-mqtt-nginx-tig-stack.
As next step I would in node-red flow listen to topic # (is all messages) to check if it really sends an mqtt and what the topic is.
Update: I have tested it and it effectively showed many mqtt messages.
from balena-node-red-mqtt-nginx-tig-stack.
The following instruction can be executed in the node-red-test shell to activitate instrumentation:
sed -i 's?var fs = require("fs-extra");?var fs = require("fs-extra");\n\n/* JVA: adding appmetrics instructions*/\nvar appmetrics = require("appmetrics");\nvar monitoring = appmetrics.monitor();\n?' /usr/src/node-red/node_modules/node-red/red.js
from balena-node-red-mqtt-nginx-tig-stack.
Following github defines a dashboard https://github.com/RuntimeTools/appmetrics-dash
or a better link:
https://developer.ibm.com/node/2017/07/26/visualize-node-red-flow-performance-using-node-application-metrics/
It is currently not working but it might conflict with the other appmetrics module that is installed (maybe best to remove it).
from balena-node-red-mqtt-nginx-tig-stack.
I have posted below comment on site: https://developer.ibm.com/node/2017/07/26/visualize-node-red-flow-performance-using-node-application-metrics/
Hi Matthew,
This is a very interesting tutorial.
I have tried to reproduce this without much success.
So I am just wondering if this tutorial can still be used on a linux device(raspberry pi) with node.js version 8.1.3 and latest version of Node Application Metrics =4.0.1.201811271705 (Agent Core 3.2.9)
When I added the 2 following instructions after the first line in my red.js
=====================================================================
var dash = require('appmetrics-dash');
dash.attach();
===================================================================
I got the following log file
======================================================================
npm info lifecycle [email protected]~start: [email protected]
27.11.18 23:05:15 (+0100) node-red-test
27.11.18 23:05:15 (+0100) node-red-test > [email protected] start /usr/src/node-red
27.11.18 23:05:15 (+0100) node-red-test > node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"
27.11.18 23:05:15 (+0100) node-red-test
27.11.18 23:05:15 (+0100) node-red-test [Tue Nov 27 22:05:15 2018] com.ibm.diagnostics.healthcenter.loader INFO: Node Application Metrics 4.0.1.201811271705 (Agent Core 3.2.9)
27.11.18 23:05:20 (+0100) node-red-test [Tue Nov 27 22:05:20 2018] com.ibm.diagnostics.healthcenter.mqtt INFO: Connecting to broker localhost:1883
27.11.18 23:05:22 (+0100) node-red-test 27 Nov 22:05:22 - [info]
27.11.18 23:05:22 (+0100) node-red-test
27.11.18 23:05:22 (+0100) node-red-test Welcome to Node-RED
27.11.18 23:05:22 (+0100) node-red-test ===================
27.11.18 23:05:22 (+0100) node-red-test
27.11.18 23:05:22 (+0100) node-red-test 27 Nov 22:05:22 - [info] Node-RED version: v0.19.5
27.11.18 23:05:22 (+0100) node-red-test 27 Nov 22:05:22 - [info] Node.js version: v8.1.3
27.11.18 23:05:22 (+0100) node-red-test 27 Nov 22:05:22 - [info] Linux 4.14.39 arm LE
27.11.18 23:05:23 (+0100) node-red-test 27 Nov 22:05:23 - [info] Loading palette nodes
27.11.18 23:05:28 (+0100) node-red-test 27 Nov 22:05:28 - [info] Dashboard version 2.11.0 started at /node-red-test/ui
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] Settings file : /data/settings.js
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] Context store : 'default' [module=memory]
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] User directory : /data
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [warn] No active project : using default flows file
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] Flows file : /data/flows.json
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] Server now running at http://127.0.0.1:1880/node-red-test/
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [warn]
27.11.18 23:05:29 (+0100) node-red-test
27.11.18 23:05:29 (+0100) node-red-test ---------------------------------------------------------------------
27.11.18 23:05:29 (+0100) node-red-test Your flow credentials file is encrypted using a system-generated key.
27.11.18 23:05:29 (+0100) node-red-test
27.11.18 23:05:29 (+0100) node-red-test If the system-generated key is lost for any reason, your credentials
27.11.18 23:05:29 (+0100) node-red-test file will not be recoverable, you will have to delete it and re-enter
27.11.18 23:05:29 (+0100) node-red-test your credentials.
27.11.18 23:05:29 (+0100) node-red-test
27.11.18 23:05:29 (+0100) node-red-test You should set your own key using the 'credentialSecret' option in
27.11.18 23:05:29 (+0100) node-red-test your settings file. Node-RED will then re-encrypt your credentials
27.11.18 23:05:29 (+0100) node-red-test file using your chosen key the next time you deploy a change.
27.11.18 23:05:29 (+0100) node-red-test ---------------------------------------------------------------------
27.11.18 23:05:29 (+0100) node-red-test
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] Starting flows
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] Started flows
27.11.18 23:05:29 (+0100) node-red-test 27 Nov 22:05:29 - [info] [mqtt-broker:mqtt broker] Connected to broker: mqtt://mqtt:1883
27.11.18 23:05:35 (+0100) node-red-test Error: Can't set headers after they are sent.
27.11.18 23:05:35 (+0100) node-red-test at validateHeader (_http_outgoing.js:504:11)
27.11.18 23:05:35 (+0100) node-red-test at ServerResponse.setHeader (_http_outgoing.js:511:3)
27.11.18 23:05:35 (+0100) node-red-test at expressInit (/usr/src/node-red/node_modules/express/lib/middleware/init.js:30:42)
27.11.18 23:05:35 (+0100) node-red-test at Layer.handle [as handle_request] (/usr/src/node-red/node_modules/express/lib/router/layer.js:95:5)
27.11.18 23:05:35 (+0100) node-red-test at trim_prefix (/usr/src/node-red/node_modules/express/lib/router/index.js:317:13)
27.11.18 23:05:35 (+0100) node-red-test at /usr/src/node-red/node_modules/express/lib/router/index.js:284:7
27.11.18 23:05:35 (+0100) node-red-test at Function.process_params (/usr/src/node-red/node_modules/express/lib/router/index.js:335:12)
27.11.18 23:05:35 (+0100) node-red-test at next (/usr/src/node-red/node_modules/express/lib/router/index.js:275:10)
27.11.18 23:05:35 (+0100) node-red-test at query (/usr/src/node-red/node_modules/express/lib/middleware/query.js:45:5)
27.11.18 23:05:35 (+0100) node-red-test at Layer.handle [as handle_request] (/usr/src/node-red/node_modules/express/lib/router/layer.js:95:5)
...
from balena-node-red-mqtt-nginx-tig-stack.
I also reported RuntimeTools/appmetrics-dash#167
from balena-node-red-mqtt-nginx-tig-stack.
Related Issues (17)
- move the influxdb data to an external drive (connected via USB) HOT 1
- docker container dashboard shows the same container with different container_names HOT 1
- Container in endless installing - starting - installing - stopping loop since upgrade from Resin Os 2.15.1+rev2 to balenaOS 2.27.0+rev1 HOT 1
- Missing "$" in telegraf.conf HOT 1
- Node-RED readonly HOT 2
- Influxdb stuck in start loop HOT 2
- Not able to secure node-red editors - node-red-admin module not installed HOT 5
- problems when redeploying node-red services with latest docker image.
- node-red install error: sudo: no tty present and no askpass program specified HOT 2
- how do you send data to the two mosquitto broker ?? HOT 1
- docker compose is using "image: tobi312/rpi-nginx" while it should be "build: nginx". HOT 1
- mounting USB memory stick in influxdb container didn't work. HOT 1
- "502 Bad Gateway" or "Cannot GET /node-red-test/" HOT 1
- node-red nodes installed through `npm install` are lost when restarting/redeploying the node-red containers HOT 3
- make location where influxdb data is stored configurable. HOT 1
- system metrics dashboard reports an average user CPU usage of 35% HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from balena-node-red-mqtt-nginx-tig-stack.