From 4a3787a13e16c8cbea50110a686089d515ce2fe9 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 15:52:39 +0200 Subject: [PATCH 01/11] tempo-mixin: add Makefile and CI check --- .github/workflows/ci.yml | 11 +++++++++++ Makefile | 8 ++++++++ operations/tempo-mixin/Makefile | 18 ++++++++++++++++++ operations/tempo-mixin/README.md | 18 +++--------------- 4 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 operations/tempo-mixin/Makefile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eda68562566..2b7e9be7f9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,14 @@ jobs: - name: Build Tempo-Query run: make tempo-query + + tempo-mixin: + name: Check tempo-mixin + runs-on: ubuntu-latest + steps: + + - name: Check out code + uses: actions/checkout@v2 + + - name: Check tempo-mixin + run: make tempo-mixin-check diff --git a/Makefile b/Makefile index df9dc7110aa..4ff2c0d41a9 100644 --- a/Makefile +++ b/Makefile @@ -200,3 +200,11 @@ docs: docs-test: docker pull ${DOCS_IMAGE} docker run -v ${PWD}/docs/tempo/website:/hugo/content/docs/tempo/latest:z -p 3002:3002 --rm $(DOCS_IMAGE) /bin/bash -c 'mkdir -p content/docs/grafana/latest/ && touch content/docs/grafana/latest/menu.yaml && make prod' + +### tempo-mixin +.PHONY: tempo-mixin tempo-mixin-check +tempo-mixin: + $(MAKE) -C operations/tempo-mixin all + +tempo-mixin-check: + $(MAKE) -C operations/tempo-mixin check diff --git a/operations/tempo-mixin/Makefile b/operations/tempo-mixin/Makefile new file mode 100644 index 00000000000..16471f8fb0c --- /dev/null +++ b/operations/tempo-mixin/Makefile @@ -0,0 +1,18 @@ +.PHONY: all check install dashboards alerts rules + +all: dashboards alerts rules + +check: all + git diff --exit-code -- yamls/ + +install: + jb install + +dashboards: install + jsonnet -J vendor -S dashboards.jsonnet -m yamls + +alerts: install + jsonnet -J vendor -S alerts.jsonnet > yamls/alerts.yaml + +rules: install + jsonnet -J vendor -S rules.jsonnet > yamls/rules.yaml diff --git a/operations/tempo-mixin/README.md b/operations/tempo-mixin/README.md index d5c90823582..adbfe5f811b 100644 --- a/operations/tempo-mixin/README.md +++ b/operations/tempo-mixin/README.md @@ -1,17 +1,5 @@ -Dashboards, rules and alerts are in the `yamls` folder. Use them directly in Prometheus & Grafana to monitor Tempo. +# tempo-mixin -To generate dashboards with this mixin use: +Dashboards, rules and alerts are in the [`yamls`](./yamls) folder. Use them directly in Prometheus & Grafana to monitor Tempo. -```console -jb install && jsonnet -J vendor -S dashboards.jsonnet -m yamls -``` - -To generate alerts, use: -```console -jsonnet -J vendor -S alerts.jsonnet > yamls/alerts.yaml -``` - -To generate recording rules, use: -```console -jsonnet -J vendor -S rules.jsonnet > yamls/rules.yaml -``` +To generate dashboards, rule and alerts, run `make all`. From ae8e73afd18d79b57a481a1ce812551eb27d185b Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 16:14:06 +0200 Subject: [PATCH 02/11] Install jsonnet-bundler --- .github/workflows/ci.yml | 3 +++ operations/tempo-mixin/README.md | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b7e9be7f9c..ee2a503599c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,5 +52,8 @@ jobs: - name: Check out code uses: actions/checkout@v2 + - name: Install jsonnet-bundler + run: go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 + - name: Check tempo-mixin run: make tempo-mixin-check diff --git a/operations/tempo-mixin/README.md b/operations/tempo-mixin/README.md index adbfe5f811b..8d748ff0dd2 100644 --- a/operations/tempo-mixin/README.md +++ b/operations/tempo-mixin/README.md @@ -2,4 +2,12 @@ Dashboards, rules and alerts are in the [`yamls`](./yamls) folder. Use them directly in Prometheus & Grafana to monitor Tempo. -To generate dashboards, rule and alerts, run `make all`. +### Build + +To regenerate dashboards, rule and alerts, run `make all`. + +This requires jsonnet-bundler to be installed, install it with the following command: + +```console +go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 +``` From 90607b9b8ebb896fb1a6c585f8d28d33eeac33d0 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 16:17:15 +0200 Subject: [PATCH 03/11] Install jsonnet-bundler (attempt 2) --- .github/workflows/ci.yml | 2 +- operations/tempo-mixin/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee2a503599c..91dc9b193e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: uses: actions/checkout@v2 - name: Install jsonnet-bundler - run: go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 + run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - name: Check tempo-mixin run: make tempo-mixin-check diff --git a/operations/tempo-mixin/README.md b/operations/tempo-mixin/README.md index 8d748ff0dd2..12632806882 100644 --- a/operations/tempo-mixin/README.md +++ b/operations/tempo-mixin/README.md @@ -9,5 +9,5 @@ To regenerate dashboards, rule and alerts, run `make all`. This requires jsonnet-bundler to be installed, install it with the following command: ```console -go get -u github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 +go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 ``` From 49919a28114fd8d9bcc451966ff30b2d149d37ed Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 16:22:33 +0200 Subject: [PATCH 04/11] Install jsonnet-bundler (attempt 3) --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91dc9b193e0..8a66c131403 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,11 @@ jobs: runs-on: ubuntu-latest steps: + - name: Set up Go 1.16 + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Check out code uses: actions/checkout@v2 From c6d14cea80cb9b41bb55f7dcb04392aff729d399 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 16:25:03 +0200 Subject: [PATCH 05/11] Install Jsonnet --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a66c131403..76257abcf8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,5 +60,8 @@ jobs: - name: Install jsonnet-bundler run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 + - name: Set up Jsonnet + uses: zendesk/setup-jsonnet@v1 + - name: Check tempo-mixin run: make tempo-mixin-check From edf13144055ec242e461349735287d2d1c88b89b Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 16:27:02 +0200 Subject: [PATCH 06/11] Install Jsonnet (attempt 2) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76257abcf8d..ec11cdd59c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - name: Set up Jsonnet - uses: zendesk/setup-jsonnet@v1 + uses: zendesk/setup-jsonnet@v7 - name: Check tempo-mixin run: make tempo-mixin-check From d5d50fd9e17ec6dfcaf29abb7fd5da0b44565ee3 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 16:39:07 +0200 Subject: [PATCH 07/11] Install Jsonnet (attempt 3) --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec11cdd59c5..582123a9e91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,14 +54,13 @@ jobs: with: go-version: 1.16 + - name: Install jsonnet & jsonnet-bundler + run: | + go install github.com/google/go-jsonnet/cmd/jsonnet@v0.17.0 + go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 + - name: Check out code uses: actions/checkout@v2 - - name: Install jsonnet-bundler - run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - - - name: Set up Jsonnet - uses: zendesk/setup-jsonnet@v7 - - name: Check tempo-mixin run: make tempo-mixin-check From 4cbc1556aff948449de287052126b67c828fb1c3 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 17:03:39 +0200 Subject: [PATCH 08/11] Install Jsonnet (attempt 4) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 582123a9e91..0f6258a2383 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: - name: Install jsonnet & jsonnet-bundler run: | - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.17.0 + brew install jsonnet go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - name: Check out code From e76761e95377ff0384cfd955e436e7bc6bae1ea4 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 17:06:40 +0200 Subject: [PATCH 09/11] Intentionally modify tempo-mixin without regenerating yamls --- operations/tempo-mixin/dashboards.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/tempo-mixin/dashboards.libsonnet b/operations/tempo-mixin/dashboards.libsonnet index e7428ec7389..29f609a98e9 100644 --- a/operations/tempo-mixin/dashboards.libsonnet +++ b/operations/tempo-mixin/dashboards.libsonnet @@ -6,7 +6,7 @@ dashboard_utils { grafanaDashboards+: { 'tempo-operational.json': import './tempo-operational.json', 'tempo-reads.json': - $.dashboard('Tempo / Reads') + $.dashboard('Tempo') .addClusterSelectorTemplates() .addRow( g.row('Gateway') From 8e31ebb498cf02ec6c63274f57fc8b93fbcf72a4 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 17:08:51 +0200 Subject: [PATCH 10/11] Revert "Intentionally modify tempo-mixin without regenerating yamls" This reverts commit e76761e95377ff0384cfd955e436e7bc6bae1ea4. --- operations/tempo-mixin/dashboards.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/tempo-mixin/dashboards.libsonnet b/operations/tempo-mixin/dashboards.libsonnet index 29f609a98e9..e7428ec7389 100644 --- a/operations/tempo-mixin/dashboards.libsonnet +++ b/operations/tempo-mixin/dashboards.libsonnet @@ -6,7 +6,7 @@ dashboard_utils { grafanaDashboards+: { 'tempo-operational.json': import './tempo-operational.json', 'tempo-reads.json': - $.dashboard('Tempo') + $.dashboard('Tempo / Reads') .addClusterSelectorTemplates() .addRow( g.row('Gateway') From 12adfb9d8b437aea95af15a5a7f165b36669a59b Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 14 Sep 2021 17:17:01 +0200 Subject: [PATCH 11/11] Clarify you need jsonnet as well --- operations/tempo-mixin/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/operations/tempo-mixin/README.md b/operations/tempo-mixin/README.md index 12632806882..5225013a2f2 100644 --- a/operations/tempo-mixin/README.md +++ b/operations/tempo-mixin/README.md @@ -6,8 +6,9 @@ Dashboards, rules and alerts are in the [`yamls`](./yamls) folder. Use them dire To regenerate dashboards, rule and alerts, run `make all`. -This requires jsonnet-bundler to be installed, install it with the following command: +This requires [jsonnet](https://jsonnet.org/) and [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) to be installed, install these with the following commands: ```console +brew install jsonnet go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 ```