Skip to content

Latest commit

 

History

History
73 lines (43 loc) · 1.53 KB

File metadata and controls

73 lines (43 loc) · 1.53 KB

Monitoring IoT devices data with Golang, Google Cloud Platform and Grafana

cover

This repository is a complement to my medium article. If you wanna follow step by step, check my writing.

Architecture

This is how our infrastructure works:

architecture

Golang

Running:

$ go run pubsub.go

Running Dockerfile:

$ docker build . -t metrics-exporter

$ docker run -p 2112:2112 metrics-exporter

Deploying to Google Cloud Run:

$ gcloud builds submit --tag gcr.io/$PROJECT_ID/metrics-exporter

$ gcloud run deploy metrics-exporter --image gcr.io/$PROJECT_ID/metrics-exporter --region $REGION --platform managed --allow-unauthenticated --port 2112

Prometheus

Running Dockerfile:

$ docker build . -t prometheus

$ docker run -p 9090:9090 prometheus

Deploying to Google Cloud Run:

$ gcloud builds submit --tag gcr.io/$PROJECT_ID/prometheus

$ gcloud run deploy prometheus --image gcr.io/$PROJECT_ID/prometheus --region $REGION --platform managed --allow-unauthenticated --port 9090

Grafana

Running Dockerfile:

$ docker build . -t grafana

$ docker run -p 3000:3000 grafana

Deploying to Google Cloud Run:

$ gcloud builds submit --tag gcr.io/$PROJECT_ID/grafana

$ gcloud run deploy grafana --image gcr.io/$PROJECT_ID/grafana --region $REGION --platform managed --allow-unauthenticated --port 3000