Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard conversion from JSON to Terraform is dropping thresholds #1651

Open
umair-talabat opened this issue Oct 5, 2024 · 1 comment
Open

Comments

@umair-talabat
Copy link

Description

When I'm try dashboard conversion from JSON to Terraform using new relic cli, it is dropping thresholds from billboard widget.

Go Version

Provide the output of go version here please

Current behavior

When I'm try dashboard conversion from JSON to Terraform using new relic cli, it is dropping thresholds from billboard widget.

Expected behavior

When I'm try dashboard conversion from JSON to Terraform using new relic cli, it should convert thresholds of billboard widget.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create dashboard.
  2. Add billboard widget
  3. Add thresholds to billboard widget
  4. Export JSON
  5. Use newrelic cli to convert json to hcl cat dashboard.json | newrelic utils terraform dashboard --label my_dashboard_resource
  6. Check the converted hcl doesn't have thresholds

Debug Output (if applicable)

Additional Context

References or Related Issues

You can try with this json as well

{
  "name": "New Relic Terraform Example",
  "description": null,
  "permissions": "PUBLIC_READ_ONLY",
  "pages": [
    {
      "name": "New Relic Terraform Example",
      "description": null,
      "widgets": [
        {
          "title": "Requests per minute",
          "layout": {
            "column": 1,
            "row": 1,
            "width": 4,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.billboard"
          },
          "rawConfiguration": {
            "facet": {
              "showOtherSeries": false
            },
            "nrqlQueries": [
              {
                "accountIds": [
                  134
                ],
                "query": "FROM ServiceLevelSnapshot SELECT average(sliCompliance) WHERE entity.name='234' LIMIT 1"
              }
            ],
            "platformOptions": {
              "ignoreTimeRange": false
            },
            "thresholds": [
              {
                "alertSeverity": "WARNING",
                "value": 90
              },
              {
                "alertSeverity": "CRITICAL",
                "value": 95
              }
            ]
          }
        },
        {
          "title": "List of Transactions",
          "layout": {
            "column": 5,
            "row": 1,
            "width": 4,
            "height": 3
          },
          "linkedEntityGuids": null,
          "visualization": {
            "id": "viz.table"
          },
          "rawConfiguration": {
            "nrqlQueries": [
              {
                "accountId": 134,
                "query": "FROM Transaction SELECT *"
              }
            ],
            "platformOptions": {}
          }
        },
        {
          "title": "Average transaction duration, by application",
          "layout": {
            "column": 9,
            "row": 1,
            "width": 4,
            "height": 3
          },
          "linkedEntityGuids": [
            "1234"
          ],
          "visualization": {
            "id": "viz.bar"
          },
          "rawConfiguration": {
            "nrqlQueries": [
              {
                "accountId": 123,
                "query": "FROM Transaction SELECT average(duration) FACET appName"
              }
            ],
            "platformOptions": {}
          }
        }
      ]
    }
  ],
  "variables": []
}

This is the output, I'm getting:

widget_billboard {
      title = "Requests per minute"
      row = 1
      column = 1
      height = 3
      width = 4

      nrql_query {
        query = <<EOT
FROM Transaction SELECT rate(count(*), 1 minute)
EOT
      }
      facet_show_other_series = false
      legend_enabled = false
      ignore_time_range = false
      y_axis_left_min = 0
      y_axis_left_max = 0

      null_values {
        null_value = ""
      }

      units {
        unit = ""
      }

      colors {
        color = ""
      }
    }
    ```
    
    
    I understand widget_billboard might not support threshold, that's why thresholds are not being converted.
    Then let's add thresholds to widget_billboard. Happy to contribute.
@pranav-new-relic
Copy link
Member

pranav-new-relic commented Oct 29, 2024

Hi @umair-talabat, thanks for reporting this issue. It'd be great if you can contribute to this, since it'll take us quite a while to take a deeper look into this, prioritise and have this updated, given a bunch of other priorities across projects 😄 I'll keep you posted when we're able to look into this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants