Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DatadogTemplateFuncs = template.FuncMap{ "ddDateTime": func(t time.Time) string { return t.Format(time.RFC3339) }, "ddStringIn": func(values []string) string { if len(values) == 0 { return "" } quoted := make([]string, len(values)) for i, v := range values { escaped := strings.ReplaceAll(v, `"`, `\"`) quoted[i] = `"` + escaped + `"` } return strings.Join(quoted, ",") }, "ddLike": func(pattern string) string { escaped := strings.ReplaceAll(pattern, `"`, `\"`) return `"` + escaped + `"` }, "ddFacet": func(field string) string { if !strings.HasPrefix(field, "@") && !strings.Contains(field, ".") { return "@" + field } return field }, }
DatadogTemplateFuncs provides template helpers for Datadog search queries
Functions ¶
func RenderDatadogQuery ¶
func RenderDatadogQuery(ctx context.Context, tmpl string, params map[string]interface{}) (types.DatadogQuery, error)
RenderDatadogQuery renders a query template with the given parameters
func ValidateQuery ¶
ValidateQuery performs basic validation on the rendered query
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.