mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-05 20:42:54 +00:00
There are quite a few benefits to this approach:
- Reduce config duplication
- The two sql_exporter configs were super similar with just a few
differences
- Pull SQL queries into standalone files
- That means we could run a SQL formatter on the file in the future
- It also means access to syntax highlighting
- In the future, run different queries for different PG versions
- This is relevant because right now, we have queries that are failing
on PG 17 due to catalog updates
Signed-off-by: Tristan Partin <tristan@neon.tech>
36 lines
1006 B
Makefile
36 lines
1006 B
Makefile
jsonnet_files = $(wildcard etc/*.jsonnet etc/*.libsonnet)
|
|
|
|
.PHONY: all
|
|
all: neon_collector.yml neon_collector_autoscaling.yml sql_exporter.yml sql_exporter_autoscaling.yml
|
|
|
|
neon_collector.yml: $(jsonnet_files)
|
|
JSONNET_PATH=etc jsonnet \
|
|
--output-file etc/$@ \
|
|
etc/neon_collector.jsonnet
|
|
|
|
neon_collector_autoscaling.yml: $(jsonnet_files)
|
|
JSONNET_PATH=etc jsonnet \
|
|
--output-file etc/$@ \
|
|
etc/neon_collector_autoscaling.jsonnet
|
|
|
|
sql_exporter.yml: $(jsonnet_files)
|
|
JSONNET_PATH=etc jsonnet \
|
|
--output-file etc/$@ \
|
|
--tla-str collector_file=neon_collector.yml \
|
|
etc/sql_exporter.jsonnet
|
|
|
|
sql_exporter_autoscaling.yml: $(jsonnet_files)
|
|
JSONNET_PATH=etc jsonnet \
|
|
--output-file etc/$@ \
|
|
--tla-str collector_file=neon_collector_autoscaling.yml \
|
|
--tla-str application_name=sql_exporter_autoscaling \
|
|
etc/sql_exporter.jsonnet
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm --force \
|
|
etc/neon_collector.yml \
|
|
etc/neon_collector_autoscaling.yml \
|
|
etc/sql_exporter.yml \
|
|
etc/sql_exporter_autoscaling.yml
|