Skip to content

Commit e7c9b29

Browse files
authored
Health Report: Only store metadata directly from the device (#1844)
The health report should be for data directly from the device, and thus, we shouldn't store `socket.device.firmware_metadata` in the report `metadata`
1 parent 1859406 commit e7c9b29

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/nerves_hub/extensions/health.ex

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,13 @@ defmodule NervesHub.Extensions.Health do
4848

4949
@impl NervesHub.Extensions
5050
def handle_in("report", %{"value" => device_status}, socket) do
51-
device_meta =
52-
for {key, val} <- Map.from_struct(socket.assigns.device.firmware_metadata),
53-
into: %{},
54-
do: {to_string(key), to_string(val)}
55-
5651
# Separate metrics from health report to store in metrics table
5752
metrics = device_status["metrics"] || %{}
5853

5954
health_report =
6055
device_status
6156
|> Map.delete("metrics")
62-
|> Map.put("metadata", Map.merge(device_status["metadata"], device_meta))
57+
|> Map.put("metadata", device_status["metadata"])
6358

6459
device_health = %{"device_id" => socket.assigns.device.id, "data" => health_report}
6560

0 commit comments

Comments
 (0)