Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Azure IoT Edge integration #7465

Merged
merged 65 commits into from
Oct 22, 2020
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
96fad1a
Add skeleton
Aug 28, 2020
9fef3f0
Working Docker setup for 1.0.9
Aug 31, 2020
ce9bc5c
Attempt 1.0.10-rc2 setup
Aug 31, 2020
5f25b45
Finalize RC2 dev setup
Sep 1, 2020
6fd6fc2
Fix double-endpoint setup, implement scraping of Prometheus endpoints
Sep 1, 2020
1685edd
Update CI config
Sep 2, 2020
a535b5b
Add config class, add failing integration test
Sep 2, 2020
313fc8f
Successfully collect and test metrics, improve env up/down robustness
Sep 2, 2020
28d33a2
Make tests pass
Sep 2, 2020
03c0fbf
Use local mock server for CI tests
Sep 4, 2020
f8629f1
Add Edge Agent metrics
Sep 4, 2020
5d0c6b0
Update codecov config
Sep 7, 2020
b302b8b
Tweak exclude_labels
Sep 7, 2020
72cb919
Fix invalid manifest
Sep 7, 2020
18ca0ec
Add edgeHub metrics
Sep 7, 2020
b2213c6
Document mock server metrics generation
Sep 7, 2020
6423b81
Fix Python 2 tests compatibility
Sep 7, 2020
c94f10b
Assert E2E tags
Sep 7, 2020
1574b3a
Skip E2E tests if IOT_EDGE_CONNSTR is missing
Sep 7, 2020
2832868
Use Windows-compatible mock server setup
Sep 7, 2020
640032a
Add security daemon health service check
Sep 7, 2020
0fd2abe
Simplify prometheus url config, add config tests
Sep 7, 2020
e35340c
Fix style, fix Windows test compat
Sep 7, 2020
47e9d74
Verify service check in e2e
Sep 7, 2020
d9b5234
Fix check class name case
Sep 7, 2020
8f24b1d
Add config spec
Sep 8, 2020
b15cddf
Add logs to config spec and test env
Sep 8, 2020
08508b9
Use auto-discovery for log collection
Sep 8, 2020
cc1550c
Merge branch 'master' into fm/iot_edge
Sep 9, 2020
777a102
Enable log collection via Docker labels
Sep 9, 2020
ce86835
Merge branch 'master' into fm/iot_edge
Sep 10, 2020
f01f898
Set required properties in config spec
Sep 10, 2020
39d3735
Merge branch 'master' into fm/iot_edge
Sep 11, 2020
b7ccdbb
Reorganize config options order
Sep 11, 2020
6b625a7
Loosen wait conditions
Sep 14, 2020
bf95787
Merge branch 'master' into fm/iot_edge
Sep 16, 2020
34a4ffd
Merge branch 'master' into fm/iot_edge
Sep 17, 2020
8bbfddf
Merge branch 'master' into fm/iot_edge
Sep 18, 2020
e43fef6
Merge branch 'master' into fm/iot_edge
Sep 23, 2020
9e268a3
Update namespace to azure.iot_edge
Sep 23, 2020
c64698b
Merge branch 'master' into fm/iot_edge
Sep 25, 2020
3504ee3
Add version metadata collection
Sep 25, 2020
f80e4ec
Update manifest.json
Sep 25, 2020
6041ead
Check types
Sep 25, 2020
37ace98
Write up metadata.csv
Sep 25, 2020
591e5b2
Merge branch 'master' into fm/iot_edge
Sep 28, 2020
846bcac
Fill in service_checks.json
Sep 28, 2020
13d0000
Add TLS support to E2E environment
Sep 28, 2020
4aa5660
Add code comment about single-instance and composition approaches
Sep 28, 2020
c727097
Drop note about setting certs in config.yaml
Sep 28, 2020
60fca78
Merge branch 'master' into fm/iot_edge
Sep 29, 2020
33cccaf
Write up README
Sep 29, 2020
ec868e8
Lingo: security daemon -> security manager
Sep 29, 2020
7b081e4
Add recommended monitors
Sep 29, 2020
1f95257
Merge branch 'master' into fm/iot_edge
Sep 30, 2020
04b990a
Apply no-brainer suggestions
florimondmanca Oct 1, 2020
a1d86cd
Update version metadata transformer
Oct 2, 2020
38e8b19
Address feedback
Oct 2, 2020
dbb1370
Move instance config to Edge Agent labels
Oct 2, 2020
a25a15a
Merge branch 'master' into fm/iot_edge
Oct 9, 2020
0de144a
Merge branch 'master' into fm/iot_edge
Oct 13, 2020
ab0b18f
Apply suggestions from docs review
florimondmanca Oct 13, 2020
042ab4e
Merge branch 'master' into fm/iot_edge
Oct 20, 2020
926c566
Fix type of renotify_interval in monitors json
Oct 20, 2020
145a931
Merge branch 'master' into fm/iot_edge
Oct 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Document mock server metrics generation
  • Loading branch information
