Skip to content

Commit

Permalink
Merge pull request #405 from axw/tidy-dependencies
Browse files Browse the repository at this point in the history
Introduce instrumentation-specific Go modules
  • Loading branch information
axw authored Jan 17, 2019
2 parents c3a93b0 + 981178c commit cc1e77d
Show file tree
Hide file tree
Showing 217 changed files with 2,825 additions and 22,343 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## [Unreleased](https://github.com/elastic/apm-agent-go/compare/v1.1.3...master)
## [Unreleased](https://github.com/elastic/apm-agent-go/compare/v1.2.0...master)

## [v1.2.0](https://github.com/elastic/apm-agent-go/releases/tag/v1.2.0)

- Add "transaction.sampled" to errors (#410)
- Enforce license header in source files with go-licenser (#411)
Expand All @@ -10,6 +12,7 @@
- module/apmzap: introduce zap log correlation and exception-tracking hook (#426)
- type Error implements error interface (#399)
- Add "transaction.type" to errors (#433)
- Added instrumentation-specific Go modules (i.e. one for each package under apm/module) (#405)

## [v1.1.3](https://github.com/elastic/apm-agent-go/releases/tag/v1.1.3)

Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,15 @@ We test with all versions of Go from 1.8 onwards using [Travis CI](https://travi
We track code coverage. 100% coverage is not a goal, but please do check that your tests
adequately cover the code using `go test -cover`.

### Release procedure

1. Update version.go and then run "make update-modules"
2. Update CHANGELOG.md, adding a new version heading and changing the base tag of the Unreleased comparison URL
3. Merge changes into github.com/elastic/apm-agent-go@master
4. Create tags: vN.N.N, and module/$MODULE/vN.N.N for each instrumentation module

scripts/tagversion.sh

5. Create release on GitHub

hub release -d vN.N.N
25 changes: 18 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
TEST_TIMEOUT?=5m
GO_LICENSER_EXCLUDE=$(shell find . -type d -name testdata | sed 's/^\.\///')
GO_LICENSER_EXCLUDE=\
module/apmot/internal/harness \
stacktrace/testdata

.PHONY: check
check: precheck test
check: precheck check-modules test

.PHONY: precheck
precheck: check-goimports check-lint check-vet check-dockerfile-testing check-licenses

.PHONY: check-goimports
.PHONY: check-dockerfile-testing
.PHONY: check-lint
ifeq ($(shell go run ./scripts/mingoversion.go -print 1.10),true)
.PHONY: check-modules
ifeq ($(shell go run ./scripts/mingoversion.go -print 1.11),true)
check-goimports:
sh scripts/check_goimports.sh

check-dockerfile-testing:
go run ./scripts/gendockerfile.go -d

check-lint:
go list ./... | grep -v vendor | xargs golint -set_exit_status
sh scripts/check_lint.sh

check-licenses:
go-licenser -d $(patsubst %,-exclude %,$(GO_LICENSER_EXCLUDE)) .

check-modules:
go run scripts/genmod/main.go -check .
else
check-goimports:
check-dockerfile-testing:
check-lint:
check-licenses:
check-modules:
endif

.PHONY: check-vet
check-vet:
go vet ./...
@for dir in $(shell scripts/moduledirs.sh); do (cd $$dir && go vet ./...); done

.PHONY: install
install:
Expand All @@ -43,11 +50,11 @@ docker-test:

.PHONY: test
test:
go test -v -timeout=$(TEST_TIMEOUT) ./...
@for dir in $(shell scripts/moduledirs.sh); do (cd $$dir && go test -v -timeout=$(TEST_TIMEOUT) ./...); done

.PHONY: coverage
coverage:
@sh scripts/test_coverage.sh
@bash scripts/test_coverage.sh

.PHONY: fmt
fmt:
Expand All @@ -57,6 +64,10 @@ fmt:
clean:
rm -fr docs/html

.PHONY: update-modules
update-modules:
go run scripts/genmod/main.go .

.PHONY: docs
docs:
ifdef ELASTIC_DOCS
Expand Down
286 changes: 286 additions & 0 deletions NOTICE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/supported-tech.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ information about httprouter instrumentation.
==== Echo

We support the https://echo.labstack.com/[Echo] web framework,
https://github.com/labstack/echo/releases/tag/3.3.2[v3.2.2] and greater.
https://github.com/labstack/echo/releases/tag/3.3.5[v3.3.5] and greater.

See <<builtin-modules-apmecho, module/apmecho>> for more information
about Echo instrumentation.
Expand Down
13 changes: 4 additions & 9 deletions env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"go.elastic.co/apm"
"go.elastic.co/apm/apmtest"
"go.elastic.co/apm/model"
"go.elastic.co/apm/module/apmhttp"
"go.elastic.co/apm/transport"
"go.elastic.co/apm/transport/transporttest"
)
Expand Down Expand Up @@ -178,17 +177,13 @@ func testTracerSanitizeFieldNamesEnv(t *testing.T, envValue, expect string) {
os.Setenv("ELASTIC_APM_SANITIZE_FIELD_NAMES", envValue)
defer os.Unsetenv("ELASTIC_APM_SANITIZE_FIELD_NAMES")

tracer, transport := transporttest.NewRecorderTracer()
defer tracer.Close()

w := httptest.NewRecorder()
req, _ := http.NewRequest("GET", "http://server.testing/", nil)
req.AddCookie(&http.Cookie{Name: "secret", Value: "top"})
h := apmhttp.Wrap(http.NotFoundHandler(), apmhttp.WithTracer(tracer))
h.ServeHTTP(w, req)
tracer.Flush(nil)

tx := transport.Payloads().Transactions[0]
tx, _, _ := apmtest.WithTransaction(func(ctx context.Context) {
tx := apm.TransactionFromContext(ctx)
tx.Context.SetHTTPRequest(req)
})
assert.Equal(t, tx.Context.Request.Cookies, model.Cookies{
{Name: "secret", Value: expect},
})
Expand Down
65 changes: 4 additions & 61 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,76 +1,19 @@
module go.elastic.co/apm

require (
cloud.google.com/go v0.33.0 // indirect
github.com/aws/aws-lambda-go v1.6.0
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/armon/go-radix v1.0.0
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisenkom/go-mssqldb v0.0.0-20181014144952-4e0d7dc8888f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/elastic/go-sysinfo v0.0.0-20180911173716-7b021494a956
github.com/elastic/go-sysinfo v0.0.0-20190103140604-e68552284485
github.com/elastic/go-windows v0.0.0-20180831131045-bb1581babc04 // indirect
github.com/emicklei/go-restful v2.8.0+incompatible
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect
github.com/gin-gonic/gin v1.3.0
github.com/go-sql-driver/mysql v1.4.0
github.com/gocql/gocql v0.0.0-20181109100135-9de8c0414fd7
github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3 // indirect
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
github.com/gomodule/redigo v2.0.0+incompatible
github.com/google/go-cmp v0.2.0
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.6.2
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
github.com/jinzhu/gorm v1.9.1
github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a // indirect
github.com/jinzhu/now v0.0.0-20180511015916-ed742868f2ae // indirect
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
github.com/json-iterator/go v1.1.5 // indirect
github.com/julienschmidt/httprouter v1.2.0
github.com/kr/pretty v0.1.0 // indirect
github.com/kr/pty v1.1.3 // indirect
github.com/labstack/echo v3.3.5+incompatible
github.com/labstack/gommon v0.2.8 // indirect
github.com/lib/pq v1.0.0
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/mattn/go-sqlite3 v1.10.0
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/opentracing/opentracing-go v1.0.3-0.20181012221231-be550b025b43
github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v0.9.1
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce // indirect
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d // indirect
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a
github.com/rs/zerolog v1.10.3
github.com/santhosh-tekuri/jsonschema v1.2.3
github.com/stretchr/testify v1.2.2
github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 // indirect
go.elastic.co/fastjson v1.0.0
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869 // indirect
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 // indirect
golang.org/x/net v0.0.0-20181113165502-88d92db4c548
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288 // indirect
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect
golang.org/x/tools v0.0.0-20181113200934-7e59e591a261 // indirect
google.golang.org/appengine v1.3.0 // indirect
google.golang.org/genproto v0.0.0-20181109154231-b5d43981345b // indirect
google.golang.org/grpc v1.16.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
gopkg.in/yaml.v2 v2.2.1 // indirect
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3 // indirect
howett.net/plist v0.0.0-20180609054337-500bd5b9081b // indirect
golang.org/x/sys v0.0.0-20190102155601-82a175fd1598 // indirect
howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
)
Loading

0 comments on commit cc1e77d

Please sign in to comment.