terraform-provider-datadog icon indicating copy to clipboard operation
terraform-provider-datadog copied to clipboard

Add support for unit override on dashboard timeseries_defintion

Open Marcus-James-Adams opened this issue 8 months ago • 3 comments

What resources or data sources are affected?

datadog_dashboard

Feature Request

via the browser, I can set the unit overrides on a time-series graph eg so that a number is actually seconds and then the graph displays it and scales the unit accordingly eg seconds/mins/hours etc

image

looking at the resource page it makes no mention of unit overrides for this widget type ( or many of them)

if I manually set it in the browser on previously applied code and then run another terraform plan instead of showing me it's changed i get no changes.

the details are there in the dashboard json, they are just not being parsed by the resource

eg: - snipped for clarity

              "type": "timeseries",
              "requests": [
                {
                  "formulas": [
                    {
                      "alias": "Seconds",
                      "formula": "query1",
                      "number_format": {
                        "unit": {
                          "type": "canonical_unit",
                          "unit_name": "second",
                          "per_unit_name": "second"
                        }
                      }
                    }
                  ],
                  "queries": [
                    {
                      "data_source": "metrics",
                      "name": "query1

References

No response

Marcus-James-Adams avatar Oct 11 '23 18:10 Marcus-James-Adams

This is exactly what I was looking for how to do. In my case, the underlying data is seconds and thus I wanted to change unit to "second(s)" in a timeseries_definition. Now I understand why I could not find it. I manually the widget after creating it via terraform and then ran terraform plan to give a hint, which showed a lot of positional changes but nothing unit related and now I guess I know why. This would be a very nice to have as otherwise, the data that represents seconds cannot be autoscaled and just represents a count.

starlton-eb avatar Dec 04 '23 20:12 starlton-eb

Echoing the need for this — it's really unfortunate to lose a key aesthetic feature in the process of automating observability definitions.

biasedbit avatar Jan 05 '24 01:01 biasedbit