* Vendor Thrift dependency
* Fix build
* Changelog entry
* Ignore third_party for coverage purposes
* Re-run tests
* Re-run tests
* Re-run tests
* Re-run tests
* Relax time comparisons
Fixes#1559.
Some unit tests were flaking in CI because they expected the timestamp
to advance during a test, when it's possible for it to be unchanged
instead. This change switches the offending "<" comparisons to "<=".
* Re-run tests
* Relax more time comparisons
* Re-run tests
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Add a tool to auto-generate replace directives
* Auto-generated changes from previous commit
* Create new modules required for trace release
* otel/metric
* otel/trace
* otel/oteltest
* otel/sdk/export/metric
* otel/sdk/metric
Relates to #1467
* Move metric-related public API out of otel/ pkg
Move GetMeterProvider, Meter and SetMeterProvider to new package
otel/metric/global in the otel/metric module.
This will allow otel/ module to be released as v1.0.
* Include PR references in CHANGELOG
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Check for root dir
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Examples are "leaf" packages, that pull some other packages. So build
the other packages first to get and fix all the errors there, before
building the examples.
Add check for github-actions.
Add missing examples and SDK go.mod
Remove redundant comments.
Change check to be weekly on Sunday to reduce load and churn.
Sort alphanumerically.
Add check to Makefile to ensure if there is a `go.mod` file there is a dependabot entry for that directory.
* Export coverage report to codecov
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Use orb and individual coverage files per module
* Run go cover inside module directory to account for local rewrites
Still try to upload using a single file, since orb docs seem to
indicate if you have more than one file, you're going to need to run
the orb multiple times.
* Use correct filename
* Don't do anything silly like appending a file to itself
* Handle subtle differences between FreeBSD and Linux
* Ignore opentelemetry-proto-gen files in exporters/otlp/internal
* Does codecov orb leave current directory in a bad state?
* Copy instead of move
* Ignore generated protobuf code in jaeger exporter module
Co-authored-by: Evan Torrie <evantorrie@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Move proto to OTLP exporter
* Update OTLP exporter import of proto
* Use gogo protobuf
To stop using the deprecated github.com/golang/protobuf and match what
the collector is doing, switch to generating OTLP with the
github.com/gogo/protobuf/proto instead of
github.com/golang/protobuf/proto.
* Clean dependencies
Remove all protobuf dependencies from otel package and all of its
dependencies.
* Update CHANGELOG
* Clean OTLP exporter go mod
Remove submodule beforehand to avoid unneeded direct dependencies.
* Use default ref for GitHub workflow
* Update path that triggers proto gen action
* Correct license-check exclusion for OTLP
* Update commented location of the OTLP and code
* Add protogen workflow
* Move out protobuf generation to Makefile.proto
* Include in Changelog
* Update Makefile.proto
Move file-local mode variable to line by itself.
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Bump golangci-lint to 1.25
* Skip the "unused" linter when running golangci-lint in --fix mode
This linter seems to provide bogus fix-up information to
golangci-lint, which results in file corruption instead of fixing the
issue. Since we are going to run the linter again anyway, but without
the --fix mode, skip the "unused" linter explicitly for the first run
- it will still have a chance to report errors on the second run.
Update license header to standard format for source files missed prior.
Add license header to new source files.
Add Makefile check to test all `*.go` and `*.sh` files have a copyright
notice (or comment about them being auto-generated) within the first few
lines.
* Move dependencies of tools package to a tools directory
* remove TOOLS_MOD_DIR from ALL_GO_MOD_DIRS in a Makefile.
then run 'go mod tidy' on ALL_GO_MOD_DIRS and TOOLS_MOD_DIR.
Co-authored-by: Rahul Patel <rghetia@yahoo.com>
* Generate and build before linting
Generated files may require some formatting that happens during
linting. Also missing generated files may result in linter failures.
Building can shake out any syntax/semantic errors and report them in a
much nicer way than the linter does. Which is exactly the reason the
build was running before linters before the Makefile simplification.
* Make stringer tool a dep of generate target, not lint
Lint target does not use the stringer utility - it is being used by go
generate.
* Simplify Makefile
In particular, this change:
* Ensures that the race checker is always used for all tests
* Removes redundant commands
* Splits out `generate` and `lint` as their own commands
* Renames the `circle-ci` command to the more generic `ci`
* Use GOTEST_WITH_COVERAGE instead of old name
* Fix test-with-coverage command
* Fix test-386 command
golangci-lint runs its checks also on tests files, so make sure that
they build properly before running the linter. there is no obvious
solution to just build all the test without running them, so to work
that around, we specify a -run flag with a value that surely isn't
going to match any test function any time soon. that way we build all
the tests, but no test is run.
also, `go list ./...` returns only packages in the module, but no
packages within submodule, so exporter/trace/jaeger (which is a
submodule) was never on the list. so go test with those packages never
ran the jaeger trace exporter tests. fix this by visiting every
directory with the go.mod file and calling go test [options]
./... therein.
golangci-lint just issues an unreadable warning and quits with a
successful exit status on compilation error. just run a round of go
build ./... to catch those as hard errors.
* automate building all the examples
the EXAMPLES variable was out of date - the stackdriver example wasn't
even built
let's automate it, so we don't need to remember about updating the
variable after adding a new example to the examples directory
* move jaeger example to example directory
this should be in the examples directory, so it can be built by the
make test during CI.
* switch to go 1.13
circle ci uses go 1.12 (which is the oldest 1.12 release) that
contains some bugs with module handling
let's switch to go 1.13.3, the latest go currently
* use a single valid revision of the project in go.mod files
this probably shouldn't be a problem since the switch to go 1.13 in
circle ci, but cleans up the mess and the use of bogus releases
* Add a document about contributing
It is shamelessly stolen from opentelemetry-python and edited to be
relevant to opentelemetry-go. This file should explain some less
obvious things about the development of the project, like running
linters and regenerating the files.
* Force the use of go modules
Until go 1.13 modules were disabled by default if the repository was
inside GOPATH. This was causing issues when running `make precommit`
for the first time, as it could not find sources for any of the tools
used in `make precommit` under `${GOPATH}/src`. With setting the
`GO111MODULE` environment variable to `on`, we tell `go` to behave
differently, just like go 1.13 does by default.
* Remove globals from exp/streaming
* basic example
* Build the streaming example
* Update README.md for running streaming example
* Remove observer package
* Move observer to exporter
* Fix
* Re-run make circle-ci
* Run go generate in the precommit target
So we should always get an updated version of a file generated by a
stringer utility.
* Update the generated file
* Make CI to fail if working tree has uncommited changes
The uncommitted changes may come from the golang linter (that formats
our code among other things) and from stringer (when updated some
enumeration).
Enabling misspell and goimports in golangci-lint allows a bit of
simplification of tools.go / Makefile.
The linters enabled locally also complained about the markdown in
README.md a little, so I fixed those complaints.
I also enabled auto-fix mode in golangci-lint so that it will just
fix any lint issues it runs across (which is how goimports/misspell)
was being used.
misspell still needs to be included in tools.go unless we decide that
we didn't want it to run on markdown files.
* fix compile errors.
* fix lint errors.
* add circle-ci job.
* rename IDHigh to TraceIDHigh
* rename the file.
* add go get for goimports and golangci-lint
* enable GO111MODULE and remove comments.
* remove working dir and update cache name
* Add TEST_RESULT env back.
* run go mod tidy.
* remove go mod download.
* add test coverage.
* fix TraceID.
* fix circlefi config error.
* remove install-tools.
* remove ALL_TEST_SRC from Makefile.
goimports for import rewritting
golangci-lint as the configurable linting swiss army knife.
These tools are recorded in [tools.go](https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module). This records
them as a dependency to make sure we're all using the same tool versions.
To make sure this project's tool's versions don't stomp over versions
from other projects, they are installed in ./.tools, which is
.gitignored.
goimports was run and fixed up a single file:
plugin/httptrace/httptrace.go
I prefer to group local packages below external packages, hence the use
of goimports -local option.
.golangci.yml contains nothing but an incomplete set of defaults ATM.
I expect those to change over time though. ;-)
To use, run:
$ make precommit
Fixes#15