-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add namedprocess_scrape_errors and namedprocess_scrape_permission_err…
…ors counters: former incremented when we have a general /proc reading error, the latter when a /proc file isn't readable due to permissions. Add Makefile and .promu.yml: now using promu as build tool. Add Dockerfile: now make docker can be used to build an image. Add -promfs argument to specify a different path to read from other than /proc.
- Loading branch information
Showing
13 changed files
with
280 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.*.sw? | ||
process-exporter | ||
.tarballs | ||
process-exporter-*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
repository: | ||
path: github.com/ncabatoff/process-exporter | ||
build: | ||
binaries: | ||
- name: process-exporter | ||
path: ./cmd/process-exporter | ||
flags: -a -tags netgo | ||
tarball: | ||
files: | ||
- LICENSE | ||
crossbuild: | ||
platforms: | ||
- linux/amd64 | ||
- linux/386 | ||
# - darwin/amd64 | ||
# - darwin/386 | ||
# - windows/amd64 | ||
# - windows/386 | ||
# - freebsd/amd64 | ||
# - freebsd/386 | ||
# - openbsd/amd64 | ||
# - openbsd/386 | ||
# - netbsd/amd64 | ||
# - netbsd/386 | ||
# - dragonfly/amd64 | ||
# - linux/arm | ||
# - linux/arm64 | ||
# - freebsd/arm | ||
# # Temporarily deactivated as golang.org/x/sys does not have syscalls | ||
# # implemented for that os/platform combination. | ||
# #- openbsd/arm | ||
# #- linux/mips64 | ||
# #- linux/mips64le | ||
# - netbsd/arm | ||
# - linux/ppc64 | ||
# - linux/ppc64le | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Start from a Debian image with the latest version of Go installed | ||
# and a workspace (GOPATH) configured at /go. | ||
FROM golang | ||
|
||
# Copy the local package files to the container's workspace. | ||
ADD . /go/src/github.com/ncabatoff/process-exporter | ||
|
||
# Build the process-exporter command inside the container. | ||
RUN make -C /go/src/github.com/ncabatoff/process-exporter | ||
|
||
USER root | ||
|
||
# Run the process-exporter command by default when the container starts. | ||
ENTRYPOINT ["/go/src/github.com/ncabatoff/process-exporter/process-exporter"] | ||
|
||
# Document that the service listens on port 9256. | ||
EXPOSE 9256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Copyright 2015 The Prometheus Authors | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
GO := GO15VENDOREXPERIMENT=1 go | ||
FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH))) | ||
PROMU := $(FIRST_GOPATH)/bin/promu | ||
pkgs = $(shell $(GO) list ./... | grep -v /vendor/) | ||
|
||
PREFIX ?= $(shell pwd) | ||
BIN_DIR ?= $(shell pwd) | ||
DOCKER_IMAGE_NAME ?= process-exporter | ||
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) | ||
|
||
ifdef DEBUG | ||
bindata_flags = -debug | ||
endif | ||
|
||
|
||
all: format build test | ||
|
||
style: | ||
@echo ">> checking code style" | ||
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^' | ||
|
||
test: | ||
@echo ">> running short tests" | ||
@$(GO) test -short $(pkgs) | ||
|
||
format: | ||
@echo ">> formatting code" | ||
@$(GO) fmt $(pkgs) | ||
|
||
vet: | ||
@echo ">> vetting code" | ||
@$(GO) vet $(pkgs) | ||
|
||
build: promu | ||
@echo ">> building binaries" | ||
@$(PROMU) build --prefix $(PREFIX) | ||
|
||
tarball: promu | ||
@echo ">> building release tarball" | ||
@$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) | ||
|
||
crossbuild: promu | ||
@echo ">> cross-building" | ||
@$(PROMU) crossbuild | ||
@$(PROMU) crossbuild tarballs | ||
|
||
docker: | ||
@echo ">> building docker image" | ||
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . | ||
|
||
promu: | ||
@echo ">> fetching promu" | ||
@GOOS=$(shell uname -s | tr A-Z a-z) \ | ||
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \ | ||
$(GO) get -u github.com/prometheus/promu | ||
|
||
|
||
.PHONY: all style format build test vet tarball crossbuild docker promu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.