Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tempo-mixin: add Makefile and CI check #957

Merged
merged 12 commits into from
Sep 14, 2021
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- 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
@@ -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/[email protected]
```