Skip to content

Additional debug flag on HTTP clients #950

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

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion internal/clients/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ func buildKibanaClient(cfg config.Client) (*kibana.Client, error) {
}

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

func buildAlertingClient(cfg config.Client, httpClient *http.Client) *alerting.APIClient {
alertingConfig := alerting.Configuration{
Debug: logging.IsDebugOrHigher(),
UserAgent: cfg.UserAgent,
Servers: alerting.ServerConfigurations{
{
Expand Down Expand Up @@ -521,6 +524,7 @@ func buildConnectorsClient(cfg config.Client, httpClient *http.Client) (*connect

func buildSloClient(cfg config.Client, httpClient *http.Client) *slo.APIClient {
sloConfig := slo.Configuration{
Debug: logging.IsDebugOrHigher(),
UserAgent: cfg.UserAgent,
Servers: slo.ServerConfigurations{
{
Expand Down
Loading