-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 support for exporting to influxdb v2. #217
Conversation
Bump for review: there's one failing check for a missing PR label, but I don't see a way to apply one to this PR. Assuming I don't have permissions? I'd assume the |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
Bump for review again, see note about PR labels above. |
if bashio::config.false 'process_info'; then | ||
options+=(--disable-process) | ||
fi | ||
|
||
# Interval | ||
sleep "$(bashio::config 'influxdb.interval')" | ||
if bashio::debug; then | ||
options+=(--debug) | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now added twice, when both influxdb1 & 2 are enabled
# Run the export processes in the background, then wait for both to complete | ||
# (otherwise we delay one export by the other's interval). | ||
if bashio::config.true 'influxdb.enabled'; then | ||
glances_export "influxdb" "$(bashio::config 'influxdb.interval')" & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not drop things in the background.
glances_export "influxdb" "$(bashio::config 'influxdb.interval')" & | ||
fi | ||
if bashio::config.true 'influxdb2.enabled'; then | ||
glances_export "influxdb2" "$(bashio::config 'influxdb2.interval')" & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
|
||
options+=(--time "$(bashio::config 'refresh_time')") | ||
options+=(-C /etc/glances.conf) | ||
options+=(--export "$influxdb_version") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If both options are enabled, the influxdb2 process will export both v1 & v2, while v1 is also active.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
Proposed Changes
Add configuration options+change influxdb service script to support Glances writing to an InfluxDB 2.x database.
I've tested this using a local addon, and was able to write to both a v1 database (the influxdb HA addon) and a v2 database (an external database running on a different host) at the same time, as well as just writing to one with the other disabled.
Question: I'm not familiar with how existing configurations are handled with addon upgrades: I've added some required fields in this commit, does that mean everyone who upgrades to a version including this commit will need to update their configs to set the required fields to something? Or will HA somehow merge the configs when updating so people won't notice the change? This option set felt best as a separate dictionary, but that means the change isn't really backwards- or forwards- compatible.
Related Issues