DataDog / terraform-provider-datadog

Terraform Datadog provider
https://www.terraform.io/docs/providers/datadog/
Mozilla Public License 2.0
400 stars 376 forks source link

Add support for unit override on dashboard timeseries_defintion #2142

Open Marcus-James-Adams opened 1 year ago

Marcus-James-Adams commented 1 year ago

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

starlton-eb commented 10 months ago

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.

biasedbit commented 9 months ago

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

Kayron013 commented 4 months ago

+1 Would like to have this feature

ltesic commented 2 months ago

This one is needed for me too. +1

lenin-jaganathan commented 2 months ago

+1.

magicianseeker commented 1 month ago

Can we have them for other type of definition too, not only timeseries_definition? I believe it's handy to be adopted by other definitions e.q. toplist_definition, treemap_definition etc 🙇🏻

szycza commented 1 month ago

+1