Prometheus exporter for Azure IoT Hub
Перейти к файлу
Eugene Fedorenko 225547e8b9
Merge pull request #2 from microsoft/users/GitHubPolicyService/87163390-8e10-4de1-8354-d45be113cae1
Adding Microsoft SECURITY.MD
2022-08-18 17:43:39 -07:00
.github/workflows cd 2021-10-14 23:39:30 +00:00
eventhub ci 2021-10-14 22:28:14 +00:00
images gif 2021-10-15 01:36:40 +00:00
manifests/helm Fix secret 2021-10-15 00:01:24 +00:00
metrics ci 2021-10-14 22:28:14 +00:00
server linting 2021-10-14 22:33:41 +00:00
.gitignore Initial commit 2021-10-12 15:48:38 -07:00
Dockerfile ci 2021-10-14 22:28:14 +00:00
LICENSE Initial commit 2021-10-12 15:48:38 -07:00
README.md Update README.md 2022-08-18 17:42:50 -07:00
SECURITY.md Microsoft mandatory file 2022-08-12 16:21:49 +00:00
go.mod working 2021-10-14 01:29:21 +00:00
go.sum working 2021-10-14 01:29:21 +00:00
main.go linting 2021-10-14 22:33:41 +00:00

README.md

build deploy

Azure IoT Hub exporter

Azure IoT Hub exporter listens to Azure IoT Hub messages endpoint and exposes IoT Edge metrics to Prometheus.

Azure IoT Hub exporter

IoT Edge metrics are exported to IoT Hub by the metrics collector module as it is described in Collect and transport metrics approach (Option 2) via device-to-cloud messages. Azure IoT Hub exporter converts the metrics messages to Prometheus format and exposes them to be scrapped by Prometheus server.

Motivation

Collect and transport metrics describes how to deliver metrics to IoT Hub via standard device-to-cloud channel. It's also possible to build a cloud workflow to push the metrics to Log Analytics workspace and consume them with Azure Workbooks and Azure Alerts. But what if we build our observability approach on top of Prometheus and Grafana? Metrics are exposed by IoT Edge modules in Prometheues format and we want them to land in a Prometheus server so that we can use PromQL to build Grafana dashboards and Prometheus alerts. The purpose of Azure IoT Hub exporter is to close the gap between IoT Hub and Prometheus server.

Dashboard

Installation

Add Azure IoT Hub exporter repository to Helm repos:

helm repo add azure-iothub-exporter https://microsoft.github.io/azure-iothub-exporter/

Install Azure IoT Hub exporter:

helm upgrade -i azure-iothub-exporter azure-iothub-exporter/azure-iothub-exporter \
--namespace <NAMESPACE> \
--set eventHubConnectionString=<IoT Hub messages endpoint connection string>

Refer to Read device-to-cloud messages from the built-in endpoint for the details on the IoT Hub messages endpoint connection string.

Prometheus configuration

Add the following job defintion to the prometheus config:

- job_name: azure-iothub-exporter
  scrape_interval: 1m
  metrics_path: /iotmetrics
  static_configs:
  - targets: ["azure-iothub-exporter.<NAMESPACE>.svc.cluster.local:8080"]

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.