Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
323dd39
feat: influxdb cloud dedicated support
jansimonb Jun 30, 2025
651c8a9
test: add tests for cloud dedicated source
jansimonb Jul 2, 2025
ceceeab
feat(server): allow to setup influxdb cloud dedicated on CLI
jansimonb Jul 2, 2025
3b04e41
feat(ui): make databases page read-only
jansimonb Jul 3, 2025
b8f0a93
fix: RP editable again
jansimonb Jul 3, 2025
16b9dfa
fix: disable db delete
jansimonb Jul 3, 2025
5e17db9
feat: fix query builder for cloud dedicated
jansimonb Jul 4, 2025
b844f36
fix: setupQueryFromCommand parsing issue
jansimonb Jul 4, 2025
1199121
feat: make show tag values work in query builder
jansimonb Jul 4, 2025
3dd387d
feat: improve appendTimeCondition to handle special tag names
jansimonb Jul 4, 2025
7142352
feat: set time condition to `time > now() - 24h`
jansimonb Jul 7, 2025
f46d7a7
feat: prepare statement parsing for reading tag values from CSV
jansimonb Jul 7, 2025
75c1bb7
feat: reading measurements and tags from CSV
vlastahajek Jul 11, 2025
ef2d51a
feat: adding tests and improvements
vlastahajek Jul 15, 2025
e7c6ae9
feat: fallback to SHOW TAG VALUES call if CSV not provided
jansimonb Jul 17, 2025
8f1f79e
chore: minor improvements
jansimonb Jul 17, 2025
5331428
feat: show loading spinner until database list is reloaded
jansimonb Jul 21, 2025
2d9ee4a
fix: revert unset of previous database
jansimonb Jul 21, 2025
71aed4a
feat: refactor to multiple csv files per database
jansimonb Aug 6, 2025
e688422
feat: use dropdown to select the server type
jansimonb Sep 16, 2025
4e85504
feat: add InfluxDB 3 Core support
jansimonb Sep 24, 2025
859b640
test: fixing tests
jansimonb Sep 24, 2025
0f44757
feat: add InfluxDB 3 Enterprise support
jansimonb Sep 29, 2025
abe43a8
fix: add new source types to MultiSourceBuilder
jansimonb Sep 30, 2025
e7a0551
feat: add InfluxDB Clustered support
jansimonb Oct 8, 2025
58cf99b
docs: adding v3 todo
vlastahajek Oct 9, 2025
18b5610
test: fixing test on Windows
vlastahajek Oct 9, 2025
1e90657
fix: fix migration on Windows
vlastahajek Oct 9, 2025
9d4d6f0
feat: Optional ClusterID,AccountID and Management Token
vlastahajek Oct 9, 2025
7fee0f6
feat: Adding config for hardcoded InfluxDB 3 Clustered related values
vlastahajek Oct 24, 2025
7190477
chore: Extended tests for updating source
vlastahajek Oct 27, 2025
07d68ac
feat: Added InfluxDB 3 Serverless
vlastahajek Oct 30, 2025
84e3e3a
fix: fixed help format
vlastahajek Oct 30, 2025
31300cb
chore: refactored WizardDropdown to use existing DropDown component
vlastahajek Oct 31, 2025
8243c94
chore: refactored WizardDropdown to functional component
vlastahajek Nov 3, 2025
d3dda45
chore: updated TODO
vlastahajek Nov 3, 2025
c2b08fe
chore: workaround InfuxDB 3 core bucket name problems
vlastahajek Nov 4, 2025
83b47a7
chore: fixes for cloud dedicated
vlastahajek Nov 4, 2025
00b981c
feat: V3 support by cmd/env option
vlastahajek Nov 7, 2025
5bbf5c5
test: env tests fixed and extended
vlastahajek Nov 7, 2025
c70f336
chore: udpate V3todo
vlastahajek Nov 11, 2025
b12f2fa
fix: allow clearing source properties
vlastahajek Nov 11, 2025
65cdfc9
test: extending UpdateSource tests
vlastahajek Nov 12, 2025
f1d8c6b
fix: help, meta field
vlastahajek Dec 9, 2025
f8950cc
fix: fixing annotations management
vlastahajek Dec 12, 2025
97541af
fix: use DefaultDB if provided
vlastahajek Dec 15, 2025
21d1e94
fix: use DefaultDB also in Clustered
vlastahajek Dec 16, 2025
5997104
Feat: Configurable Time condition for show tag values
vlastahajek Dec 16, 2025
ea4cbd6
chore: change default time condition to last day
vlastahajek Dec 17, 2025
e9f5209
docs: change log
vlastahajek Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## [unreleased]

### Features

