datadog

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigInstance

func ConfigInstance() interface{}

func GetConfig

func GetConfig(connection *plugin.Connection) datadogConfig

GetConfig :: retrieve and cast connection config from query data

func Plugin

func Plugin(ctx context.Context) *plugin.Plugin

Types

type ApiResponse added in v1.1.0

type ApiResponse struct {
	Data  DataResponse  `json:"data"`
	Meta  MetaResponse  `json:"meta"`
	Links LinksResponse `json:"links"`
}

Root structure to represent the API response

func SearchSLO added in v1.1.0

func SearchSLO(client *datadog.APIClient, req *http.Request) (*ApiResponse, error)

type BudgetRemaining added in v1.1.0

type BudgetRemaining struct {
	Value float64 `json:"value"`
	Unit  string  `json:"unit"`
}

type Creator added in v1.1.0

type Creator struct {
	Name  string `json:"name"`
	ID    int    `json:"id"`
	Email string `json:"email"`
}

type CustomTransport

type CustomTransport struct {
	// contains filtered or unexported fields
}

CustomTransport holds DefaultTransport configuration and is used to for custom http error handling

func NewCustomTransport

func NewCustomTransport(t http.RoundTripper, opt CustomTransportOptions) *CustomTransport

NewCustomTransport returns new CustomTransport struct

func (*CustomTransport) DefaultBackoff

func (t *CustomTransport) DefaultBackoff(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration

It also tries to parse Retry-After response header when a http.StatusTooManyRequests (HTTP Code 429) is found in the resp parameter. Hence it will return the number of seconds the server states it may be ready to process more requests from this client.

func (*CustomTransport) RoundTrip

func (t *CustomTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip method used to retry http errors

type CustomTransportOptions

type CustomTransportOptions struct {
	Timeout *time.Duration
}

CustomTransportOptions Set options for CustomTransport

type DataResponse added in v1.1.0

type DataResponse struct {
	Type       string        `json:"type"`
	Attributes SLOAttributes `json:"attributes"`
}

type LinksResponse added in v1.1.0

type LinksResponse struct {
	Self  string `json:"self"`
	Last  string `json:"last"`
	Next  string `json:"next"`
	Prev  string `json:"prev"`
	First string `json:"first"`
}

type MetaResponse added in v1.1.0

type MetaResponse struct {
	Pagination *Pagination `json:"pagination"`
}

type OverallStatus added in v1.1.0

type OverallStatus struct {
	Status                  float64         `json:"status"`
	Timeframe               string          `json:"timeframe"`
	IndexedAt               int64           `json:"indexed_at"`
	SpanPrecision           int             `json:"span_precision"`
	RawErrorBudgetRemaining BudgetRemaining `json:"raw_error_budget_remaining"`
	ErrorBudgetRemaining    float64         `json:"error_budget_remaining"`
	Error                   interface{}     `json:"error"`
	State                   string          `json:"state"`
	Target                  float64         `json:"target"`
}

type Pagination added in v1.1.0

type Pagination struct {
	Number      *int    `json:"number"`
	FirstNumber *int    `json:"first_number"`
	PrevNumber  *int    `json:"prev_number"`
	NextNumber  *int    `json:"next_number"`
	LastNumber  *int    `json:"last_number"`
	Size        *int    `json:"size"`
	Type        *string `json:"type"`
	Total       *int    `json:"total"`
}

type Query added in v1.1.0

type Query struct {
	Metrics     interface{} `json:"metrics"`
	Denominator string      `json:"denominator"`
	Numerator   string      `json:"numerator"`
}

type RequestContext added in v1.1.0

type RequestContext struct {
	UserHasWriteAccessForSLO bool `json:"user_has_write_access_for_slo"`
}

type SLOAttributes added in v1.1.0

type SLOAttributes struct {
	SLOs []SLOResponse `json:"slos"`
}

type SLOAttributesDetails added in v1.1.0

type SLOAttributesDetails struct {
	Timeframe        *string         `json:"timeframe"`
	WarningThreshold *float64        `json:"warning_threshold"`
	Groups           interface{}     `json:"groups"`
	Thresholds       []Threshold     `json:"thresholds"`
	CreatedAt        *int64          `json:"created_at"`
	Status           SLOStatus       `json:"status"`
	TeamTags         []string        `json:"team_tags"`
	ModifiedAt       *int64          `json:"modified_at"`
	OverallStatus    []OverallStatus `json:"overall_status"`
	AllTags          []string        `json:"all_tags"`
	Query            *Query          `json:"query,omitempty"`
	RequestContext   RequestContext  `json:"request_context"`
	MonitorIDs       []int           `json:"monitor_ids,omitempty"`
	MonitorTags      []int           `json:"monitor_tags,omitempty"`
	ServiceTags      []string        `json:"service_tags"`
	Name             *string         `json:"name"`
	Description      interface{}     `json:"description"`
	SLOType          *string         `json:"slo_type"`
	TargetThreshold  *float64        `json:"target_threshold"`
	Creator          Creator         `json:"creator"`
	EnvTags          []string        `json:"env_tags"`
}

type SLOData added in v1.1.0

type SLOData struct {
	Type       string                `json:"type"`
	Attributes *SLOAttributesDetails `json:"attributes"`
	ID         string                `json:"id"`
}

type SLOResponse added in v1.1.0

type SLOResponse struct {
	Data *SLOData `json:"data"`
}

type SLOStatus added in v1.1.0

type SLOStatus struct {
	CalculationError        interface{}     `json:"calculation_error"`
	IndexedAt               *int64          `json:"indexed_at"`
	SpanPrecision           *int            `json:"span_precision"`
	RawErrorBudgetRemaining BudgetRemaining `json:"raw_error_budget_remaining"`
	ErrorBudgetRemaining    *float64        `json:"error_budget_remaining"`
	State                   *string         `json:"state"`
	SLI                     *float64        `json:"sli"`
}

type Threshold added in v1.1.0

type Threshold struct {
	TargetDisplay  *string     `json:"target_display"`
	Timeframe      *string     `json:"timeframe"`
	WarningDisplay interface{} `json:"warning_display"`
	Warning        interface{} `json:"warning"`
	Target         *float64    `json:"target"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL