Documentation
¶
Index ¶
- Constants
- func ParseConfiguration()
- func ValidateConfiguration()
- type Specification
- func (s *Specification) CancelDowntime(ctx context.Context, downtimeId string) (*http.Response, error)
- func (s *Specification) CreateDowntime(ctx context.Context, downtimeBody datadogV2.DowntimeCreateRequest) (datadogV2.DowntimeResponse, *http.Response, error)
- func (s *Specification) GetApiTimeout() time.Duration
- func (s *Specification) GetMonitor(ctx context.Context, monitorId int64, ...) (datadogV1.Monitor, *http.Response, error)
- func (s *Specification) ListMonitors(ctx context.Context, params datadogV1.ListMonitorsOptionalParameters) ([]datadogV1.Monitor, *http.Response, error)
- func (s *Specification) SendEvent(ctx context.Context, datadogEventBody datadogV1.EventCreateRequest) (datadogV1.EventCreateResponse, *http.Response, error)
- func (s *Specification) ValidateCredentials(ctx context.Context) (datadogV1.AuthenticationValidationResponse, *http.Response, error)
- func (s *Specification) WrapContextWithDatadogContextValues(ctx context.Context) context.Context
Constants ¶
View Source
const DefaultApiTimeout = 10 * time.Second
DefaultApiTimeout bounds a single call to the Datadog API. The Datadog client falls back to http.DefaultClient when no client is configured, and that one has no timeout at all - a slow Datadog API would then block action handlers until the agent's Request-Timeout elapses (the extension answers 503 "Timeout") and stall the discovery refresh loop indefinitely.
Variables ¶
This section is empty.
Functions ¶
func ParseConfiguration ¶
func ParseConfiguration()
func ValidateConfiguration ¶
func ValidateConfiguration()
Types ¶
type Specification ¶
type Specification struct {
// see https://docs.datadoghq.com/getting_started/site/#access-the-datadog-site
SiteParameter string `json:"siteParameter" split_words:"true" required:"true"`
SiteUrl string `json:"siteUrl" split_words:"true" required:"true"`
ApiKey string `json:"apiKey" split_words:"true" required:"true"`
ApplicationKey string `json:"applicationKey" split_words:"true" required:"true"`
// ApiTimeout is the timeout for a single request to the Datadog API.
ApiTimeout time.Duration `json:"apiTimeout" split_words:"true" required:"false" default:"10s"`
// Only used for testing:
TestingScheme *string `json:"testingScheme" split_words:"true" required:"false"`
TestingHost *string `json:"testingHost" split_words:"true" required:"false"`
DiscoveryAttributesExcludesMonitor []string `json:"discoveryAttributesExcludesMonitor" split_words:"true" required:"false"`
}
var (
Config Specification
)
func (*Specification) CancelDowntime ¶ added in v1.7.0
func (*Specification) CreateDowntime ¶ added in v1.7.0
func (s *Specification) CreateDowntime(ctx context.Context, downtimeBody datadogV2.DowntimeCreateRequest) (datadogV2.DowntimeResponse, *http.Response, error)
func (*Specification) GetApiTimeout ¶ added in v1.8.28
func (s *Specification) GetApiTimeout() time.Duration
GetApiTimeout returns the configured timeout, falling back to DefaultApiTimeout for Specifications that were not populated from the environment (tests, e2e).
func (*Specification) GetMonitor ¶
func (*Specification) ListMonitors ¶
func (s *Specification) ListMonitors(ctx context.Context, params datadogV1.ListMonitorsOptionalParameters) ([]datadogV1.Monitor, *http.Response, error)
func (*Specification) SendEvent ¶ added in v1.2.1
func (s *Specification) SendEvent(ctx context.Context, datadogEventBody datadogV1.EventCreateRequest) (datadogV1.EventCreateResponse, *http.Response, error)
func (*Specification) ValidateCredentials ¶
func (s *Specification) ValidateCredentials(ctx context.Context) (datadogV1.AuthenticationValidationResponse, *http.Response, error)
func (*Specification) WrapContextWithDatadogContextValues ¶
func (s *Specification) WrapContextWithDatadogContextValues(ctx context.Context) context.Context
Click to show internal directories.
Click to hide internal directories.