1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-02 08:52:21 +02:00
Commit Graph

80 Commits

Author SHA1 Message Date
rghetia
211007efb2
add binary propagation. (#155) 2019-10-02 13:54:39 -07:00
rghetia
7797bf9837
update README.md with quick start and release date. (#157) 2019-10-01 22:43:06 -07:00
rghetia
3d5b2fa328
Batched span processor (#154)
* add batch span processor.

* add blocking support.

* use With* function for options.
- also changed how Shutdown is handled.

* block Shutdown until queue is flushed.

* fix comment.
2019-10-01 13:50:51 -07:00
Krzesimir Nowak
a936b8fb00 Add some docs about useful step before filing a PR (#151)
* 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.
2019-10-01 09:16:45 -07:00
Steven Karis
fa7d053793 Add stdout trace exporter (#153)
* Add stdout trace exporter (#134)

* Update go.mod and go.sum

* Do not use assert in tests
2019-09-28 11:27:02 -07:00
Alyson van Hardenberg
0eb73325ce rename finish to end (#150)
* rename finish -> end

* missed a few finish -> end spots

* change end back to finish for the bridge span in the openTracing bridge

* fixed grammar, ran make
2019-09-27 10:48:10 -07:00
rghetia
e86b95c440
change TraceOptions to TraceFlags. (#144)
* change TraceOptions to TraceFlags.

* fix grammer in docs.
2019-09-25 14:37:36 -07:00
rghetia
a853377a2f
Update example to use jaeger exporter and update Readme (#143)
* update http example to use jaeger exporter and sdk.

* update image location.

* remove extra parameters for jaeger.
2019-09-25 13:22:33 -07:00
Krzesimir Nowak
7966e63342 More cleanups from #100 (#142)
* Drop dead event type

* Replace EventType from reader with one from exporter

* Do not concat the strings for string buffer

* Fill scope ID in events

That required renaming a variable, because it had the same name as the
type we wanted to assert later.

* Do not fail quietly when span context is busted
2019-09-25 10:30:02 -07:00
Krzesimir Nowak
908b73d792 run golangci-lint in all directories with go.mod (#138)
* Run golangci-lint in all directories with go.mod

* Imports fix by golangci-lint

* Propagate failures from commands running in loops
2019-09-25 09:38:55 -07:00
Krzesimir Nowak
339ca2d974 Initial opentracing bridge (#98)
* Allow specifying custom timestamps for events

Adding event with timestamp is not yet a part of the OpenTelemetry
specification, but this function will come in handy when implementing
the OpenTracing bridge.

* Add opentracing bridge, wrapper tracer and migration interfaces

There are some features missing - setting up links and span kind;
context propagation will only work between two OpenTracing bridges.

* Add some tests for the opentracing bridge

The tests mostly check various aspects of the cooperation between
OpenTracing and OpenTelemetry APIs.
2019-09-24 23:12:22 -07:00
stgrzeszczak
8af7978f42 Fix compilation with Golang 1.13 (#137)
* Fix compilation with Golang 1.13

* run go mod tidy again
2019-09-24 08:26:21 -07:00
Joshua MacDonald
a3ae50d8bc
Remove experimental/streaming globals, add streaming example (#135)
* 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
2019-09-23 14:39:10 -07:00
rghetia
83935b2558
Add propagator interface and W3C propagator (#85)
* add propagation api.

* add http propagator interface and w3c propagator implementation.

* remove Extract api from trace.

* remove Extract interface for tracer.

* fix copyright.

* fix variable names and comments.

* move inject/extract out of trace.

* replace INVALID_SPAN_CONTEXT with EmptySpanContext function.

* fix tag.Map.

* make carrier as interface instead of http.Request.

* rename structs and update doc comments..

* add doc.go

* update doc.

* add noop propagator.

* add new propagation api with Supplier interface.
- added Default Tracer which simply propagates SpanContext.
- added CopyOfRemote option to simply create remote span.

* remove old propagator.

* rename propagator to TextFormatPropagator.

* rename default tracer/span as pass_through tracer/span.

* add test for pass through tracer.

* add missing interface to pass through tracer.

* return SpanContext instead of contex.Context from Extract interface.
- also remove PassThroughTracer

* fix review comments.

* add more test cases for traceContext extraction.

* remove tidy temporarily from circle-ci target to avoid build failure.

* allow header ending in dash '-'.

* add inject test for non-zero value other than 01 for traceoption

* add AddLink and Link interface to MockSpan

* fix running go mod tidy on every build.
2019-09-23 11:51:32 -07:00
rghetia
b13362e37c
replace -printf option with -exec in find cmd for go.mod directories. (#139) 2019-09-23 11:04:55 -07:00
rghetia
c70cb29f22
add support for Link. (#80)
* add support for Link.

* add AddLink to mockSpan

* update api documentation.
2019-09-21 00:26:20 -07:00
rghetia
8af3bfcdc2
Use trace.SetCurrentSpan to store the span in the context in SDK. (#129) 2019-09-19 12:23:07 -07:00
Krzesimir Nowak
3362421c9b Drop the registry package (#130)
This is to shrink the PR #100.

The only place where the registry.Variable type was used was metrics,
so just inline that type into its only user. The use of the
registry.Variable type in core.Key was limited to the Name field.

The stats package also used the registry.Variable type, but seems that
also only the Name field was used and the package is going to be
dropped anyway.
2019-09-19 11:20:02 -07:00
Krzesimir Nowak
0583d26d0b Build example and ensure go mod files are tidy (#131)
* Build examples when running tests

* Run go mod tidy in precommit

That way CI can catch the case when go.mod or go.sum are outdated.
2019-09-19 09:16:09 -07:00
rghetia
cb0d352ec6
SDK: span processor interface and simple span processor. (#117)
* SDK: SpanProcessor Interface.

* add simple span processor.

* rename span processor.

* fix logic to export or process span data.
2019-09-16 13:58:15 -07:00
Liz Fong-Jones
5df3c071e8 httptrace calls arrive async/threaded. (#113) 2019-09-12 16:40:58 -07:00
rghetia
9f85824979
Exporter: Initial Jaeger Trace Exporter commit. (#112)
* Exporter: Initial Jaeger Trace Exporter commit.

* remove unused methods and add TODOs.

* remove TODO.

* fix build error by exporting event struct.

* move Event from basetypes.go to export.go
2019-09-09 14:59:39 -07:00
Krzesimir Nowak
a776e95c61 Consolidate AddEvent and Event methods, add FinishOptions (#99)
* Merge two event methods in span API

There was an agreement to get rid of the Event interface and
consolidate the two methods for adding events into one. See #57.

* Eliminate the use of the Event interface

There is no need for the SDK to provide the implementation of the
Event interface - it is used nowhere.

* Drop the Event interface

It's dead code now.

* Make it possible to override a finish timestamp through options

Opentracing to opentelemetry bridge will certainly use this feature.

* Obey the start time option

* Add tests for events and custom start/end times
2019-09-03 11:03:51 -07:00
Krzesimir Nowak
3fc6025071 Allow setting the name of the span after starting it (#102)
* Allow setting the name of the span after starting it

* Add test for setting the name of the span
2019-08-26 11:53:12 -07:00
Koichi Shiraishi
887748491b Add vanity import name (#107)
* api: add doc.go and vanity custom import name

* experimental/streaming/exporter: add doc.go & vanity custom import name

* experimental/streaming/exporter/*: add vanity custom import name

* golangci.yml: fix local-prefixes to go.opentelemetry.io

* api,sdk: run `goimports -w -local go.opentelemetry.io`
2019-08-26 09:41:15 -07:00
Koichi Shiraishi
27bb6c8c7f Fix godoc and goreportcard badge url to use vanity import path (#108) 2019-08-26 09:11:07 -07:00
Krzesimir Nowak
670b0365d8 Make tag.Map a concrete type. (#89)
This is to make tag.Map an immutable type, so it is safe to use
concurrently. The safety is not yet fully achieved because of the
functions returning contents of the map (Value and Foreach). The
functions give callers an access to core.Value objects, which contain
a byte slice, which has pointer like semantics. So to avoid accidental
changes, we will need to copy the value if it is of BYTES type.

Fixes #59
2019-08-23 09:01:52 -07:00
Krzesimir Nowak
fafb3daf1e Fix parent span ID formatting (#103)
It was printing an ID of the created span instead. Also drop the if
clause checking if span has a parent span ID - we know at this point
that the condition is always true.
2019-08-22 22:18:31 -07:00
Dave Josephsen
3ca747f4e8 change the api/core tests to use core_testing package (#96)
* add exported value for traceOptionBitMaskUnused (for testing)

* move key_test to package core_test

* add span_context_test to package core_test
2019-08-22 11:40:15 -07:00
Krzesimir Nowak
8d93efab11 Run go generate during make and make sure that generated files are in sync in CI (#101)
* 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).
2019-08-22 11:16:51 -07:00
Dave Josephsen
8e7e1fd0a9 add tests for api/trace/current.go (#82)
* add tests for api/trace/current.go

* add interface validaion for type: mockSpan

* rework for exported NoopSpan and ditch useless tabletest for TestSetCurrentSpan()
2019-08-22 10:15:22 -07:00
rghetia
a54a8a27c4
Add Sampler API (#70)
- also add implementation of AlwaysSampleSampler and NeverSampleSampler
2019-08-22 09:57:27 -07:00
Krzesimir Nowak
6dab220fc5 Fix "add event" event handling (#97) 2019-08-16 11:07:23 -07:00
Isobel Redelmeier
56e1a9d1f4 Export NoopSpan and NoopTracer (#92) 2019-08-13 16:03:40 -07:00
Isobel Redelmeier
0db77910a7 Create separate go modules for examples (#26)
This prevents core code from including dependencies required only for
examples, reducing the number of dependencies that core code needs to
rely on.
2019-08-13 16:02:21 -07:00
Krzesimir Nowak
6c2b769f8c Update some paths in README.md (#88)
Some code got moved, so reflect that in the README.
2019-08-12 15:46:56 -07:00
thinkerou
0ce21a987b remove duplicate interface check (#87) 2019-08-12 11:03:29 -07:00
thinkerou
290f108852 use EmptySpanContext function instead of global variable (#86) 2019-08-12 10:59:35 -07:00
Edward Muller
623b062e17 Forgot this removal in my last PR. (#84)
goimports is no longer in tools.go and should have been removed from
the Makefile.
2019-08-07 14:33:39 -07:00
Edward Muller
99906da7a6 Misc Makefile and README.md updates (#78)
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.
2019-08-05 13:58:24 -07:00
thinkerou
0a37b8f43e add IsValid() for SpanContext (#46)
* add IsValid() for SpanContext

* add unit test
2019-08-05 09:58:50 -07:00
rghetia
0f32efcdaa
Trace sdk (#65)
* trace sdk initial commit.

* fix imports and comments.

* remove tracestate

* split trace.go

* add attribute over limit test.

* add comments and restructure span.go and tracer.go

* refactor MessageEvent

* defer unlock

* some more cleanup in span.go

* rename *MessageEvent* to *Event*

* cleanup comments in trace_test.go

* fix typos.

* return full string ID for traceID and spanID.
2019-08-02 13:52:55 -07:00
rghetia
ed3b26b6c8
add misspell tool fix common spelling mistakes. (#69) 2019-08-02 10:44:32 -07:00
rghetia
0edf31e1c6
add APIs for traceoption and tracestate. (#60)
* add APIs for traceoption and tracestate.

* remove tracestate and refactor traceoptions.
2019-08-02 10:42:47 -07:00
Dave Josephsen
dad5622903 adds tests for api core key.go (#64)
* adds tests for api core key.go

* re-arrange imports

* change all floats to 42.1

* set TestFloat32 to 42.0
2019-07-23 11:38:23 -07:00
Dave Josephsen
4b974a1beb adds tests for core/span_context.go (#63) 2019-07-19 13:29:42 -07:00
Joshua MacDonald
b26d6675ed Restore the experimental/streaming SDK implementation (#55)
* Fix streaming - part 1

* Eliminate span{} state

* Eliminate trace/ dir

* Avoid missing AddEvent helpers
2019-07-17 13:59:53 -07:00
thinkerou
2c77e484b4 add lint icon (#58) 2019-07-16 21:52:48 -07:00
Wei Fu
eba4b51b81 set vtype for newVar (#56)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-07-16 10:08:12 -07:00
rghetia
eed647d11f
replace import with vanity url go.opentelemetry.io. (#54) 2019-07-15 14:49:21 -07:00