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

Tags for appoptics_dashboard_chart are ephemeral #54

Open
poleszcz opened this issue Sep 27, 2022 · 1 comment
Open

Tags for appoptics_dashboard_chart are ephemeral #54

poleszcz opened this issue Sep 27, 2022 · 1 comment

Comments

@poleszcz
Copy link
Contributor

Let's say we create chart like this:

resource "appoptics_dashboard_chart" "example_chart" {
  space_id   = appoptics_dashboard.example_dashboard.id
  name       = "Example Chart"
  #depends_on = [appoptics_metric.metric_two]
  min        = 0
  max        = 100
  label      = "Used"
  type       = "line"

  stream {
    metric      = appoptics_metric.metric_two.name
    color       = "#fa7268"
    units_short = "%"
    units_long  = "Percentage used"

    tags {
      name   = "environment"
      values = ["staging"]
    }
  }
}

AppOptics API doesn't return tags ...

curl \
>   -i \
>   -u $APPOPTICS_TOKEN: \
>   -X GET \
>   'https://api.appoptics.com/v1/spaces/1486654/charts/30584833'
HTTP/2 200
date: Tue, 27 Sep 2022 21:12:21 GMT
content-type: application/json
content-length: 188
server: roundhouse
strict-transport-security: max-age=31536000; includeSubDomains

{"id":30584833,"name":"Example Chart","type":"line","streams":[{"color":"#fa7268","units_short":"%","id":76476173,"metric":"example_metric_two","type":"gauge"}],"max":100.0,"label":"Used"}v

and terraform as well, during the next terraform plan, says that tags were removed...

 # appoptics_dashboard_chart.example_chart has been changed
  ~ resource "appoptics_dashboard_chart" "example_chart" {
        id            = "30584833"
        name          = "Example Chart"
        # (6 unchanged attributes hidden)

      + stream {
          + color       = "#fa7268"
          + max         = 0
          + metric      = "example_metric_two"
          + min         = 0
          + period      = 0
          + units_short = "%"
        }
      - stream {
          - color       = "#fa7268" -> null
          - metric      = "example_metric_two" -> null
          - units_long  = "Percentage used" -> null
          - units_short = "%" -> null

          - tags {
              - name   = "environment" -> null
              - values = [
                  - "staging",
                ] -> null
            }
        }
    }
@poleszcz
Copy link
Contributor Author

Maybe the issue is that ... there must be already tagged data for metric... to define tags for chart.

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

1 participant