Skip to content

Ingest, monitoring, and alert with sensor data from Viam machines using Elastic

Notifications You must be signed in to change notification settings

viam-devrel/physical-world-monitoring

 
 

Repository files navigation

Monitoring & Alerting in the Physical World w/ Viam & Elastic

Source code for demos presented at ElasticON NYC 2024. Slides & video coming soon.

This project repo is managed with uv.

Overview

Ingest data from Viam Data to an Elastic Search index: ingest.py

ETL function for indexing new sensor data from a machine webhook to Elastic Search: cloud-functions/ingest-sensor-data/main.py

Alerting function triggered by Elastic observability rules to blink an LED on a Viam machine: cloud-functions/movement-alert/main.py

Development

Prerequisites:

  • uv
  • Make copy of .env.example called .env and fill out necessary environment variable values for task

**Install project dependencies:

uv pip install -r pyproject.toml

Run ingestion script:

uv run ingest.py

Run ingest-sensor-data function locally:

uv run functions-framework --source ./cloud-functions/ingest-sensor-data/main.py --target ingest_data --debug

This will start a Flask server at http://localhost:8080 which can be sent data through curl or another API testing tool.

Run movement-alert function locally:

uv run functions-framework --source ./cloud-functions/movement-alert/main.py --target alert_movement --debug

This will start a Flask server at http://localhost:8080 which can be sent data through curl or another API testing tool.

About

Ingest, monitoring, and alert with sensor data from Viam machines using Elastic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Shell 0.4%