Skip to content

Commit

Permalink
fix: prometheus test/doc cleanup (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
msaf1980 authored Nov 2, 2023
1 parent 10918b8 commit c47e8c8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ doc/config.md: deploy/doc/graphite-clickhouse.conf deploy/doc/config.md

config: doc/config.md

# run after prometheus upgrade
prometheus/ui:
vendor_prometheus_ui.sh

test:
$(GO) test -race ./...

Expand Down
6 changes: 3 additions & 3 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ sample-thereafter = 12
assert.Equal(t, expected.Carbonlink, config.Carbonlink)

// Prometheus
expected.Prometheus = Prometheus{":9092", "https://server:3456/uri", nil, "Prometheus Time Series", 5 * time.Minute}
expected.Prometheus = Prometheus{Listen: ":9092", ExternalURLRaw: "https://server:3456/uri", PageTitle: "Prometheus Time Series", LookbackDelta: 5 * time.Minute, RemoteReadConcurrencyLimit: 10}
u, _ := url.Parse(expected.Prometheus.ExternalURLRaw)
expected.Prometheus.ExternalURL = u
assert.Equal(t, expected.Prometheus, config.Prometheus)
Expand Down Expand Up @@ -690,7 +690,7 @@ sample-thereafter = 12
assert.Equal(t, expected.Carbonlink, config.Carbonlink)

// Prometheus
expected.Prometheus = Prometheus{":9092", "https://server:3456/uri", nil, "Prometheus Time Series", 5 * time.Minute}
expected.Prometheus = Prometheus{Listen: ":9092", ExternalURLRaw: "https://server:3456/uri", PageTitle: "Prometheus Time Series", LookbackDelta: 5 * time.Minute, RemoteReadConcurrencyLimit: 10}
u, _ := url.Parse(expected.Prometheus.ExternalURLRaw)
expected.Prometheus.ExternalURL = u
assert.Equal(t, expected.Prometheus, config.Prometheus)
Expand Down Expand Up @@ -1005,7 +1005,7 @@ sample-thereafter = 12
assert.Equal(t, expected.Carbonlink, config.Carbonlink)

// Prometheus
expected.Prometheus = Prometheus{":9092", "https://server:3456/uri", nil, "Prometheus Time Series", 5 * time.Minute}
expected.Prometheus = Prometheus{Listen: ":9092", ExternalURLRaw: "https://server:3456/uri", PageTitle: "Prometheus Time Series", LookbackDelta: 5 * time.Minute, RemoteReadConcurrencyLimit: 10}
u, _ := url.Parse(expected.Prometheus.ExternalURLRaw)
expected.Prometheus.ExternalURL = u
assert.Equal(t, expected.Prometheus, config.Prometheus)
Expand Down
2 changes: 2 additions & 0 deletions doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ Only one tag used as filter for index field Tag1, see graphite_tagged table [str
external-url = ""
page-title = "Prometheus Time Series Collection and Processing Server"
lookback-delta = "5m0s"
# concurrently handled remote read requests
remote-read-concurrency-limit = 10

# see doc/debugging.md
[debug]
Expand Down
21 changes: 10 additions & 11 deletions vendor_prometheus_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ cd $(dirname $0)

BRANCH=$(cat go.mod | grep 'github.com/prometheus/prometheus' | awk '{print $2}')

rm -rf tmp
mkdir tmp
git clone --depth 1 --branch $BRANCH https://github.com/prometheus/prometheus.git tmp
rm -rf tmp || exit 1
mkdir tmp || exit 1
git clone --depth 1 --branch $BRANCH https://github.com/prometheus/prometheus.git tmp || exit 1

cd tmp
make assets-compress
cd tmp || exit 1
make assets-compress || exit 1

cd ..
cd .. || exit 1

cp tmp/web/ui/embed.go vendor/github.com/prometheus/prometheus/web/ui/embed.go
rm -rf vendor/github.com/prometheus/prometheus/web/ui/static
cp -a tmp/web/ui/static vendor/github.com/prometheus/prometheus/web/ui/static
rm -f vendor/github.com/prometheus/prometheus/web/ui/.gitignore
rm -rf tmp
cp tmp/web/ui/embed.go vendor/github.com/prometheus/prometheus/web/ui/embed.go || exit 1
rm -rf vendor/github.com/prometheus/prometheus/web/ui/static || exit 1
cp -a tmp/web/ui/static vendor/github.com/prometheus/prometheus/web/ui/static || exit 1
rm -rf vendor/github.com/prometheus/prometheus/web/ui/.gitignore tmp || exit 1

0 comments on commit c47e8c8

Please sign in to comment.