mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-29 10:41:00 +00:00
Merge pull request #17 from sdurrheimer/master
New Dockerfile using alpine-golang-make-onbuild base image
This commit is contained in:
commit
b6210fc395
3 changed files with 37 additions and 16 deletions
4
Dockerfile
Normal file
4
Dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
FROM sdurrheimer/alpine-golang-make-onbuild
|
||||||
|
MAINTAINER The Prometheus Authors <prometheus-developers@googlegroups.com>
|
||||||
|
|
||||||
|
EXPOSE 9102 9125/udp
|
|
@ -49,19 +49,22 @@ ifeq ($(GOOS),darwin)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GO_VERSION ?= 1.4.2
|
GO_VERSION ?= 1.4.2
|
||||||
|
|
||||||
ifeq ($(shell type go >/dev/null && go version | sed 's/.*go\([0-9.]*\).*/\1/'), $(GO_VERSION))
|
|
||||||
GOROOT := $(shell go env GOROOT)
|
|
||||||
else
|
|
||||||
GOROOT := $(CURDIR)/.build/go$(GO_VERSION)
|
|
||||||
endif
|
|
||||||
|
|
||||||
GOURL ?= https://golang.org/dl
|
GOURL ?= https://golang.org/dl
|
||||||
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz
|
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz
|
||||||
GOPATH := $(CURDIR)/.build/gopath
|
GOPATH := $(CURDIR)/.build/gopath
|
||||||
GOCC ?= $(GOROOT)/bin/go
|
|
||||||
GO ?= GOROOT=$(GOROOT) GOPATH=$(GOPATH) $(GOCC)
|
# Check for the correct version of go in the path. If we find it, use it.
|
||||||
GOFMT ?= $(GOROOT)/bin/gofmt
|
# Otherwise, prepare to build go locally.
|
||||||
|
ifeq ($(shell command -v "go" >/dev/null && go version | sed -e 's/^[^0-9.]*\([0-9.]*\).*/\1/'), $(GO_VERSION))
|
||||||
|
GOCC ?= $(shell command -v "go")
|
||||||
|
GOFMT ?= $(shell command -v "gofmt")
|
||||||
|
GO ?= GOPATH=$(GOPATH) $(GOCC)
|
||||||
|
else
|
||||||
|
GOROOT ?= $(CURDIR)/.build/go$(GO_VERSION)
|
||||||
|
GOCC ?= $(GOROOT)/bin/go
|
||||||
|
GOFMT ?= $(GOROOT)/bin/gofmt
|
||||||
|
GO ?= GOROOT=$(GOROOT) GOPATH=$(GOPATH) $(GOCC)
|
||||||
|
endif
|
||||||
|
|
||||||
# Never honor GOBIN, should it be set at all.
|
# Never honor GOBIN, should it be set at all.
|
||||||
unexport GOBIN
|
unexport GOBIN
|
||||||
|
|
14
README.md
14
README.md
|
@ -94,3 +94,17 @@ follows:
|
||||||
|
|
||||||
test.web-server.foo.bar (gauge)
|
test.web-server.foo.bar (gauge)
|
||||||
=> test_web__server_foo_bar_gauge{}
|
=> test_web__server_foo_bar_gauge{}
|
||||||
|
|
||||||
|
## Using Docker
|
||||||
|
|
||||||
|
You can deploy this exporter using the [prom/statsd-bridge](https://registry.hub.docker.com/u/prom/statsd-bridge/) Docker image.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull prom/statsd-bridge
|
||||||
|
|
||||||
|
docker run -d -p 9102:9102 -p 9125/udp:9125/udp \
|
||||||
|
-v $PWD/statsd_mapping.conf:/tmp/statsd_mapping.conf \
|
||||||
|
prom/statsd-bridge -statsd.mapping-config=/tmp/statsd_mapping.conf
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue