Skip to content

Commit d749aec

Browse files
authored
Additional debug flag on HTTP clients (#950)
1 parent 592dba3 commit d749aec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/clients/api_client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ func buildKibanaClient(cfg config.Client) (*kibana.Client, error) {
458458
}
459459

460460
if logging.IsDebugOrHigher() {
461-
// Don't use kib.Client.SetDebug() here as we re-use the http client within the OpenAPI generated clients
461+
// It is required to set debug mode even if we re-use the http client within the OpenAPI generated clients
462+
// some of the clients are not relying on the OpenAPI generated clients and are using the http client directly
463+
kib.Client.SetDebug(true)
462464
transport, err := kib.Client.Transport()
463465
if err != nil {
464466
return nil, err
@@ -481,6 +483,7 @@ func buildKibanaOapiClient(cfg config.Client) (*kibana_oapi.Client, error) {
481483

482484
func buildAlertingClient(cfg config.Client, httpClient *http.Client) *alerting.APIClient {
483485
alertingConfig := alerting.Configuration{
486+
Debug: logging.IsDebugOrHigher(),
484487
UserAgent: cfg.UserAgent,
485488
Servers: alerting.ServerConfigurations{
486489
{
@@ -521,6 +524,7 @@ func buildConnectorsClient(cfg config.Client, httpClient *http.Client) (*connect
521524

522525
func buildSloClient(cfg config.Client, httpClient *http.Client) *slo.APIClient {
523526
sloConfig := slo.Configuration{
527+
Debug: logging.IsDebugOrHigher(),
524528
UserAgent: cfg.UserAgent,
525529
Servers: slo.ServerConfigurations{
526530
{

0 commit comments

Comments
 (0)