Skip to content

Commit

Permalink
Merge branch 'master' of github.com:prometheus/pushgateway
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	main.go
#	storage/diskmetricstore.go
  • Loading branch information
dinumathai committed Mar 3, 2021
2 parents 8fae543 + 007ba87 commit b28bd03
Show file tree
Hide file tree
Showing 887 changed files with 242,445 additions and 104,526 deletions.
88 changes: 13 additions & 75 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,24 @@
---
version: 2.1

orbs:
prometheus: prometheus/[email protected]

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

jobs:
test:
executor: golang

steps:
- checkout
- run: make promu
- run: make check_license style unused staticcheck build test
- store_artifacts:
path: pushgateway
destination: /build/pushgateway
- run: rm -v pushgateway

build:
machine: true
working_directory: /home/circleci/.go_workspace/src/github.com/prometheus/pushgateway

steps:
- checkout
- run: make promu
- run: promu crossbuild -v
- persist_to_workspace:
root: .
paths:
- .build

docker_hub_master:
executor: golang

steps:
- checkout
- setup_remote_docker
- attach_workspace:
at: .
- run: ln -s .build/linux-amd64/pushgateway pushgateway
- run: make docker
- run: make docker DOCKER_REPO=quay.io/prometheus
- run: docker images
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
- run: make docker-publish
- run: make docker-publish DOCKER_REPO=quay.io/prometheus

docker_hub_release_tags:
executor: golang

steps:
- checkout
- setup_remote_docker
- run: mkdir -v -p ${HOME}/bin
- run: curl -L 'https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2' | tar xvjf - --strip-components 3 -C ${HOME}/bin
- run: echo 'export PATH=${HOME}/bin:${PATH}' >> ${BASH_ENV}
- attach_workspace:
at: .
- run: make promu
- run: promu crossbuild tarballs
- run: promu checksum .tarballs
- run: promu release .tarballs
- store_artifacts:
path: .tarballs
destination: releases
- run: ln -s .build/linux-amd64/pushgateway pushgateway
- run: ln -s .build/linux-amd64/promtool promtool
- run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG DOCKER_REPO=quay.io/prometheus
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
- run: |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG"
make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus
fi
- run: make docker-publish
- run: make docker-publish DOCKER_REPO=quay.io/prometheus
- prometheus/setup_environment
- run: make
- prometheus/store_artifact:
file: pushgateway

workflows:
version: 2
Expand All @@ -91,18 +28,19 @@ workflows:
filters:
tags:
only: /.*/
- build:
- prometheus/build:
name: build
filters:
tags:
only: /.*/
- docker_hub_master:
- prometheus/publish_master:
requires:
- test
- build
filters:
branches:
only: master
- docker_hub_release_tags:
- prometheus/publish_release:
requires:
- test
- build
Expand Down
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.tarballs/

