Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ jobs:
- checkout
- attach_workspace:
at: *working_directory
- restore_cache:
keys:
- temboard-{{ .Branch }}
- temboard-master
- run:
name: Build Agent & UI
command: |
Expand All @@ -139,6 +143,10 @@ jobs:
- agent/dist/*.whl
- ui/dist/*.tar.gz
- ui/dist/*.whl
- ui/build/bin/prometheus
- save_cache:
key: temboard-{{ .Branch }}
paths: ["dev/downloads/"]

lint-python:
docker: [image: python:3.9]
Expand Down Expand Up @@ -265,8 +273,8 @@ jobs:
- persist_to_workspace:
root: .
paths:
- agent/dist/*.noarch.rpm
- ui/dist/*.noarch.rpm
- agent/dist/temboard-agent-*.noarch.rpm
- ui/dist/temboard-*.rpm

deb:
parameters:
Expand Down
2 changes: 1 addition & 1 deletion .config/temboard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ method = stderr
level = DEBUG

[monitoring]
prometheus = dev/bin/prometheus
prometheus = ui/build/bin/prometheus

[notifications]
# SMTP host
Expand Down
24 changes: 0 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,30 +471,6 @@ and if not found, tries to download wheel from PyPI.
Use top level `make dist` to generate wheels.


## Testing with Grafana

temBoard exposes /metrics in OpenMetric format. Development environment
includes Prometheus and Grafana preconfigured with authenticated access and
file-based service discovery. You only need a couple of steps to view temBoard
metrics in Grafana.

- Start development temBoard UI and at lease one of agent0 or agent1.
- Generate Prometheus targets using `make prom-targets`.
- Go to [development Grafana import page](http://localhost:3000/dashboard/import).
- Import Dashboard ID [1860](https://grafana.com/grafana/dashboards/1860)
(*Node Exporter Full*) or [9628](https://grafana.com/grafana/dashboards/1860)
(*PostgreSQL Database*).
- Now wait a few minutes that Prometheus scrapes data. Scrape interval is 1
minute.

temBoard exposes only a subset of metrics from node\_exporter and
postgres\_exporter, plus a set of custom metrics prefixed with `x`, e.g.
`xpg_wal_files_bytes_total`. Thus a lot of panel will show *N/A*.

Prometheus also watch `dev/prometheus/targets/custom.yaml` files for hand
written targets.


## Investigate logs with lnav

[lnav] is an awesome tool to browse and analyze log files.
Expand Down
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ develop-%:: .env
@dev/bin/checkdocker $(DOCKER_MAX_VERSION)
git config blame.ignoreRevsFile .git-blame-ignore-revs
if [ -d ~/.config/lnav/formats ] ; then ln -fsTv $$PWD/dev/lnav/formats ~/.config/lnav/formats/temboard ; fi
$(MAKE) -j 2 install-$* dev/bin/prometheus
$(MAKE) -j 2 install-$* ui/build/bin/prometheus ui/build/bin/promtool
mkdir -p dev/temboard
cd ui/; npm install-clean
cd ui/; npm run build
Expand Down Expand Up @@ -56,20 +56,21 @@ install-%: venv-%
dev/venv-py$*/bin/temboard-agent --version # smoke test

# LTS
PROMETHEUS_VERSION=2.45.1
PROMETHEUS_VERSION=2.53.0
dev/downloads/prometheus-%.linux-amd64.tar.gz:
mkdir -p $(dir $@)
curl --fail --silent -L "https://github.com/prometheus/prometheus/releases/download/v$*/$(notdir $@)" --output $@

dev/bin/prometheus dev/bin/promtool: dev/downloads/prometheus-$(PROMETHEUS_VERSION).linux-amd64.tar.gz
ui/build/bin/prometheus ui/build/bin/promtool: dev/downloads/prometheus-$(PROMETHEUS_VERSION).linux-amd64.tar.gz
mkdir -p $(dir $@)
tar --extract --file "$<" --directory "$(dir $@)" --strip-component=1 --touch "prometheus-$(PROMETHEUS_VERSION).linux-amd64/$(notdir $@)"
"$@" --version # Smoketest

clean: #: Trash venv and containers.
docker compose down --volumes --remove-orphans
docker rmi --force dalibo/temboard-agent:dev
rm -rf dev/venv-py* .venv-py* dev/build/ dev/prometheus/targets/temboard-dev.yaml
rm -vf dev/bin/prometheus dev/bin/promtool
rm -rf dev/venv-py* .venv-py* dev/build/
rm -vf ui/build/bin/prometheus ui/build/bin/promtool
rm -rf agent/build/ .env agent/.coverage
rm -rvf ui/build/ ui/.coverage
$(MAKE) clean-static
Expand Down Expand Up @@ -127,10 +128,6 @@ tests: #: Execute all tests.
clean-tests: #: Clean tests runtime files
rm -rf tests/downloads/ tests/logs/ tests/screenshots/

prom-targets: dev/prometheus/targets/temboard-dev.yaml #: Generate Prometheus dev targets.
dev/prometheus/targets/temboard-dev.yaml: dev/bin/mktargets .env
$^ > $@

VERSION=$(shell cd ui; python3 setup.py --version)
BRANCH?=master
# When stable branch v8 is created, use this:
Expand Down Expand Up @@ -162,7 +159,7 @@ release: #: Tag and push a new git release.
release-notes: #: Extract changes for current release
FINAL_VERSION="$(shell echo $(VERSION) | grep -Po '([^a-z]{3,})')" ; sed -En "/Unreleased/d;/^#+ $$FINAL_VERSION/,/^#/p" CHANGELOG.md | sed '1d;$$d'

dist: #: Build sources and wheels.
dist: ui/build/bin/prometheus #: Build sources and wheels.
cd agent/; python3 setup.py sdist bdist_wheel
test -f ui/temboardui/static/dist/.vite/manifest.json
cd ui/; python3 setup.py sdist bdist_wheel --universal
Expand Down
2 changes: 1 addition & 1 deletion agent/temboardagent/web/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __str__(self):
return self.name

# for services.run
def setup(self):
def setup(self, *_, **__):
ServerHandler.server_software = "temBoard-agent/%s" % __version__

try:
Expand Down
24 changes: 0 additions & 24 deletions dev/bin/mktargets

This file was deleted.

12 changes: 0 additions & 12 deletions dev/grafana/rootfs/etc/grafana/provisioning/dashboards/perf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,3 @@ providers:
allowUiUpdates: true
options:
path: /usr/share/temboard/perf.json
- name: "Postgres from temBoard agent"
type: file
folder: ''
allowUiUpdates: true
options:
path: /usr/share/temboard/postgres.json
- name: "temBoard Prometheus"
type: file
folder: ''
allowUiUpdates: true
options:
path: /usr/share/temboard/temboard-prometheus.json
201 changes: 0 additions & 201 deletions dev/grafana/rootfs/usr/share/temboard/postgres.json

This file was deleted.

Loading