Influx: Support PDC for Influx SQL (#103032)

* Support PDC for Influx SQL

* Correctly set the gRPC transport creds dial option

* Logging and refactor

* Allow URLs with no scheme

* Use passthrough resolver for socks proxy

* Update comment

* Extract url parsing and add test

* Check err
This commit is contained in:
Andreas Christou
2025-04-02 16:21:59 +01:00
committed by GitHub
parent 4f19995bef
commit 47ec51fda7
5 changed files with 138 additions and 18 deletions
+7
View File
@@ -72,6 +72,12 @@ func newInstanceSettings(httpClientProvider httpclient.Provider) datasource.Inst
database = settings.Database
}
proxyClient, err := settings.ProxyClient(ctx)
if err != nil {
logger.Error("influx proxy creation failed", "error", err)
return nil, fmt.Errorf("influx proxy creation failed")
}
model := &models.DatasourceInfo{
HTTPClient: client,
URL: settings.URL,
@@ -85,6 +91,7 @@ func newInstanceSettings(httpClientProvider httpclient.Provider) datasource.Inst
InsecureGrpc: jsonData.InsecureGrpc,
Token: settings.DecryptedSecureJSONData["token"],
Timeout: opts.Timeouts.Timeout,
ProxyClient: proxyClient,
}
return model, nil
}