Documentation ¶
Index ¶
- Variables
- func CreateClient(apiKey string, endpoint string) *datadog.Client
- func NewHTTPClient(settings exporterhelper.TimeoutSettings, insecureSkipVerify bool) *http.Client
- func SetDDHeaders(reqHeader http.Header, buildInfo component.BuildInfo, apiKey string)
- func SetExtraHeaders(h http.Header, extras map[string]string)
- func UserAgent(buildInfo component.BuildInfo) string
- func ValidateAPIKey(logger *zap.Logger, client *datadog.Client) error
- type Retrier
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // JSONHeaders headers for JSON requests. JSONHeaders = map[string]string{ "Content-Type": "application/json", "Content-Encoding": "gzip", } // ProtobufHeaders headers for protobuf requests. ProtobufHeaders = map[string]string{ "Content-Type": "application/x-protobuf", "Content-Encoding": "identity", } )
View Source
var ErrInvalidAPI = errors.New("API Key validation failed")
Functions ¶
func CreateClient ¶
CreateClient creates a new Datadog client
func NewHTTPClient ¶
func NewHTTPClient(settings exporterhelper.TimeoutSettings, insecureSkipVerify bool) *http.Client
NewHTTPClient returns a http.Client configured with the Agent options.
func SetDDHeaders ¶
SetDDHeaders sets the Datadog-specific headers
func SetExtraHeaders ¶
SetExtraHeaders appends a header map to HTTP headers.
func ValidateAPIKey ¶
ValidateAPIKey checks that the provided client was given a correct API key.
Types ¶
type Retrier ¶ added in v0.41.0
type Retrier struct {
// contains filtered or unexported fields
}
func NewRetrier ¶ added in v0.41.0
func NewRetrier(logger *zap.Logger, settings exporterhelper.RetrySettings, scrubber scrub.Scrubber) *Retrier
func (*Retrier) DoWithRetries ¶ added in v0.41.0
DoWithRetries does a function with retries. This is a condensed version of the code on the exporterhelper, which we reuse here since we want custom retry logic.
Click to show internal directories.
Click to hide internal directories.