!.build/linux-amd64/
!.build/linux-armv7
!.build/linux-arm64
!.build/linux-ppc64le
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources/static/bootstrap-4.3.1-dist/* linguist-vendored
resources/static/bootstrap4-glyphicons/* linguist-vendored
resources/static/jquery-3.4.1.min.js linguist-vendored
vendor/* linguist-vendored
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
run:
modules-download-mode: vendor

# Run only staticcheck for now. Additional linters will be enabled one-by-one.
linters:
enable:
- staticcheck
disable-all: true
4 changes: 4 additions & 0 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
go:
# Whenever the Go version is updated here, .circle/config.yml should also
# be updated.
version: 1.15
repository:
path: github.com/prometheus/pushgateway
build:
Expand Down
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

82 changes: 72 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,73 @@
## 1.4.0 / 2021-01-23

* [FEATURE] **Experimental!** Add TLS and basic authentication to HTTP endpoints. #381

## 1.3.1 / 2020-12-17

* [ENHANCEMENT] Web UI: Improved metrics text alignment. #369
* [BUGFIX] Web UI: Fix deletion of groups with empty label values. #377

## 1.3.0 / 2020-10-01

* [FEATURE] Add Docker image build for ppc64le architecture. #339
* [ENHANCEMENT] Web UI: Add scroll bare to list of pushed metrics. #354
* [ENHANCEMENT] Logging: Show remote address when failing to parse pushed metrics. #361
* [BUGFIX] Web UI: Update JQuery to v3.5.1 to address security concerns. #360

## 1.2.0 / 2020-03-11

* [FEATURE] Add an HTTP API to query pushed metrics and runtime information. #184

## 1.1.0 / 2020-01-27

* [FEATURE] Add flag `--push.disable-consistency-check`. #318

## 1.0.1 / 2019-12-21

* [ENHANCEMENT] Remove excessive whitespace from HTML templates. #302
* [BUGFIX] Fix docker manifest files for non-amd64 architectures. #310

## 1.0.0 / 2019-10-15

_This release does not support the storage format of v0.5–v0.9 anymore. Only persistence files created by v0.10+ are usable. Upgrade to v0.10 first to convert existing persistence files._

* [CHANGE] Remove code to convert the legacy v0.5–v0.9 storage format.

## 0.10.0 / 2019-10-10

_This release changes the storage format. v0.10 can read the storage format of v0.5–v0.9. It will then persist the new format so that a downgrade won't be possible anymore._

* [CHANGE] Change of the storage format (necessary for the hash collision bugfix below). #293
* [CHANGE] Check pushed metrics immediately and reject them if inconsistent. Successful pushes now result in code 200 (not 202). Failures result in code 400 and are logged at error level. #290
* [FEATURE] Shutdown via HTTP request. Enable with `--web.enable-lifecycle`. #292
* [FEATURE] Wipe storage completely via HTTP request and via web UI. Enable with `--web.enable-admin-api`. #287 #285
* [BUGFIX] Rule out hash collisions between metric groups. #293
* [BUGFIX] Avoid multiple calls of `http.Error` in push handler. #291

## 0.9.1 / 2019-08-01

* [BUGFIX] Make `--web.external-url` and `--web.route-prefix` work as documented. #274

## 0.9.0 / 2019-07-23

* [CHANGE] Web: Update to Bootstrap 4.3.1 and jquery 3.4.1, changing appearance of the web UI to be more in line with the Prometheus server. Also add favicon and remove timestamp column. #261
* [CHANGE] Update logging to be in line with other Prometheus projects, using gokit and promlog. #263
* [FEATURE] Add optional base64 encoding for label values in the grouping key. #268
* [FEATURE] Add ARM container images. #265
* [FEATURE] Log errors during scrapes. #267
* [BUGFIX] Web: Fixed Content-Type for js and css instead of using /etc/mime.types. #252

## 0.8.0 / 2019-04-13

_If you use the prebuilt Docker container or you build your own one based on the provided Dockerfile, note that this release changes the user to `nobody`. Should you use a persistence file, make sure it is readable and writable by user `nobody`._

* [CHANGE] Run as user `nobody` in Docker. #242
* [CHANGE] Adjust `--web.route-prefix` to work the same as in Prometheus. #190
* [FEATURE] Add `--web.external-url` flag (like in Prometheus). #190

## 0.7.0 / 2018-12-07

_As preparation for the 1.0.0 release, this release removes the long deprecated
legacy HTTP push endpoint (which uses `/jobs/` rather than `/job/` in the URL)._
_As preparation for the 1.0.0 release, this release removes the long deprecated legacy HTTP push endpoint (which uses `/jobs/` rather than `/job/` in the URL)._

* [CHANGE] Remove legacy push API. #227
* [ENHANCEMENT] Update dependencies. #230
Expand All @@ -10,14 +76,11 @@ legacy HTTP push endpoint (which uses `/jobs/` rather than `/job/` in the URL)._

## 0.6.0 / 2018-10-17

_Persistence storage prior to 0.5.0 is unsupported. Upgrade to 0.5.2 first for
conversion._
_Persistence storage prior to 0.5.0 is unsupported. Upgrade to 0.5.2 first for conversion._

* [CHANGE] Enforce consistency of help strings by changing them during
exposition. (An INFO-level log message describes the change.) #194
* [CHANGE] Enforce consistency of help strings by changing them during exposition. (An INFO-level log message describes the change.) #194
* [CHANGE] Drop support of pre-0.5 storage format.
* [CHANGE] Use prometheus/client_golang v0.9, which changes the `http_...`
metrics. (See README.md for full documentation of exposed metrics.)
* [CHANGE] Use prometheus/client_golang v0.9, which changes the `http_...` metrics. (See README.md for full documentation of exposed metrics.)

## 0.5.2 / 2018-06-15

Expand Down Expand Up @@ -84,8 +147,7 @@ Breaking change:
* [BUGFIX] Re-add pprof endpoints.

## 0.1.0 / 2014-08-13
* [FEATURE] When being scraped, metrics of the same name but with different
job/instance label are now merged into one metric family.
* [FEATURE] When being scraped, metrics of the same name but with different job/instance label are now merged into one metric family.
* [FEATURE] Added Dockerfile.
* [CHANGE] Default HTTP port now 9091.
* [BUGFIX] Fixed parsing of content-type header.
Expand Down
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Prometheus Community Code of Conduct

Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ Prometheus uses GitHub to manage reviews of pull requests.
and the _Formatting and style_ section of Peter Bourgon's [Go: Best
Practices for Production
Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style).

* Be sure to sign off on the [DCO](https://github.com/probot/dco#how-it-works)
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM quay.io/prometheus/busybox:latest
ARG ARCH="amd64"
ARG OS="linux"
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest
LABEL maintainer="The Prometheus Authors <[email protected]>"

COPY pushgateway /bin/pushgateway
ARG ARCH="amd64"
ARG OS="linux"
COPY --chown=nobody:nobody .build/${OS}-${ARCH}/pushgateway /bin/pushgateway

EXPOSE 9091
RUN mkdir -p /pushgateway
RUN mkdir -p /pushgateway && chown nobody:nobody /pushgateway
WORKDIR /pushgateway

USER 65534

ENTRYPOINT [ "/bin/pushgateway" ]
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* Björn Rabenstein <beorn@soundcloud.com>
* Björn Rabenstein <beorn@grafana.com> @beorn7
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

include Makefile.common
# Needs to be defined before including Makefile.common to auto-generate targets
DOCKER_ARCHS ?= amd64 armv7 arm64 ppc64le

STATICCHECK_IGNORE = \
github.com/prometheus/pushgateway/handler/delete.go:SA1019 \
github.com/prometheus/pushgateway/handler/push.go:SA1019 \
github.com/prometheus/pushgateway/main.go:SA1019
include Makefile.common

DOCKER_IMAGE_NAME ?= pushgateway

assets:
@echo ">> writing assets"
@cd $(PREFIX)/asset && $(GO) generate && $(GOFMT) -w assets_vfsdata.go
@cd $(PREFIX)/asset && GO111MODULE=$(GO111MODULE) $(GO) generate && $(GOFMT) -w assets_vfsdata.go
Loading

0 comments on commit b28bd03

Please sign in to comment.