Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
d186d85
Return 403 with PUT verb if lifecycle is not enabled
snebel29 Sep 25, 2019
27bbc23
Improve message when Lifecycle API is not enabled
snebel29 Sep 25, 2019
5a554df
Nit: Improve doc text grammar (#6068)
snebel29 Sep 28, 2019
ea2c836
Merge pull request #6057 from snebel29/fix/management-api-return-code…
beorn7 Sep 30, 2019
103f26d
fix the wrong word (#6069)
tanjunchen Sep 30, 2019
5264b96
fix punctuation mark
abejide001 Sep 30, 2019
188917a
Merge pull request #6078 from abejide001/remove-punctuation-mark
beorn7 Oct 1, 2019
95dc59e
Replaced t.Fatalf() with testutil.Assert() in buffer_test.go (#6084)
joe-elliott Oct 2, 2019
0fbc8c1
Include tsdb tool in builds (#6085)
SuperQ Oct 2, 2019
493ef2f
Benchmark for loading WAL (#6081)
codesome Oct 3, 2019
53ea6d6
Allocate the shards only once while reading WAL (#6093)
codesome Oct 3, 2019
16f1e25
Small grammar fix on alerting rules doc (#6104)
kahinton Oct 7, 2019
895abbb
Replaced test validations with testutils on storage/remote/codec_test…
gfelixc Oct 7, 2019
8df4bca
Garbage collect asynchronously in the WAL Watcher
csmarchbanks Sep 13, 2019
7465f27
Refactor on discovery/manager_test.go
nevill Sep 24, 2019
4dfc7a2
Remove unnecessary lock in loadWAL (#6107)
codesome Oct 8, 2019
fc945c4
Merge pull request #6021 from prometheus/reload-checkpoint-async
beorn7 Oct 8, 2019
706f3b2
Merge pull request #6054 from nevill/refactor/manager_test
beorn7 Oct 8, 2019
84ff928
Make sure the remote write storage uses a dedupe logger. (#6113)
cstyan Oct 8, 2019
ad58fc4
ui: handle null response properly (#6071)
GiedriusS Oct 9, 2019
0f022aa
fix unreasonable goimports (#6115)
tanjunchen Oct 9, 2019
8ec6f02
discovery: don't log errors on context cancelation
simonpasquier Oct 9, 2019
6b22997
Merge pull request #6116 from simonpasquier/fix-sd-error-logs-on-cancel
brancz Oct 9, 2019
81d284f
Merge the 2.13 release branch to master (#6117)
krasi-georgiev Oct 9, 2019
81fa630
Add additional shards/segment graphs to remote write dashboard.
cstyan Oct 9, 2019
e388262
promql: Move tests to testutil (#6103)
dzeban Oct 10, 2019
47e51c8
Correct spelling mistakes
yuxiaobo96 Oct 10, 2019
4275c4a
Merge pull request #6123 from yuxiaobo96/prometheus-check2
beorn7 Oct 10, 2019
04c1c79
Clarify the branch in preparing the release (#6122)
codesome Oct 11, 2019
b05b5f9
remove debug fmt.Println in tombstones. (#6135)
krasi-georgiev Oct 14, 2019
15de05d
adding unit test for target group
jbleduigou Oct 14, 2019
5146bb1
adding unit test for target group (#6138)
jbleduigou Oct 14, 2019
b035c55
Step down and propose Ganesh as TSDB maintainer
gouthamve Oct 10, 2019
f7e1f06
Makefile: change default target to include check_assets (#5932)
simonpasquier Oct 15, 2019
3c70284
Merge pull request #6137 from gouthamve/propose-ganesh-tsdb
beorn7 Oct 15, 2019
1f9eb09
Improve unit tests for target group
jbleduigou Oct 15, 2019
9372a22
Improve unit tests for target group
jbleduigou Oct 16, 2019
16370e6
Update storage considerations documentation (#6134)
SuperQ Oct 16, 2019
7850f1b
new world spelling mistake
yuxiaobo96 Oct 17, 2019
bca6e90
Integrate beginning of React UI (#5694)
juliusv Oct 17, 2019
63899f5
Remove obsolete console.log() statements (#6159)
juliusv Oct 17, 2019
ccac71c
Update all React app node modules (#6153)
juliusv Oct 17, 2019
61e14a6
Merge pull request #6151 from yuxiaobo96/prometheus-check3
beorn7 Oct 17, 2019
90c3615
Fix solaris build. (#6149)
ptribble Oct 17, 2019
0f91ff4
React UI: Sanitize HTML string to allow only supported elements (#6165)
codingdash Oct 17, 2019
024c38c
Merge remote-tracking branch 'upstream/master'
Oct 17, 2019
3309ffa
Fix imports
jbleduigou Oct 17, 2019
0939d56
Improve test by asserting on whole Target Group object
jbleduigou Oct 17, 2019
818974f
Rewrite remote write dashboard using base grafonnet.
cstyan Oct 17, 2019
5b8ff9b
Merge the 2.13 release branch (#6169)
Oct 17, 2019
a19aea4
.circleci/config.yml: fix publish jobs (#6176)
simonpasquier Oct 18, 2019
96273cc
Added GitHub actions workflow for prombench. (#6173)
geekodour Oct 18, 2019
19ce6b7
discovery: fix more error logs on context cancelation (#6133)
simonpasquier Oct 18, 2019
7567376
replace AUTH_FILE with PROMBENCH_GKE_AUTH (#6180)
geekodour Oct 18, 2019
d264501
.circleci/config.yml: fix CircleCI image tag for publish (#6179)
simonpasquier Oct 18, 2019
3acc3e8
Adding unit test for target group (#6141)
simonpasquier Oct 18, 2019
b5a16a8
make expression input controlled (#6174)
boyskila Oct 20, 2019
da6d466
Repeat shards panels on the queue label.
cstyan Oct 21, 2019
1c238ac
Add links between classic and new UIs (#6191)
juliusv Oct 21, 2019
b5e603c
Merge pull request #6119 from cstyan/rw-dashboard-shards
beorn7 Oct 21, 2019
5f1be2c
Refactor calculateDesiredShards + don't reshard if we're having issue…
cstyan Oct 21, 2019
4262ad9
React ui add query stats (#6190)
CSTDev Oct 23, 2019
89e610e
bump go version in go.mod (#6194)
tariq1890 Oct 23, 2019
e235af9
migrate query history (#6193)
boyskila Oct 23, 2019
4fb9f16
disable github actions (#6207)
krasi-georgiev Oct 23, 2019
3cb0a9d
.circleci/config.yml: cache dependencies (#6181)
simonpasquier Oct 24, 2019
53a9953
Edit TSDB README badges
gouthamve Oct 24, 2019
95d3d3f
Merge pull request #6213 from prometheus/gtm-tsdb-cards
codesome Oct 24, 2019
fe80cf4
promql: Eliminate dead code (#6215)
slrtbtfs Oct 25, 2019
8cf0548
Update more web/ui/README.md bits for new UI (#6197)
juliusv Oct 25, 2019
fbcf41c
doc: Add documentation about comments in PromQL (#6198)
slrtbtfs Oct 25, 2019
1afa476
minor fix for making map (#6076)
YaoZengzeng Oct 26, 2019
dab87ca
split autocomplete dropdown in to groups (#6211)
boyskila Oct 26, 2019
9698262
React UI: Simplify query history setting code (#6225)
juliusv Oct 26, 2019
db76da7
React UI: Fix initial setting of past queries (#6226)
juliusv Oct 26, 2019
8afa845
reach router integration initial commit (#6232)
boyskila Oct 27, 2019
c83094b
React UI: Implement /config page (#6236)
juliusv Oct 28, 2019
3f3986e
Adjust React query stats font (#6238)
SuperQ Oct 28, 2019
e8027ba
React UI: Serve React UI under /new (#6229)
juliusv Oct 28, 2019
3b39f6a
WIP: React UI Linting rules (#6206)
CSTDev Oct 28, 2019
8340db5
Update aggregation operator docs (#6240)
SuperQ Oct 28, 2019
e0443e6
Add unit tests for react-app (#6234)
hooten Oct 28, 2019
61617eb
Fix PrometheusRemoteWriteDesiredShards
beorn7 Oct 28, 2019
6d931a2
Fix Windows support for custom-sd adapter (#6217)
bgagnon Oct 29, 2019
040425b
filtering alerts by state and display count of alerts in each state (…
mszczygiel Oct 29, 2019
7c039a6
Merge pull request #6242 from prometheus/beorn7/mixin
beorn7 Oct 29, 2019
83e6d56
clean up indirects in go.mod manifest (#6249)
tariq1890 Oct 30, 2019
9c8f9bf
Fix the description template for PrometheusRemoteWriteDesiredShards
beorn7 Oct 30, 2019
7472636
Merge pull request #6254 from prometheus/beorn7/mixin
beorn7 Oct 30, 2019
f17a0e1
Implement the /flags page in react (#6248)
csmarchbanks Nov 2, 2019
ca9fce4
Correct the docker run volume parameter (#6247)
mattrussi Nov 2, 2019
cb7cbad
WIP: status page - API and UI (#6243)
boyskila Nov 2, 2019
f744677
Document new status API endpoints (#6262)
juliusv Nov 2, 2019
fffb5ca
React UI: More conversions to Function Components (#6259)
juliusv Nov 2, 2019
8c0b76d
React UI: Improve styling of autocomplete sections (#6228)
juliusv Nov 3, 2019
5bc9353
React UI: Simpler and relative-only query URL building (#6263)
juliusv Nov 3, 2019
9555407
React UI: Support custom path prefixes (#6264)
juliusv Nov 4, 2019
7293c85
pass the value to the input instead to downshift (#6235)
boyskila Nov 4, 2019
1a38075
scrape: Move tests to testutil (#6187)
dzeban Nov 4, 2019
e94503f
Head Cardinality Status Page (#6125)
sharadgaur Nov 5, 2019
3836cc1
React UI: Fix left/right icons in the time picker (#6275)
juliusv Nov 5, 2019
1d1f64b
Fix Promtool showing false duplicate rule warnings (#6270)
csmarchbanks Nov 5, 2019
431844f
React UI: Mark not-yet-done pages as under construction (#6277)
juliusv Nov 5, 2019
129dbda
Ensure warnings are escaped (#6279)
dgl Nov 6, 2019
c174a45
Cut the 2.14.0-rc.0 release (#6278)
csmarchbanks Nov 6, 2019
edeb7a4
Cut 2.14.0 release (#6298)
csmarchbanks Nov 11, 2019
da2ad2b
Merge tag 'v2.14.0' into aos-bump-v2.14.0
simonpasquier Nov 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 18 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
version: 2.1

orbs:
prometheus: prometheus/prometheus@0.1.0
prometheus: prometheus/prometheus@0.3.0
go: circleci/go@0.2.0

executors:
# Whenever the Go version is updated here, .travis.yml and .promu.yml
# should also be updated.
golang:
docker:
- image: circleci/golang:1.13
- image: circleci/golang:1.13-node

fuzzit:
docker:
Expand All @@ -21,10 +22,16 @@ jobs:

steps:
- prometheus/setup_environment
- go/load-cache:
key: v1
- restore_cache:
keys:
- v1-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
- v1-npm-deps-
- run:
command: make
environment:
# Run garbage collection more aggresively to avoid getting OOMed during the lint phase.
# Run garbage collection more aggressively to avoid getting OOMed during the lint phase.
GOGC: "20"
# By default Go uses GOMAXPROCS but a Circle CI executor has many
# cores (> 30) while the CPU and RAM resources are throttled. If we
Expand All @@ -36,6 +43,12 @@ jobs:
file: prometheus
- prometheus/store_artifact:
file: promtool
- go/save-cache:
key: v1
- save_cache:
key: v1-npm-deps-{{ checksum "web/ui/react-app/yarn.lock" }}
paths:
- web/ui/react-app/node_modules
fuzzit_regression:
executor: fuzzit
working_directory: /go/src/github.com/prometheus/prometheus
Expand Down Expand Up @@ -82,6 +95,7 @@ workflows:
filters:
branches:
only: master
image: circleci/golang:1-node
- prometheus/publish_release:
context: org-context
requires:
Expand All @@ -92,6 +106,7 @@ workflows:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/
image: circleci/golang:1-node
nightly:
triggers:
- schedule:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ benchmark.txt
!/.golangci.yml
/documentation/examples/remote_storage/remote_storage_adapter/remote_storage_adapter
/documentation/examples/remote_storage/example_write_adapter/example_writer_adapter

npm_licenses.tar.bz2
/web/ui/static/react
# NOTE(spasquie): unlike upstream, we want the assets to be committed in the repository because build environments don't have access to Yarn and external package repositories.
# This means that every time we update to a new Prometheus version, 'make assets' should be run and the resulting file committed to the repository.
#/web/ui/assets_vfsdata.go
4 changes: 4 additions & 0 deletions .promu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ build:
path: ./cmd/promtool
- name: tsdbtool
path: ./tsdb/cmd/tsdb
# NOTE(spasquie): Go 1.12 doesn't support '-tags netgo,builtinassets' and promu doesn't support
# space-separated tags so the 'ondiskassets' build tag is used instead of 'builtinassets'.
flags: -mod=vendor -a -tags netgo
#flags: -mod=vendor -a -tags netgo,builtinassets
ldflags: |
-s
-X github.com/prometheus/common/version.Version={{.Version}}
Expand All @@ -27,6 +30,7 @@ tarball:
- documentation/examples/prometheus.yml
- LICENSE
- NOTICE
- npm_licenses.tar.bz2
crossbuild:
platforms:
- linux/amd64
Expand Down
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ go_import_path: github.com/prometheus/prometheus
# random issues on Travis.
before_install:
- travis_retry make deps
- . $HOME/.nvm/nvm.sh
- nvm install stable
- nvm use stable
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install make; fi

script:
- make check_license style unused test lint check_assets
- make check_license style unused test lint
- git diff --exit-code
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 2.14.0 / 2019-11-11

* [SECURITY/BUGFIX] UI: Ensure warnings from the API are escaped. #6279
* [FEATURE] API: `/api/v1/status/runtimeinfo` and `/api/v1/status/buildinfo` endpoints added for use by the React UI. #6243
* [FEATURE] React UI: implement the new experimental React based UI. #5694 and many more
* Can be found by under `/new`.
* Not all pages are implemented yet.
* [FEATURE] Status: Cardinality statistics added to the Runtime & Build Information page. #6125
* [ENHANCEMENT/BUGFIX] Remote write: fix delays in remote write after a compaction. #6021
* [ENHANCEMENT] UI: Alerts can be filtered by state. #5758
* [BUGFIX] API: lifecycle endpoints return 403 when not enabled. #6057
* [BUGFIX] Build: Fix Solaris build. #6149
* [BUGFIX] Promtool: Remove false duplicate rule warnings when checking rule files with alerts. #6270
* [BUGFIX] Remote write: restore use of deduplicating logger in remote write. #6113
* [BUGFIX] Remote write: do not reshard when unable to send samples. #6111
* [BUGFIX] Service discovery: errors are no longer logged on context cancellation. #6116, #6133
* [BUGFIX] UI: handle null response from API properly. #6071

## 2.13.1 / 2019-10-16

* [BUGFIX] Fix panic in ARM builds of Prometheus. #6110
Expand Down Expand Up @@ -138,7 +156,7 @@ and the memory is available to the kernel when it needs it.
* [BUGFIX] Check if label value is valid when unmarshaling external labels from YAML. #5316
* [BUGFIX] Promparse: sort all labels when parsing. #5372
* [BUGFIX] Reload rules: copy state on both name and labels. #5368
* [BUGFIX] Exponentation operator to drop metric name in result of operation. #5329
* [BUGFIX] Exponentiation operator to drop metric name in result of operation. #5329
* [BUGFIX] Config: resolve more file paths. #5284
* [BUGFIX] Promtool: resolve relative paths in alert test files. #5336
* [BUGFIX] Set TLSHandshakeTimeout in HTTP transport. common#179
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ COPY .build/${OS}-${ARCH}/promtool /bin/promtool
COPY documentation/examples/prometheus.yml /etc/prometheus/prometheus.yml
COPY console_libraries/ /usr/share/prometheus/console_libraries/
COPY consoles/ /usr/share/prometheus/consoles/
COPY LICENSE /LICENSE
COPY NOTICE /NOTICE
COPY npm_licenses.tar.bz2 /npm_licenses.tar.bz2

RUN ln -s /usr/share/prometheus/console_libraries /usr/share/prometheus/consoles/ /etc/prometheus/
RUN mkdir -p /prometheus && \
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile.ocp
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder
WORKDIR /go/src/github.com/prometheus/prometheus
COPY . .
RUN if yum install -y prometheus-promu; then export BUILD_PROMU=false; fi && make build
# NOTE(spasquie): the 'build' target regenerates the ReactJS code and the Go
# assets on the fly. Build environments don't have access to Yarn and external
# package repositories so we use the 'common-build' target instead.
# It means that every time we update to a new Prometheus version, 'make assets'
# should be run locally and the resulting file (web/ui/assets_vfsdata.go)
# should be committed to the repository.
RUN if yum install -y prometheus-promu; then export BUILD_PROMU=false; fi && make common-build

FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base
LABEL io.k8s.display-name="OpenShift Prometheus" \
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ Maintainers of this repository with their focus areas:
* Brian Brazil <brian.brazil@robustperception.io> @brian-brazil: Console templates; semantics of PromQL, service discovery, and relabeling.
* Fabian Reinartz <freinartz@google.com> @fabxc: PromQL parsing and evaluation; implementation of retrieval, alert notification, and service discovery.
* Julius Volz <julius.volz@gmail.com> @juliusv: Remote storage integrations; web UI.
* Krasi Georgiev <kgeorgie@redhat.com> @krasi-georgiev: TSDB - the storage engine.
* Ganesh Vernekar <cs15btech11018@iith.ac.in> @codesome: TSDB - the storage engine.

61 changes: 52 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
# Needs to be defined before including Makefile.common to auto-generate targets
DOCKER_ARCHS ?= amd64 armv7 arm64

REACT_APP_PATH = web/ui/react-app
REACT_APP_SOURCE_FILES = $(wildcard $(REACT_APP_PATH)/public/* $(REACT_APP_PATH)/src/* $(REACT_APP_PATH)/tsconfig.json)
REACT_APP_OUTPUT_DIR = web/ui/static/react
REACT_APP_NODE_MODULES_PATH = $(REACT_APP_PATH)/node_modules
REACT_APP_NPM_LICENSES_TARBALL = "npm_licenses.tar.bz2"

TSDB_PROJECT_DIR = "./tsdb"
TSDB_CLI_DIR="$(TSDB_PROJECT_DIR)/cmd/tsdb"
TSDB_BIN = "$(TSDB_CLI_DIR)/tsdb"
Expand All @@ -25,23 +31,60 @@ include Makefile.common

DOCKER_IMAGE_NAME ?= prometheus

$(REACT_APP_NODE_MODULES_PATH): $(REACT_APP_PATH)/package.json $(REACT_APP_PATH)/yarn.lock
cd $(REACT_APP_PATH) && yarn --frozen-lockfile

$(REACT_APP_OUTPUT_DIR): $(REACT_APP_NODE_MODULES_PATH) $(REACT_APP_SOURCE_FILES)
@echo ">> building React app"
@./scripts/build_react_app.sh

.PHONY: assets
assets:
assets: $(REACT_APP_OUTPUT_DIR)
@echo ">> writing assets"
cd $(PREFIX)/web/ui && GO111MODULE=$(GO111MODULE) $(GO) generate -x -v $(GOOPTS)
# Un-setting GOOS and GOARCH here because the generated Go code is always the same,
# but the cached object code is incompatible between architectures and OSes (which
# breaks cross-building for different combinations on CI in the same container).
cd web/ui && GO111MODULE=$(GO111MODULE) GOOS= GOARCH= $(GO) generate -x -v $(GOOPTS)
@$(GOFMT) -w ./web/ui

.PHONY: check_assets
check_assets: assets
@echo ">> checking that assets are up-to-date"
@if ! (cd $(PREFIX)/web/ui && git diff --exit-code); then \
echo "Run 'make assets' and commit the changes to fix the error."; \
exit 1; \
fi
.PHONY: react-app-lint
react-app-lint:
@echo ">> running React app linting"
cd $(REACT_APP_PATH) && yarn lint:ci

.PHONY: react-app-lint-fix
react-app-lint-fix:
@echo ">> running React app linting and fixing errors where possibe"
cd $(REACT_APP_PATH) && yarn lint

.PHONY: react-app-test
react-app-test: | $(REACT_APP_NODE_MODULES_PATH) react-app-lint
@echo ">> running React app tests"
cd $(REACT_APP_PATH) && yarn test --no-watch --coverage

.PHONY: test
test: common-test react-app-test

.PHONY: npm_licenses
npm_licenses: $(REACT_APP_NODE_MODULES_PATH)
@echo ">> bundling npm licenses"
rm -f $(REACT_APP_NPM_LICENSES_TARBALL)
find $(REACT_APP_NODE_MODULES_PATH) -iname "license*" | tar cfj $(REACT_APP_NPM_LICENSES_TARBALL) --transform 's/^/npm_licenses\//' --files-from=-

.PHONY: tarball
tarball: npm_licenses common-tarball

.PHONY: docker
docker: npm_licenses common-docker

.PHONY: build
build: assets common-build

.PHONY: build_tsdb
build_tsdb:
GO111MODULE=$(GO111MODULE) $(GO) build -o $(TSDB_BIN) $(TSDB_CLI_DIR)

.PHONY: bench_tsdb
bench_tsdb: build_tsdb
@echo ">> running benchmark, writing result to $(TSDB_BENCHMARK_OUTPUT_DIR)"
@$(TSDB_BIN) bench write --metrics=$(TSDB_BENCHMARK_NUM_METRICS) --out=$(TSDB_BENCHMARK_OUTPUT_DIR) $(TSDB_BENCHMARK_DATASET)
Expand Down
6 changes: 6 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,9 @@ go-zookeeper - Native ZooKeeper client for Go
https://github.com/samuel/go-zookeeper
Copyright (c) 2013, Samuel Stauffer <samuel@descolada.com>
See https://github.com/samuel/go-zookeeper/blob/master/LICENSE for license details.

We also use code from a large number of npm packages. For details, see:
- https://github.com/prometheus/prometheus/blob/master/web/ui/react-app/package.json
- https://github.com/prometheus/prometheus/blob/master/web/ui/react-app/package-lock.json
- The individual package licenses as copied from the node_modules directory can be found in
the npm_licenses.tar.bz2 archive in release tarballs and Docker images.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Prometheus
# Prometheus

[![Build Status](https://travis-ci.org/prometheus/prometheus.svg)][travis]
[![CircleCI](https://circleci.com/gh/prometheus/prometheus/tree/master.svg?style=shield)][circleci]
Expand All @@ -16,7 +16,7 @@ from configured targets at given intervals, evaluates rule expressions,
displays the results, and can trigger alerts if some condition is observed
to be true.

Prometheus' main distinguishing features as compared to other monitoring systems are:
Prometheus's main distinguishing features as compared to other monitoring systems are:

- a **multi-dimensional** data model (timeseries defined by metric name and set of key/value dimensions)
- a **flexible query language** to leverage this dimensionality
Expand Down Expand Up @@ -60,14 +60,23 @@ Prometheus will now be reachable at http://localhost:9090/.

To build Prometheus from the source code yourself you need to have a working
Go environment with [version 1.13 or greater installed](https://golang.org/doc/install).
You will also need to have [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/)
installed in order to build the frontend assets.

You can directly use the `go` tool to download and install the `prometheus`
and `promtool` binaries into your `GOPATH`:

$ go get github.com/prometheus/prometheus/cmd/...
$ prometheus --config.file=your_config.yml

You can also clone the repository yourself and build using `make`:
*However*, when using `go get` to build Prometheus, Prometheus will expect to be able to
read its web assets from local filesystem directories under `web/ui/static` and
`web/ui/templates`. In order for these assets to be found, you will have to run Prometheus
from the root of the cloned repository. Note also that these directories do not include the
new experimental React UI unless it has been built explicitly using `make assets` or `make build`.

You can also clone the repository yourself and build using `make build`, which will compile in
the web assets so that Prometheus can be run from anywhere:

$ mkdir -p $GOPATH/src/github.com/prometheus
$ cd $GOPATH/src/github.com/prometheus
Expand All @@ -78,12 +87,11 @@ You can also clone the repository yourself and build using `make`:

The Makefile provides several targets:

* *build*: build the `prometheus` and `promtool` binaries
* *build*: build the `prometheus` and `promtool` binaries (includes building and compiling in web assets)
* *test*: run the tests
* *test-short*: run the short tests
* *format*: format the source code
* *vet*: check the source code for common errors
* *assets*: rebuild the static assets
* *docker*: build a docker container for the current `HEAD`

## More information
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ For a patch release, work in the branch of the minor release you want to patch.

For a new major or minor release, create the corresponding release branch based on the master branch.

Bump the version in the `VERSION` file and update `CHANGELOG.md`. Do this in a proper PR as this gives others the opportunity to chime in on the release in general and on the addition to the changelog in particular.
Bump the version in the `VERSION` file and update `CHANGELOG.md`. Do this in a proper PR pointing to the release branch as this gives others the opportunity to chime in on the release in general and on the addition to the changelog in particular.

Note that `CHANGELOG.md` should only document changes relevant to users of Prometheus, including external API changes, performance improvements, and new features. Do not document changes of internal interfaces, code refactorings and clean-ups, changes to the build process, etc. People interested in these are asked to refer to the git history.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.1
2.14.0
21 changes: 14 additions & 7 deletions cmd/promtool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,19 @@ type compareRuleType struct {
label map[string]string
}

func checkDuplicates(r []rulefmt.RuleGroup) []compareRuleType {
func checkDuplicates(groups []rulefmt.RuleGroup) []compareRuleType {
var duplicates []compareRuleType

for rindex := range r {
for index, props := range r[rindex].Rules {
for _, group := range groups {
for index, rule := range group.Rules {
inst := compareRuleType{
metric: props.Record,
label: props.Labels,
metric: ruleMetric(rule),
label: rule.Labels,
}
for i := 0; i < index; i++ {
t := compareRuleType{
metric: r[rindex].Rules[i].Record,
label: r[rindex].Rules[i].Labels,
metric: ruleMetric(group.Rules[i]),
label: group.Rules[i].Labels,
}
if reflect.DeepEqual(t, inst) {
duplicates = append(duplicates, t)
Expand All @@ -347,6 +347,13 @@ func checkDuplicates(r []rulefmt.RuleGroup) []compareRuleType {
return duplicates
}

func ruleMetric(rule rulefmt.Rule) string {
if rule.Alert != "" {
return rule.Alert
}
return rule.Record
}

var checkMetricsUsage = strings.TrimSpace(`
Pass Prometheus metrics over stdin to lint them for consistency and correctness.

Expand Down
7 changes: 7 additions & 0 deletions discovery/consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,13 @@ func (d *Discovery) watchServices(ctx context.Context, ch chan<- []*targetgroup.
elapsed := time.Since(t0)
rpcDuration.WithLabelValues("catalog", "services").Observe(elapsed.Seconds())

// Check the context before in order to exit early.
select {
case <-ctx.Done():
return
default:
}

if err != nil {
level.Error(d.logger).Log("msg", "Error refreshing service list", "err", err)
rpcFailuresCount.Inc()
Expand Down
2 changes: 1 addition & 1 deletion discovery/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
wg.Add(len(d.names))
for _, name := range d.names {
go func(n string) {
if err := d.refreshOne(ctx, n, ch); err != nil {
if err := d.refreshOne(ctx, n, ch); err != nil && err != context.Canceled {
level.Error(d.logger).Log("msg", "Error refreshing DNS targets", "err", err)
}
wg.Done()
Expand Down
Loading