Documentation ¶
Index ¶
- Constants
- Variables
- func CreateClient(APIKey string, endpoint string) *datadog.Client
- func DoWithRetries(maxRetries int, fn func() error) (i int, err error)
- func NewHTTPClient(timeout time.Duration) *http.Client
- func NormalizeServiceName(service string) string
- func NormalizeSpanKind(kind pdata.SpanKind) string
- func NormalizeSpanName(tag string, isService bool) string
- func SetDDHeaders(reqHeader http.Header, startInfo component.ApplicationStartInfo, apiKey string)
- func SetExtraHeaders(h http.Header, extras map[string]string)
- func UserAgent(startInfo component.ApplicationStartInfo) string
- func ValidateAPIKey(logger *zap.Logger, client *datadog.Client)
Constants ¶
const ( // maximum for tag string lengths MaxTagLength = 200 // DefaultServiceName is the default name we assign a service if it's missing and we have no reasonable fallback // From: https://github.com/DataDog/datadog-agent/blob/eab0dde41fe3a069a65c33d82a81b1ef1cf6b3bc/pkg/trace/traceutil/normalize.go#L15 DefaultServiceName string = "unnamed-otel-service" )
constants for tags
Variables ¶
Functions ¶
func CreateClient ¶
CreateClient creates a new Datadog client
func DoWithRetries ¶
DoWithRetries repeats a fallible action up to `maxRetries` times with exponential backoff
func NewHTTPClient ¶
NewClient returns a http.Client configured with the Agent options.
func NormalizeServiceName ¶ added in v0.19.0
NormalizeServiceName returns a span service name normalized to remove invalid characters TODO: we'd like to move to the datadog-agent traceutil version of this once it's available in the exportable package https://github.com/DataDog/datadog-agent/blob/eab0dde41fe3a069a65c33d82a81b1ef1cf6b3bc/pkg/trace/traceutil/normalize.go#L52
func NormalizeSpanKind ¶ added in v0.18.0
NormalizeSpanKind returns a span kind with the SPAN_KIND prefix trimmed off
func NormalizeSpanName ¶
func SetDDHeaders ¶
func SetDDHeaders(reqHeader http.Header, startInfo component.ApplicationStartInfo, apiKey string)
SetDDHeaders sets the Datadog-specific headers
func SetExtraHeaders ¶
SetExtraHeaders appends a header map to HTTP headers.
func UserAgent ¶
func UserAgent(startInfo component.ApplicationStartInfo) string
func ValidateAPIKey ¶
ValidateAPIKey checks that the provided client was given a correct API key.
Types ¶
This section is empty.