Florimond Manca committed Sep 7, 2020
commit b2213c694919adab183346894d85a6f4b260928e
75 changes: 74 additions & 1 deletion azure_iot_edge/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,82 @@ The `SimulatedTemperatureSensor` is enabled in the environment.
To view simulated data, run:

```bash
docker exec -it iot-edge-device iotedge -H "http://$(docker inspect iot-edge-device -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'):15580" logs -f SimulatedTemperatureSensor
docker logs -f SimulatedTemperatureSensor
```

## Generate mock server metrics

The data in [`metrics/`](./compose/device/mock_server/metrics) was generated as follows:

* Start an E2E environment.
* Let it run for a few minutes.
* Generate metrics files:

```bash
curl localhost:9601/metrics > azure_iot_edge/tests/compose/mock_server/metrics/edge_hub.txt
curl localhost:9602/metrics > azure_iot_edge/tests/compose/mock_server/metrics/edge_agent.txt
```

* Manually edit `edge_agent.txt` (replace `<INSTANCE_NUMBER>` with the instance number from the output):
* Add a value line for `edgeAgent_unsuccessful_iothub_syncs_total` (no way to trigger unsuccessful syncs were found):

```
edgeAgent_unsuccessful_iothub_syncs_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="c2c90030-2df4-4c92-98cb-deaa9ef05cac",ms_telemetry="True"} 0
```

* Add value lines for `edgeAgent_module_stop_total`:

```
edgeAgent_module_stop_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="c2c90030-2df4-4c92-98cb-deaa9ef05cac",module_name="SimulatedTemperatureSensor",module_version="1.0",ms_telemetry="True"} 0
edgeAgent_module_stop_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="c2c90030-2df4-4c92-98cb-deaa9ef05cac",module_name="edgeHub",module_version="",ms_telemetry="True"} 0
```

* Add value lines for `edgeAgent_total_disk_space_bytes` (containers don't have individual disks):

```
edgeAgent_total_disk_space_bytes{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="c2c90030-2df4-4c92-98cb-deaa9ef05cac",module_name="edgeAgent",ms_telemetry="True"} 1073741824
edgeAgent_total_disk_space_bytes{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="c2c90030-2df4-4c92-98cb-deaa9ef05cac",module_name="edgeHub",ms_telemetry="True"} 1073741824
edgeAgent_total_disk_space_bytes{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="c2c90030-2df4-4c92-98cb-deaa9ef05cac",module_name="SimulatedTemperatureSensor",ms_telemetry="False"} 1073741824
```

* Manually edit `edge_hub.txt` (replace `<INSTANCE_NUMBER>` with the instance number from the output):
* Edit any `NaN` values so that all metrics report correctly.
* Add a value line for `edgehub_dropped_total`:

```
edgehub_messages_dropped_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="<INSTANCE_NUMBER>",from="testEdgeDevice/SimulatedTemperatureSensor",from_route_output="temperatureOutput",reason="ttl_expiry",ms_telemetry="True"} 1
```

* Add a value line for `edgehub_offline_count_total`:

```
edgehub_offline_count_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="<INSTANCE_NUMBER>",id="testEdgeDevice/$edgeHub",ms_telemetry="True"} 1
```

* Add a definition and value for the `edgehub_messages_unack_total` metric (no way to trigger storage failures locally was found):

```
# HELP edgehub_messages_unack_total Total number of messages unack because storage failure
# TYPE edgehub_messages_unack_total counter
edgehub_messages_unack_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="<INSTANCE_NUMBER>",from="testEdgeDevice/SimulatedTemperatureSensor",from_route_output="temperatureOutput",reason="storage_failure",ms_telemetry="True"} 1
```

* Add a definition and value for the `edgehub_operation_retry_total` metric (no way to trigger them locally was found):

```
# HELP edgehub_operation_retry_total Total number of times edgeHub operations were retried
# TYPE edgehub_operation_retry_total counter
edgehub_operation_retry_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="<INSTANCE_NUMBER>",id="testEdgeDevice/$edgeHub",operation="test",ms_telemetry="True"} 1
```

* Add a definition and value for the `edgehub_client_connect_failed_total` metric (we do not have auth set up yet):

```
# HELP edgehub_client_connect_failed_total Total number of times clients failed to connect to edgeHub
# TYPE edgehub_client_connect_failed_total counter
edgehub_client_connect_failed_total{iothub="iot-edge-dev-hub.azure-devices.net",edge_device="testEdgeDevice",instance_number="0dab21d7-d0de-4527-99df-27c8e5861eac",id="testEdgeDevice/SimulatedTemperatureSensor",reason="not_authenticated",ms_telemetry="True"} 1
```

## Troubleshooting

Guides:
Expand Down