* add optional server url arg to http client example
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add Dockerfile to build example http images
Multi-stage Dockerfile with targets for building example http server and
client.
$ docker build --tag the-server --target example-http-server .
$ docker build --tag the-client --target example-http-client .
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add docker-compose.yml file for running examples
This docker compose configuration file will help a new user to compile
and run the example code quickly. Uses the Dockerfile to build images
with compiled examples.
$ docker-compose build http-server http-client
$ docker-compose up http-server http-client
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add newline to last message of example http client
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add optional collector url arg to zipkin client example
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add Dockerfile target to build zipkin client
For building the example zipkin client:
$ docker build --tag zipkin-client --target example-zipkin-client .
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add docker compose service to run zipkin examples
Services to run the zipkin client along with a zipkin collector:
$ docker-compose build zipkin-client
$ docker-compose up zipkin-collector zipkin-client
Since the zipkin collector takes a few seconds before it is ready to
receive traces, I added a simple retry loop to the client command.
The collector service exposes port 9411 so user can visit
http//localhost:9411/ to see the trace sent to the collector. Be sure to
search by the trace id logged by the client.
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* Update Dockerfile with AL2 declaration
As described in https://www.apache.org/licenses/LICENSE-2.0#apply
Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>
* Update docker-compose.yml with AL2 declaration
As described in https://www.apache.org/licenses/LICENSE-2.0#apply
Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>
* pass server url as flag in example http client
$ ./client -h
Usage of ./client:
-server string
server url (default "http://localhost:7777/hello")
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* pass zipkin url as flag in example zipkin client
$ ./zipkin -h
Usage of ./zipkin:
-zipkin string
zipkin url (default "http://localhost:9411/api/v2/spans")
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* move Dockerfile and docker-compose.yml into example dir
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add Dockerfile and docker-compose.yml for zipkin example
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* update zipkin example README.md
With instructions on how to use docker-compose to run the example.
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* add http example README.md
With instructions on how to use docker-compose to run the example.
Signed-off-by: Andrew Hsu <xuzuan@gmail.com>
* Update example/http/Dockerfile WORKDIR
Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>
* Update example/http/Dockerfile RUN go install
Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>
* Update example/http/Dockerfile RUN go install
Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>
* Update example/zipkin/Dockerfile WORKDIR
Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>
* Update example/zipkin/Dockerfile RUN go install
Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
* Point to the convenience functions in api/key package
This is to increase the visibility of the api/key package through the
api/core package, otherwise developers often tend to miss the api/key
package altogether and write `core.Key(name).TYPE(value)` and complain
at the verbosity of such a construction. The api/key package would
allow them to write `key.TYPE(name, value)`.
* Use the api/key package where applicable
This transforms all the uses of `core.Key(name).TYPE(value)` to
`key.TYPE(name, value)`. This also should help increasing the
visibility of the api/key package for developers reading the otel-go
code.
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
* Remove LabelSet frmo api/metric
* SDK tests pass
* Restore benchmarks
* All tests pass
* Remove all mentions of LabelSet
* Test RecordBatch
* Batch test
* Improves benchmark (some)
* Move the benchmark to match HEAD
* Align labels for GOARCH=386
* Add alignment test
* Disable the stress test fo GOARCH=386
* Fix bug
* Move atomic fields into their own file
* Add a TODO
* Comments
* Remove metric.Labels(...)
* FTB
Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
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.
* Update License header for all source files
- Add Apache 2.0 header to source files that did not have one.
- Update all existing headers dated to 2019 to be 2020
- Remove comma from License header to comply with the Apache 2.0
guidelines.
* Update Copyright notice
Use the standard Copyright notices outlined by the
[CNCF](https://github.com/cncf/foundation/blob/master/copyright-notices.md#copyright-notices)
* Create MeterImpl interface
* Checkpoint w/ sdk.go building
* Checkpoint working on global
* api/global builds (test fails)
* Test fix
* All tests pass
* Comments
* Add two tests
* Comments and uncomment tests
* Precommit part 1
* Still working on tests
* Lint
* Add a test and a TODO
* Cleanup
* Lint
* Interface()->Implementation()
* Apply some feedback
* From feedback
* (A)Synchronous -> (A)Sync
* Add a missing comment
* Apply suggestions from code review
Co-Authored-By: Krzesimir Nowak <qdlacz@gmail.com>
* Rename a variable
Co-authored-by: Krzesimir Nowak <qdlacz@gmail.com>
* Add zipkin exporter
The zipkin exporter implements the SpanBatcher interface. It follows
the current-at-the-time-of-writing document about conversion from
OpenTelemetry span data to Zipkin spans. Which means that endpoint
information is not yet filled.
* Fix typo in docs
* Add a zipkin example
This sends span information to a locally running zipkin collector.
Currently I have a problem getting the collector to show me the spans
after accepting them with HTTP 202. Not sure if this is because of
missing endpoint information.
* Make gitignore consistent
The fixed paths should be prefixed with a slash. The "relative" paths
mean that git will ignore all the files that end with the path.
* Add tests for zipkin exporter
* Update api for Must constructors, with SDK helpers
* Update for Must constructors, leaving TODOs about global errors
* Add tests
* Move Must methods into metric.Must
* Apply the feedback
* Remove interfaces
* Remove more interfaces
* Again...
* Remove a sentence about a dead inteface
* drop gauge instrument
* Restore the benchmark and stress test for lastvalue aggregator, but remove monotonic last-value support
* Rename gauge->lastvalue and remove remaining uses of the word 'gauge'
Co-authored-by: Krzesimir Nowak <krzesimir@kinvolk.io>
The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was
mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. This
resulted in all subsequent releases not becoming the default latest,
meaning that `go get`s pulled in the incompatible `v0.1.0` release of
that package when pulling in more recent packages from other otel
packages. Renaming the `exporter` directory to `exporters` fixes this
issue by consequentially renaming the package.
Additionally, this action also renames *all* exporters. This is
understood to be a disruptive action to existing users as they will need
to update any dependencies they currently have on our exporters.
However, it was decided to take this action regardless. The need to
resolve the existing issue explained above is highly important, and
given the Alpha state of this project these kinds of breaking changes
should be expected (though not without reason).
Resolves#331
Co-authored-by: Rahul Patel <rghetia@yahoo.com>
It would be nice to follow a single schema for naming context
functions. In the trace package we followed the form FooFromContext
and ContextWithFoo. Do the same in the correlation package. The schema
WithFoo is mainly used for functions following the options pattern.
Not sure about a name of the NewContext function, though. For now I
have left it alone.
Co-authored-by: Rahul Patel <rghetia@yahoo.com>
* 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>
This PR removes the non-compliant ChildOf and FollowsFrom interfaces
and the Relation type, which were inherited from OpenTracing via the
initial prototype. Instead allow adding a span context to the go
context as a remote span context and use a simple algorithm for
figuring out an actual parent of the new span, which was proposed for
the OpenTelemetry specification.
Also add a way to ignore current span and remote span context in go
context, so we can force the tracer to create a new root span - a span
with a new trace ID.
That required some moderate changes in the opentracing bridge - first
reference with ChildOfRef reference type becomes a local parent, the
rest become links. This also fixes links handling in the meantime. The
downside of the approach proposed here is that we can only set the
remote parent when creating a span through the opentracing API.
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
* Rename distributedcontext package to correlation
Correlation is the name we agreed upon.
* Move trace propagators to api/trace
The trace propagators tests had to be moved to a testtrace subpackage
to avoid import cycles between api/trace and internal/trace.
Needed to shut up golint about stutter in trace.TraceContext -
TraceContext is a name of a W3C spec, so this stutter is
expected. It's certainly still better than golint's suggestion of
having trace.Context.
* Rename api/propagators to api/propagation
This package will not contain any propagators in the long run, just
the interface definitions.
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>