grafana / tempo

Grafana Tempo is a high volume, minimal dependency distributed tracing backend.
https://grafana.com/oss/tempo/
GNU Affero General Public License v3.0
3.99k stars 518 forks source link

Empty uid in mixin dashboards #1623

Closed angelluismula closed 1 year ago

angelluismula commented 2 years ago

Describe the bug Some dashboards don't have uid defined in their own json file. AFAIK this is the list of affected JSONs:

main branch

In repository tags (like 1.4.1)

To Reproduce Steps to reproduce the behavior:

  1. Clone grafana tempo repository

    $ git clone -b 'main' --quiet --depth 1 https://github.com/grafana/tempo.git mixins/tempo"

  2. Create a terraform configuration file with grafana terraform provider and grafana dashboards resources

    provider "grafana" { url = "https://grafana.example.com" auth = "admin:XXXXXXXXXXX" }

    resource "grafana_folder" "monitoring" { title = "monitoring" }

    resource "grafana_dashboard" "dashboards-tempo" { for_each = fileset("mixins/tempo/operations/tempo-mixin-compiled/dashboards/", "*.json") folder = grafana_folder.monitoring.id config_json = file("mixins/tempo/operations/tempo-mixin-compiled/dashboards/${each.key}") }

  3. Apply configuration files

    $ terraform apply ...

  4. Check if configuration differs between terraform config files and deployed

    $ terraform plan ...

    grafana_dashboard.dashboards-tempo["tempo-reads.json"] will be updated in-place

    ~ resource "grafana_dashboard" "dashboards-tempo" { ~ config_json = jsonencode( ~ { ~ uid = "b7J7AkmVz" -> ""

    (16 unchanged elements hidden)

        }
    )
    id           = "b7J7AkmVz"
    # (6 unchanged attributes hidden)

    }

    grafana_dashboard.dashboards-tempo["tempo-resources.json"] will be updated in-place

    ~ resource "grafana_dashboard" "dashboards-tempo" { ~ config_json = jsonencode( ~ { ~ uid = "NhbnAki4k" -> ""

    (16 unchanged elements hidden)

        }
    )
    id           = "NhbnAki4k"
    # (6 unchanged attributes hidden)

    }

    grafana_dashboard.dashboards-tempo["tempo-writes.json"] will be updated in-place

    ~ resource "grafana_dashboard" "dashboards-tempo" { ~ config_json = jsonencode( ~ { ~ uid = "JnJ70zmVz" -> ""

    (16 unchanged elements hidden)

        }
    )
    id           = "JnJ70zmVz"
    # (6 unchanged attributes hidden)

    }

Expected behavior uid field should exists.

Environment:

Additional Context When we use grafana_dashboard terrafom resource to deploy these dashboards in grafana, every time we execute terraform plan/apply a new change is detected in these dashboards because uid value is empty and grafana generate automatically a new uid. The next time that terraform will be run will detect a mismatch between json file uid value and deployed value in grafana.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. The next time this stale check runs, the stale label will be removed if there is new activity. The issue will be closed after 15 days if there is no new activity. Please apply keepalive label to exempt this Issue.