[datadog_dashboard_v2] Add anomaly_detection to timeseries widget#3778
Open
yacomink wants to merge 1 commit into
Open
[datadog_dashboard_v2] Add anomaly_detection to timeseries widget#3778yacomink wants to merge 1 commit into
yacomink wants to merge 1 commit into
Conversation
Syncs the `anomaly_detection` field from the updated OpenAPI spec (TimeseriesWidgetDefinition) into the FieldSpec mapping engine. Adds `timeseriesWidgetAnomalyDetectionFields` (one required string field: `detection_sensitivity` enum `never_detect`) and wires it into `TimeseriesWidgetSpec` as an optional `TypeBlock`. Regenerates docs. Adds acceptance test `TestAccDatadogDashboardV2TimeseriesAnomalyDetection` with cassette to be recorded.
maycmlee
reviewed
May 13, 2026
|
|
||
| Required: | ||
|
|
||
| - `detection_sensitivity` (String) Sensitivity level for anomaly detection. Use `never_detect` to disable anomaly detection. Valid values are `never_detect`. |
Contributor
There was a problem hiding this comment.
It sounds like there should be different levels as value, but how come the only valid values are never_detect?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Syncs the
anomaly_detectionfield from the Datadog OpenAPI spec (TimeseriesWidgetDefinition) into thedatadog_dashboard_v2FieldSpec mapping engine.OpenAPI spec change: DataDog/datadog-api-spec#5680
Fields added:
timeseries_definition.anomaly_detectiontimeseries_definition.anomaly_detection.detection_sensitivitydetection_sensitivitycurrently accepts only"never_detect"(disables anomaly detection).HCL example
Implementation
datadog/dashboardmapping/widgets.go: addedtimeseriesWidgetAnomalyDetectionFields(one Go slice per OpenAPI schema) andanomaly_detectionTypeBlock entry onTimeseriesWidgetSpecdatadog/tests/resource_datadog_dashboard_v2_timeseries_anomaly_detection_test.go: acceptance test covering the new fielddatadog/tests/provider_test.go: registered new test filedocs/: regeneratedTest plan
OTEL_TRACES_EXPORTER= RECORD=true TESTARGS="-run TestAccDatadogDashboardV2TimeseriesAnomalyDetection$" make testaccOTEL_TRACES_EXPORTER= RECORD=false TESTARGS="-run TestAccDatadogDashboardV2TimeseriesAnomalyDetection" make testaccgo build ./...✅go vet ./datadog/dashboardmapping/...✅make test) ✅make check-docs✅ (after committing regenerated docs)