Skip to content

Commit

Permalink
Add Elastic-Api-Version header to kibana client (#148)
Browse files Browse the repository at this point in the history
* Add Elastic-Api-Version header to the default config of kibana client
  • Loading branch information
pchila authored Sep 11, 2023
1 parent 4dea101 commit 9b36953
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kibana/client_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import (
"github.com/elastic/elastic-agent-libs/transport/httpcommon"
)

const elasticAPIVersionHeaderKey = "Elastic-Api-Version"
const elasticAPIDefaultVersion = "2023-10-31"

// ClientConfig to connect to Kibana
type ClientConfig struct {
Protocol string `config:"protocol" yaml:"protocol,omitempty"`
Expand Down Expand Up @@ -54,6 +57,7 @@ func DefaultClientConfig() ClientConfig {
APIKey: "",
ServiceToken: "",
Transport: httpcommon.DefaultHTTPTransportSettings(),
Headers: map[string]string{elasticAPIVersionHeaderKey: elasticAPIDefaultVersion},
}
}

Expand Down

0 comments on commit 9b36953

Please sign in to comment.