Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
fix: Grafana dashboard uid (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Basty authored Mar 31, 2023
1 parent d3c509f commit 3f5fc8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions terraform/monitoring/dashboard.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ local lib = import 'lib.libsonnet';
local grafana = import 'grafonnet/grafana.libsonnet';
local dashboard = grafana.dashboard;
local annotation = grafana.annotation;
local row = grafana.row;
local statPanel = grafana.statPanel;
local prometheus = grafana.prometheus;
local template = grafana.template;

local ds_prometheus = {
type: 'prometheus',
uid: std.extVar('prometheus_uid'),
};

dashboard.new(
title = std.extVar('dashboard_title'),
uid = std.extVar('dashboard_title'),
title = "%s - %s" % [std.extVar('stage'), std.extVar('name')],
uid = "%s_%s" % [std.extVar('stage'), std.extVar('name')],
schemaVersion = 26,
editable = true,
graphTooltip = 'shared_crosshair',
Expand Down
5 changes: 3 additions & 2 deletions terraform/monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ data "jsonnet_file" "dashboard" {
source = "${path.module}/dashboard.jsonnet"

ext_str = {
dashboard_title = module.this.id
prometheus_uid = grafana_data_source.prometheus.uid
name = module.this.name
stage = module.this.stage
prometheus_uid = grafana_data_source.prometheus.uid
}
}

Expand Down

0 comments on commit 3f5fc8f

Please sign in to comment.