diff --git a/canned/disk_18aed9a7-dc83-406e-a4dc-40d53049541a.json b/canned/disk_18aed9a7-dc83-406e-a4dc-40d53049541a.json index 7515a386f..1f6cc0a05 100644 --- a/canned/disk_18aed9a7-dc83-406e-a4dc-40d53049541a.json +++ b/canned/disk_18aed9a7-dc83-406e-a4dc-40d53049541a.json @@ -1,31 +1,18 @@ { - "id": "18aed9a7-dc83-406e-a4dc-40d53049541a", - "measurement": "disk", - "app": "User Facing Application Name", - "cells": [{ - "x": 0, - "y": 0, - "w": 5, - "h": 5, - "i": "used_percent", - "name": "Used Percent", - "queries": [{ - "query": "select used_percent from disk", - "db": "telegraf", - "rp": "autogen" - }] - }, - { - "x": 5, - "y": 1, - "w": 5, - "h": 5, - "i": "cpu_usage", - "name": "CPU Usage", - "queries": [{ - "query": "select 100 - usage_idle from cpu", - "db": "telegraf", - "rp": "autogen" - }] - }] -} + "id": "e72c2eb9-d09b-46ea-b5df-0a82769e314d", + "measurement": "mem", + "app": "docker", + "cells": [{ + "x": 0, + "y": 0, + "w": 10, + "h": 10, + "i": "docker_test", + "name": "test", + "queries": [{ + "query": "select used_percent from disk", + "db": "telegraf", + "rp": "autogen" + }] + }] + } diff --git a/canned/new_apps.sh b/canned/new_apps.sh index b06b4edc2..7432eda5c 100755 --- a/canned/new_apps.sh +++ b/canned/new_apps.sh @@ -32,6 +32,8 @@ if [ -z "$measurement" ]; then exit fi +CELLID=$(uuidgen) +CELLID="$(tr [A-Z] [a-z] <<< "$CELLID")" UUID=$(uuidgen) UUID="$(tr [A-Z] [a-z] <<< "$UUID")" @@ -47,6 +49,8 @@ cat > $APP_FILE << EOF "y": 0, "w": 10, "h": 10, + "i": "$CELLID", + "name": "User facing cell Name", "queries": [{ "query": "select used_percent from disk", "db": "telegraf", diff --git a/server/mappings.go b/server/mappings.go index 9db3ef89c..9f3258c74 100644 --- a/server/mappings.go +++ b/server/mappings.go @@ -29,7 +29,7 @@ func (h *Service) GetMappings(w http.ResponseWriter, r *http.Request) { if seen[layout.Measurement+layout.ID] { continue } - mp.Mappings = append(mp.Mappings, mapping{layout.Measurement, layout.ID}) + mp.Mappings = append(mp.Mappings, mapping{layout.Measurement, layout.Measurement}) seen[layout.Measurement+layout.ID] = true }