FreifunkBremen / yanic

Yet another node info collector - for respondd to be used with meshviewer to Grafana (with influxdb or graphite)
https://freifunkbremen.github.io/yanic/
GNU Affero General Public License v3.0
20 stars 41 forks source link

feat(database/influxdb): add selected gateway as tag in influxdb #226

Open maurerle opened 1 year ago

maurerle commented 1 year ago

Description

Adds the selected gateway and gateway6 as a tag to the influxdb

Motivation and Context

fixes #173

Checklist:

codecov-commenter commented 1 year ago

Codecov Report

Merging #226 (61ed220) into main (22f67e2) will decrease coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head 61ed220 differs from pull request most recent head ce816d6. Consider uploading reports for the commit ce816d6 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/FreifunkBremen/yanic/pull/226/graphs/tree.svg?width=650&height=150&src=pr&token=F8T0RcTnpe&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreifunkBremen)](https://app.codecov.io/gh/FreifunkBremen/yanic/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreifunkBremen) ```diff @@ Coverage Diff @@ ## main #226 +/- ## ========================================== - Coverage 73.11% 73.09% -0.02% ========================================== Files 55 55 Lines 2418 2420 +2 ========================================== + Hits 1768 1769 +1 Misses 598 598 - Partials 52 53 +1 ``` | [Files Changed](https://app.codecov.io/gh/FreifunkBremen/yanic/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreifunkBremen) | Coverage Δ | | |---|---|---| | [database/influxdb/node.go](https://app.codecov.io/gh/FreifunkBremen/yanic/pull/226?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreifunkBremen#diff-ZGF0YWJhc2UvaW5mbHV4ZGIvbm9kZS5nbw==) | `84.11% <100.00%> (+0.18%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/FreifunkBremen/yanic/pull/226/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreifunkBremen)
genofire commented 1 year ago

should we fetch the nodeID here, of the gateway?

like in output/meshviewer-ffrgb:

https://github.com/FreifunkBremen/yanic/blob/dfd456bc1e8d35bcd6e44cdc653b50d174860160/output/meshviewer-ffrgb/struct.go#L153

maurerle commented 1 year ago

we would then have to "nodes" somehow to influx output - do you know how to manage this?

In the current way, I do not see the gateway set as a tag.. I don't know what i am doing wrong :D

genofire commented 1 year ago

you are correct, that it needs a refactory to get nodes ...

to manage it, i need to look and test myself ... first tought, do we have something equal for links already.


i believe nothing, could it be, that you mixup influxdb and influxdb2 ?

maurerle commented 1 year ago

I confirm this works, can be merged :)

maurerle commented 1 year ago

I had something wrong with my install, now it worked.. I mean we could just remove the ':' in the string - as this is likely the nodeid? But I don't know if you can rely on that.

Having it as a nodeid would be much better, as we do not have the mac anywhere else..