-
Notifications
You must be signed in to change notification settings - Fork 69
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
Auto provision InfluxDB data source in Grafana #512
Conversation
I tried to auto provision the "sun and moon" data source too but it involves parsing JSON with bash which isn't impossible but not too straight forward so I left that alone for now. |
Thanks @longzheng ! I'll give it a test. What instructions do we need to change in setup.sh or README? I'll play around with the lat/long query to see if we can do that. It would be useful for weather too. |
I think we can use this in setup.sh and have sun and moon auto provision. It will default to 0/0 and we can add instructions on how to change that data source. # Get latitude and longitude
LAT="0.0"
LONG="0.0"
PYTHON=$(command -v python3 || command -v python)
if [ -n "${PYTHON}" ]; then
LAT=$(curl -s https://freeipapi.com/api/json | "${PYTHON}" -c "import sys, json; print(json.load(sys.stdin)['latitude'])")
LONG=$(curl -s https://freeipapi.com/api/json | "${PYTHON}" -c "import sys, json; print(json.load(sys.stdin)['longitude'])")
fi I thought about using |
Thanks for this great work @longzheng ! 🙏 I've merged and will be running tests to make sure we didn't break anything. Version v4.5.0. |
Upgrade notes:
|
New Install Test Notes:
👍 |
Nice work guys making things just that much easier for installs! ;-) The Release Notes say "This adds an "(auto provisioned)" suffix to the data source name to prevent breaking exiting installations and to allow custom configurations" ... which I assume will apply to me since I'm a legacy user. Since I try to go with defaults and minimize changes, might it be useful to have a quick "how-to" to convert my existing setup to simply use the auto-provisioned InfluxDB (and retain historical data) so that going forward, I'm more in sync with the default setup? I could probably figure this out, but figure better to ask here since you guys are more familiar with the code and would come up with a more elegant/scalable solution. |
Fixes #491
Automatically set up the InfluxDB data source in Grafana.
This hard-codes the URL/port to the default
8086
. In theory it might be possible to dynamically update this provisioning YML fromINFLUXDB_PORTS
incompose.env
but it's not that straight forward.I couldn't reproduce any issues with problems/timeouts as suggested in #461. My startup is equally fast with the provisioning file.
I saw these Grafana logs which aren't real errors, they're just indicating there's no provisioned plugins/notifiers/alerts.