Skip to content

Commit

Permalink
tempo-mixin: add Makefile and CI check (#957)
Browse files Browse the repository at this point in the history
* tempo-mixin: add Makefile and CI check

* Install jsonnet-bundler

* Install jsonnet-bundler (attempt 2)

* Install jsonnet-bundler (attempt 3)

* Install Jsonnet

* Install Jsonnet (attempt 2)

* Install Jsonnet (attempt 3)

* Install Jsonnet (attempt 4)

* Intentionally modify tempo-mixin without regenerating yamls

* Revert "Intentionally modify tempo-mixin without regenerating yamls"

This reverts commit e76761e.

* Clarify you need jsonnet as well
  • Loading branch information
kvrhdn committed Sep 14, 2021
1 parent 180e4cb commit 78d8107
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 11 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,24 @@ jobs:

- name: Build Tempo-Query
run: make tempo-query

tempo-mixin:
name: Check tempo-mixin
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Install jsonnet & jsonnet-bundler
run: |
brew install jsonnet
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0
- name: Check out code
uses: actions/checkout@v2

- name: Check tempo-mixin
run: make tempo-mixin-check
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 18 additions & 0 deletions operations/tempo-mixin/Makefile
Original file line number Diff line number Diff line change
@@ -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
19 changes: 8 additions & 11 deletions operations/tempo-mixin/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
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
```
### Build

To generate alerts, use:
```console
jsonnet -J vendor -S alerts.jsonnet > yamls/alerts.yaml
```
To regenerate dashboards, rule and alerts, run `make all`.

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:

To generate recording rules, use:
```console
jsonnet -J vendor -S rules.jsonnet > yamls/rules.yaml
brew install jsonnet
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0
```

0 comments on commit 78d8107

Please sign in to comment.