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

feat(database/influxdb) add information if a node is a gateway to influxdb #230

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

maurerle
Copy link
Contributor

@maurerle maurerle commented Sep 20, 2023

Description

I think that the information if a node is a gateway should also be available in the influxdb:

is_gateway is more meaningful than "vpn" - which is the variable where this comes from actually.

I think, that this is more useful as a tag to filter than as a field of the data.
I did not find a way to add a boolean tag in influxdb, so I am writing it as string. (ref: https://stackoverflow.com/a/56989192 )

Motivation and Context

Checklist:

  • My code follows the code style of this project.
  • I have added also tests for my new code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@maurerle maurerle changed the title add information if a node is a gateway to influxdb feat(database/influxdb) add information if a node is a gateway to influxdb Sep 20, 2023
@maurerle
Copy link
Contributor Author

maurerle commented Sep 20, 2023

This PR closes #227

I can confirm it works.

@@ -53,6 +53,7 @@ func (conn *Connection) InsertNode(node *runtime.Node) {
"memory.total": stats.Memory.Total,
"memory.available": stats.Memory.Available,
}
tags.SetString("is_gateway", strconv.FormatBool(node.IsGateway()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you place it next to nodeid? for easier reading

otherwise it is fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I also removed the second tags.SetString("nodeid", stats.NodeID) which is redundant as we already added this to the tags and they are not cleared inbetween..?

@maurerle maurerle force-pushed the influx_is_gateway branch 2 times, most recently from 200243a to 37d4ef8 Compare September 21, 2023 09:23
@genofire genofire merged commit c19c1ae into FreifunkBremen:main Sep 21, 2023
2 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@maurerle maurerle deleted the influx_is_gateway branch September 29, 2023 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants