Skip to content

Commit

Permalink
Add simpleprom example to the module, upgrade, and fix otlp version (#…
Browse files Browse the repository at this point in the history
…2626)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Mar 11, 2021
1 parent 47f1d02 commit 792079f
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 64 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Expand Up @@ -234,6 +234,10 @@ updates:
directory: "/receiver/k8sclusterreceiver"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/receiver/kafkametricsreceiver"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/receiver/kubeletstatsreceiver"
schedule:
Expand Down Expand Up @@ -270,6 +274,10 @@ updates:
directory: "/receiver/simpleprometheusreceiver"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/receiver/simpleprometheusreceiver/examples/federation/prom-counter"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/receiver/splunkhecreceiver"
schedule:
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Expand Up @@ -12,6 +12,9 @@ BUILD_X2=-X $(BUILD_INFO_IMPORT_PATH).Version=$(VERSION)
BUILD_X3=-X go.opentelemetry.io/collector/internal/version.BuildType=$(BUILD_TYPE)
BUILD_INFO=-ldflags "${BUILD_X1} ${BUILD_X2} ${BUILD_X3}"

# ALL_MODULES includes ./* dirs (excludes . dir and example with go code)
ALL_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort | egrep '^./' )

# Modules to run integration tests on.
# XXX: Find a way to automatically populate this. Too slow to run across all modules when there are just a few.
INTEGRATION_TEST_MODULES := \
Expand All @@ -23,8 +26,11 @@ INTEGRATION_TEST_MODULES := \

.DEFAULT_GOAL := all

all-modules:
@echo $(ALL_MODULES) | tr ' ' '\n' | sort

.PHONY: all
all: common otelcontribcol otelcontribcol-unstable
all: common gotest otelcontribcol otelcontribcol-unstable

.PHONY: e2e-test
e2e-test: otelcontribcol otelcontribcol-unstable
Expand Down Expand Up @@ -53,6 +59,10 @@ gotidy:
$(MAKE) for-all CMD="rm -fr go.sum"
$(MAKE) for-all CMD="go mod tidy"

.PHONY: gotest
gotest:
$(MAKE) for-all CMD="make test"

.PHONY: gofmt
gofmt:
$(MAKE) for-all CMD="make fmt"
Expand Down
13 changes: 2 additions & 11 deletions Makefile.Common
Expand Up @@ -11,8 +11,6 @@ ALL_SRC_AND_DOC := $(shell find . \( -name "*.md" -o -name "*.go" -o -name "*.ya

# ALL_PKGS is used with 'go cover'
ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC))) 2>/dev/null)
# ALL_MODULES includes ./* dirs (excludes . dir and example with go code)
ALL_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort | egrep '^./' | grep -v 'receiver/simpleprometheusreceiver/examples/' )

GOTEST_OPT?= -race -timeout 30s
GOTEST_INTEGRATION_OPT?= -race -timeout 60s
Expand All @@ -29,9 +27,6 @@ IMPI=impi
# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release

all-modules:
@echo $(ALL_MODULES) | tr ' ' '\n' | sort

all-pkgs:
@echo $(ALL_PKGS) | tr ' ' '\n' | sort

Expand All @@ -41,15 +36,11 @@ all-srcs:
.DEFAULT_GOAL := common

.PHONY: common
common: checklicense impi lint misspell test
common: checklicense impi lint misspell

.PHONY: test
test:
@set -e; for dir in $(ALL_MODULES); do \
echo "go test ./... in $${dir}"; \
(cd "$${dir}" && \
$(GOTEST) ./... ); \
done
$(GOTEST) ./...

.PHONY: do-unit-tests-with-cover
do-unit-tests-with-cover:
Expand Down
@@ -0,0 +1 @@
include ../../../../../Makefile.Common
@@ -1,11 +1,12 @@
module app
module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/simpleprometheusreceiver/examples/federation/prom-counter

go 1.14

require (
go.opentelemetry.io/otel v0.15.0
go.opentelemetry.io/otel/exporters/metric/prometheus v0.15.0
go.opentelemetry.io/otel/exporters/otlp v0.15.0
go.opentelemetry.io/otel/sdk v0.15.0
go.opentelemetry.io/otel v0.18.0
go.opentelemetry.io/otel/exporters/metric/prometheus v0.18.0
go.opentelemetry.io/otel/metric v0.18.0
go.uber.org/zap v1.16.0
golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect
google.golang.org/protobuf v1.25.0 // indirect
)

0 comments on commit 792079f

Please sign in to comment.