1. [#6139](https://github.com/influxdata/chronograf/pull/6139): Add support for InfluxDB V3

### Other

1. [#6150](https://github.com/influxdata/chronograf/pull/6150): Upgrade golang to 1.25.3
Expand Down
31 changes: 31 additions & 0 deletions V3TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# InfluxDB v3 support TODOs

## Features

- [X] Support InfluxDB 3 Serverless
- [X] UI should have old UI look for default
- [X] Enable new UI look from settings

## Issues

- [X] List databases for Core in Explorer shows fewer dbs than with `show databases` manually
- [X] Command line help print-out wrongly formated due to new v3 option:
```
/influxdb-type:choice[influx|influx-enterprise|influx-relay|influx-v2|influx-v3-core|influx-v3-enterprise|influx-v3-cloud-dedicated]
```

## Tests

- [X] Unit test for Update Source for cloud dedicated fields
- [X] Unit test for New Source for cloud dedicate fields
- [X] Unit test for Client cloud dedicated fields
- [ ] Unit test for query specific cloud dedicated fields
- [ ] After finalizing UI, fix Cypress tests

## Polishing
- [ ] Handle TODOs in code
- [ ] Once all 5 v3 influxdb types are supported reorganize/refactor the code (cloud_dedicated.go, influx.go) to group similar server types

## Enhancements
- [ ] UI: Better form validation to show errored field(s)
- [ ] UI: distinguish optional fields
51 changes: 41 additions & 10 deletions chronograf.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strconv"
"time"

"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/kapacitor/client/v1"
)

Expand All @@ -27,7 +28,6 @@ const (
ErrSourceInvalid = Error("source is invalid")
ErrServerInvalid = Error("server is invalid")
ErrAlertNotFound = Error("alert not found")
ErrAuthentication = Error("user not authenticated")
ErrUninitialized = Error("client uninitialized. Call Open() method")
ErrInvalidAxis = Error("Unexpected axis in cell. Valid axes are 'x', 'y', and 'y2'")
ErrInvalidColorType = Error("Invalid color type. Valid color types are 'min', 'max', 'threshold', 'text', and 'background'")
Expand All @@ -42,9 +42,6 @@ const (
ErrCannotDeleteDefaultOrganization = Error("cannot delete default organization")
ErrConfigNotFound = Error("cannot find configuration")
ErrAnnotationNotFound = Error("annotation not found")
ErrInvalidCellOptionsText = Error("invalid text wrapping option. Valid wrappings are 'truncate', 'wrap', and 'single line'")
ErrInvalidCellOptionsSort = Error("cell options sortby cannot be empty'")
ErrInvalidCellOptionsColumns = Error("cell options columns cannot be empty'")
ErrOrganizationConfigNotFound = Error("could not find organization config")
ErrInvalidCellQueryType = Error("invalid cell query type: must be 'flux' or 'influxql'")
)
Expand Down Expand Up @@ -91,16 +88,43 @@ type Assets interface {

// Supported time-series databases
const (
// InfluxDB is the open-source time-series database
InfluxDB = "influx"
// InfluxEnteprise is the clustered HA time-series database
InfluxEnterprise = "influx-enterprise"
// InfluxRelay is the basic HA layer over InfluxDB
InfluxRelay = "influx-relay"
// InfluxDBv1 is InfluxDB OSS v1
InfluxDBv1 = "influx"
// InfluxDBv1Enterprise is InfluxDB v1 Enterprise (the clustered HA time-series database)
InfluxDBv1Enterprise = "influx-enterprise"
// InfluxDBv1Relay is the basic HA layer over InfluxDB v1
InfluxDBv1Relay = "influx-relay"

// InfluxDBv2 is Influx DB 2.x with Token authentication
InfluxDBv2 = "influx-v2"

// InfluxDBv3Core is InfluxDB 3 Core (self-managed)
InfluxDBv3Core = "influx-v3-core"
// InfluxDBv3Enterprise is InfluxDB 3 Enterprise (self-managed)
InfluxDBv3Enterprise = "influx-v3-enterprise"
// InfluxDBv3Clustered is InfluxDB Clustered (self-managed)
InfluxDBv3Clustered = "influx-v3-clustered"
// InfluxDBv3CloudDedicated is InfluxDB Cloud Dedicated (fully-managed)
InfluxDBv3CloudDedicated = "influx-v3-cloud-dedicated"
// InfluxDBv3Serverless is InfluxDB Cloud Serverless (fully-managed)
InfluxDBv3Serverless = "influx-v3-serverless"
)

func IsV3SrcType(srcType string) bool {
return srcType == InfluxDBv3Core ||
srcType == InfluxDBv3Enterprise ||
srcType == InfluxDBv3Clustered ||
srcType == InfluxDBv3CloudDedicated ||
srcType == InfluxDBv3Serverless
}

type V3Config struct {
CloudDedicatedManagementURL string
ClusteredAccountID string
ClusteredClusterID string
TimeConditionExpr influxql.Expr // Parsed time condition for SHOW TAG VALUES queries
}

// TSDBStatus represents the current status of a time series database
type TSDBStatus interface {
// Connect will connect to the time series using the information in `Source`.
Expand Down Expand Up @@ -243,6 +267,11 @@ type Source struct {
Username string `json:"username,omitempty"` // Username is the username to connect to the source
Password string `json:"password,omitempty"` // Password is in CLEARTEXT
SharedSecret string `json:"sharedSecret,omitempty"` // ShareSecret is the optional signing secret for Influx JWT authorization
ClusterID string `json:"clusterId,omitempty"` // ClusterID is the cluster ID for InfluxDB Cloud Dedicated sources
AccountID string `json:"accountId,omitempty"` // AccountID is the account ID for InfluxDB Cloud Dedicated sources
ManagementToken string `json:"managementToken,omitempty"` // ManagementToken is the management token for InfluxDB Cloud Dedicated sources
DatabaseToken string `json:"databaseToken,omitempty"` // DatabaseToken is the database token for InfluxDB Cloud Dedicated or other InfluxDB 3 sources
TagsCSVPath string `json:"tagsCSVPath,omitempty"` // TagsCSVPath is the path to a directory containing CSV files (per db) with tags for InfluxDB Cloud Dedicated sources
URL string `json:"url"` // URL are the connections to the source
MetaURL string `json:"metaUrl,omitempty"` // MetaURL is the url for the meta node
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` // InsecureSkipVerify as true means any certificate presented by the source is accepted.
Expand All @@ -251,6 +280,7 @@ type Source struct {
Organization string `json:"organization"` // Organization is the organization ID that resource belongs to
Role string `json:"role,omitempty"` // Not Currently Used. Role is the name of the minimum role that a user must possess to access the resource.
DefaultRP string `json:"defaultRP"` // DefaultRP is the default retention policy used in database queries to this source
DefaultDB string `json:"defaultDB,omitempty"` // DefaultDB is the default database used in queries for InfluxDB Cloud Dedicated when database list is not available
Version string `json:"version,omitempty"` // Version of influxdb
}

Expand Down Expand Up @@ -971,6 +1001,7 @@ type Environment struct {
TelegrafSystemInterval time.Duration `json:"telegrafSystemInterval"`
HostPageDisabled bool `json:"HostPageDisabled"`
CustomAutoRefresh string `json:"customAutoRefresh,omitempty"`
V3SupportEnabled bool `json:"v3SupportEnabled"`
}

// KVClient defines what each kv store should be capable of.
Expand Down
9 changes: 5 additions & 4 deletions cmd/chronograf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ func main() {

if _, err := parser.Parse(); err != nil {
code := 1
if fe, ok := err.(*flags.Error); ok {
if fe.Type == flags.ErrHelp {
code = 0
}
if fe, ok := err.(*flags.Error); ok && fe.Type == flags.ErrHelp {
code = 0
}
if code != 0 {
fmt.Printf("Error: %s\n", err)
}
os.Exit(code)
}
Expand Down
22 changes: 22 additions & 0 deletions influx/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ func (n *NoAuthorization) Set(req *http.Request) error { return nil }

// DefaultAuthorization creates either a shared JWT builder, basic auth or Noop or Token authentication
func DefaultAuthorization(src *chronograf.Source) Authorizer {
// Use Token authentication for InfluxDB v3 Serverless
if src.Type == chronograf.InfluxDBv3Serverless {
return &TokenAuth{
Token: src.DatabaseToken,
}
}
// Use Bearer Token authentication for all other InfluxDB 3 types
if chronograf.IsV3SrcType(src.Type) {
return &BearerToken{
Token: src.DatabaseToken,
}
}
// Use Token authentication for InfluxDB v2
if src.Type == chronograf.InfluxDBv2 {
return &TokenAuth{
Expand Down Expand Up @@ -71,6 +83,16 @@ func (a *TokenAuth) Set(r *http.Request) error {
return nil
}

// BearerToken adds `Authorization: Bearer <Token>` to the request header, where the token is in non-JWT format.
type BearerToken struct {
Token string
}

func (a *BearerToken) Set(r *http.Request) error {
r.Header.Set("Authorization", "Bearer "+a.Token)
return nil
}

// BearerJWT is the default Bearer for InfluxDB
type BearerJWT struct {
Username string
Expand Down
Loading
Loading