Skip to content

Commit

Permalink
feat(database/influxdb): add information if a node is a gateway to in…
Browse files Browse the repository at this point in the history
…fluxdb (#230)

Signed-off-by: Florian Maurer <[email protected]>
  • Loading branch information
maurerle authored Sep 21, 2023
1 parent 4660f21 commit c19c1ae
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions database/influxdb/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (conn *Connection) InsertNode(node *runtime.Node) {

tags := models.Tags{}
tags.SetString("nodeid", stats.NodeID)
tags.SetString("is_gateway", strconv.FormatBool(node.IsGateway()))

fields := models.Fields{
"load": stats.LoadAverage,
Expand Down Expand Up @@ -192,12 +193,6 @@ func (conn *Connection) InsertNode(node *runtime.Node) {
"leases.pruned": dhcp.LeasesPruned,
}

// Tags
tags.SetString("nodeid", stats.NodeID)
if nodeinfo := node.Nodeinfo; nodeinfo != nil {
tags.SetString("hostname", nodeinfo.Hostname)
}

conn.addPoint(MeasurementDHCP, tags, fields, time)
}
}

0 comments on commit c19c1ae

Please sign in to comment.