Reputation: 11142
I'm wondering if there is any way to have my device's state data that is sent through Google IoT Core show up in Stackdriver, possibly as a custom metric.
Essentially, I would like to use Stackdriver to monitor my devices but rather than deploy the agent to all of them I could leverage the existing and secure connection that exists because they are connected to IoT Core. I could publish an MQTT message to the state topic from the device with some relevant information (e.g., CPU percentage, number of processes running, etc). Then I could use Stackdriver to visualize and alert when something looks wrong.
From what I can tell, I can only monitor basic things about IoT Core in Stackdriver like how many bytes have been sent. I can read the state data by subscribing to the telemetry topics in Google Cloud Pub/Sub but then the challenge is getting that data into Stackdriver.
Any ideas?
Upvotes: 3
Views: 325
Reputation: 3332
I hear ya. There are some potential concerns around logging content (state, telemetry, etc) of any kind from IoT Core. As you've found (and for anyone else seeing this answer) the metrics we log can be found here:
https://cloud.google.com/monitoring/api/metrics_gcp#gcp-cloudiot
At least in terms of what you're looking to do, take a look at this tutorial:
https://cloud.google.com/community/tutorials/cloud-iot-rtdp
It does what you're describing (with a little tweaking) that might at least easily give you a solution to what you want to do.
Upvotes: 3