-
Notifications
You must be signed in to change notification settings - Fork 13.2k
InfluxDB: Move database information into jsondata #62308
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
Conversation
| Token string | ||
| URL string | ||
|
|
||
| Database string `json:"database"` |
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.
strange.. so, there already was code to read jsonData.database, but the value was never used?
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.
In influxdb.go line 181 it is being used params.Set("db", dsInfo.Database)
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.
i see, sorry, i got confuse because the same models.DatasourceInfo structure is created two times in newInstanceSetting.
gabor
left a comment
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.
the code looks good 👍 , i have left one idea how to improve it. i have not tested it though. i recommend watching sqlite3 data/grafana.db during the tests to see the right fields get the right values.
public/app/plugins/datasource/influxdb/components/ConfigEditor.tsx
Outdated
Show resolved
Hide resolved
gabor
left a comment
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.
LGTM!
What is this feature?
Since the
databasefield inDataSourceInstanceSettingsis deprecated we have to move that information in to thejsonData.Newly created InfluxDB v1.x datasources will have
dbNamefield injsonDatato store database information.Existing datasources will not be affected and will keep working. If the user updates the datasource configuration (changes the database name) new data will be written in jsonData.
Also, test data for local development is updated and they do not have
databasefield butjsonData.dbName.Why do we need this feature?
databasefield inDataSourceInstanceSettingsis deprecated. https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/types/datasource.ts#L583-L587We should move that information into the
jsonData.Who is this feature for?
People who use InfluxDB v1.x
Which issue(s) does this PR fix?:
Fixes #59115
Special notes for your reviewer:
How to test
Disclaimer