Chronograf with InfluxDB3
Would like to explore getting Chronograf to work with InfluxDB 3 Enterprise. In theory, this should work via the support InfluxDB 3 Enterprise has with InfluxQL and the v1 Query API.
The initial theory is that it is not fully functional because Chronograf is relying on a "show databases" influxQL command - which is not supported with InfluxDB 3.
Would like to:
- Validate/confirm/deny - that this is the case.
- Work around that issue and Test to see if there are other things that might prevent it
For development testing/validation of this, if show databases fails, we could use the /api/v0/accounts/{accountId}/clusters/{clusterId}/databases as a fallback to enable further testing.
Since Cloud Dedicated (what the customer is using) may be harder to test with, you could also test with a downloaded version of InfluxDB 3 Enterprise as a first step. The API to retrieve the databases would be different:
https://docs.influxdata.com/influxdb3/cloud-dedicated/api/management/#tag/Databases
Hi @garylfowler,
I’ve completed an investigation into connecting Chronograf to InfluxDB 3 Enterprise. To get a successful connection, we’ll need to fix several parts of Chronograf:
1/ Authorization - We’ll need to introduce a new authentication option, similar to what we already have for InfluxDB 2 — something like “InfluxDB v3 Auth”. This will allow us to customise behavior in other areas of Chronograf accordingly.
2/ Version detection - The current http://localhost:8181/ping check used by Chronograf is not compatible with the InfluxDB 3 Enterprise implementation. We’ll need to adjust the logic to detect v3 properly.
3/ Database list - As you noted, SHOW DATABASES isn’t supported. Instead, we’ll need to call the Enterprise API endpoint for listing databases: https://docs.influxdata.com/influxdb3/enterprise/api/v3/#operation/GetConfigureDatabase
After applying local “hacks” to these areas in Chronograf, I was able to successfully connect and query data from InfluxDB 3 Enterprise.
Let me know how you’d like to proceed — I can start working on a more permanent PR if this approach works for you.
Best regards, Jakub
Ok, great work, thank you. Do you have access to a Cloud Dedicated instance? The first customer that really wants this is on Cloud Dedicated - but wasn't sure you would have a good way to test that. If not, let me see what we could get setup for you. If so, can you do the same assessment on it?
There is currently some work underway with the /ping command on Enterprise, so that one might have partial fix outside of this.
The other thing we will have to test is whether the show tag values command used in schema "browsing" is performant enough. But not sure if you have a large enough dataset to test that with - so we may need to ask the customer to test that.
We already have a prepared environment for InfluxDB Clustered, but we don’t have access to Cloud Dedicated.
Regarding SHOW TAG VALUES, I only tested it on a small dataset, so it’s not enough to confidently confirm good performance.
I’ve tested Chronograf with InfluxDB Cloud Dedicated, and it behaves the same way as with InfluxDB 3 Enterprise. After applying the fixes outlined here: https://github.com/influxdata/chronograf/issues/6138#issuecomment-2891052749, I was able to successfully query data.
The query has to be in following format:
SELECT * FROM "jakub-bonitoo-db".autogen.machine_data WHERE time > 0
As part of the Chronograf modifications, we’ll also need to address metadata queries that are located across different parts of the codebase, e.g.:
These will need to be adapted to align with InfluxDB 3’s API and metadata behavior.
@bednar Thanks for your work! Can you please share the changes you've made? (e.g. a draft pull request or a fork/branch)
@rcknr this isn’t something that can be publicly used. I made the following temporary changes to get it working:
- authorization.go#L71: hardcoded it to always use the same token.
- databases.go#L161: returns a static list of databases.
- influx.go#L299: returns a static version for the DB.
It’s enough for testing queries against InfluxDB 3, but it’s clearly not suitable for production.
The support is in following PR: https://github.com/influxdata/chronograf/pull/6139