Commit Graph

13 Commits

Author SHA1 Message Date
John Watson 485cc52c6f
SpanContext hides the TraceId/SpanId implementations (#1594)
*  This is a combination of 2 commits.
 This is the 1st commit message:

WIP on converting to String-based SpanContext

don't hand out the byte arrays publicly, but require making copies

make sure to hand out fresh invalid byte arrays.

Use strings for span and trace ids.

Switch over to CharSequence instead of String for the ids

Fix a couple of places that were casting to String

Add some simple wrappers for the generated longs to save converting until the last moment to the character-based representation.

introduce a reusable threadlocal char buffer for generating random ids.

update for changes from upstream

Change the SpanContext to store the ids as Strings internally
Change the id access methods on SpanContext to be clearly labeled as the base16 representations
Add a new create method that allows specifying offsets for traceId and spanId CharSequences

Provide an option for creating a SpanContext from longs or Strings, optionally.

fix a typo

update from upstream

 The commit message #2 will be skipped:

 don't hand out the byte arrays publicly, but require making copies

* WIP on converting to String-based SpanContext

* Update the SpanContext to only store Strings internally for Trace and Span ids.

* remove dead files

* cleanup some CharSequence usages to String

* Update api/src/main/java/io/opentelemetry/trace/BigendianEncoding.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update extensions/trace_propagators/src/main/java/io/opentelemetry/extensions/trace/propagation/B3PropagatorInjectorSingleHeader.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update api/src/main/java/io/opentelemetry/trace/SpanId.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update api/src/main/java/io/opentelemetry/trace/TraceId.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* updates from PR suggestion fubars

* some cleanup from PR feedback

* Switch back to String from CharSequence

* Get rid of the overload with the offsets

* Lots of bits of cleanup from PR feedback.

* more renaming of base16 to hex

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-09-03 10:03:41 -07:00
Giovanni Liva 304f55a7ab
Remove link and parent sampling decision from Probability sampler (#1557)
* Remove link and parent sampling decision from Probability sampler

* Update tests to ParentBased
2020-09-03 10:00:52 -07:00
John Watson 0024aa9bee
Fix for a mashed up PR merge. (#1602) 2020-08-28 18:39:12 -07:00
dengliming ed08e9f287
Add an overload to the recordException method to support additional attributes (#1599)
* Add an overload to the recordException method to support additional attributes

* Fix Codecov

* Fix review

* Fix review
2020-08-28 12:41:36 -07:00
Anuraag Agrawal c6c179c267
Make sure forceFlush / shutdown can have callers wait for them to be done by returning CompletableResultCode. (#1571)
* Make sure forceFlush / shutdown can have callers wait for them to be done by returning CompletableResultCode.

* Merge
2020-08-28 10:51:39 -07:00
dengliming f680094039
Rename ParentOrElse to ParentBased and generalize to support all cases (#1577)
* Rename ParentOrElse to ParentBased

* Update samplers to match spec.

* Fix check style

* Fix check style

* Fix review

* Separate test for parentOrElse sampler

* Provide ParentBased.Builder

* Fix code style

* Fix java doc.

* Update javadoc

* Builder use set instead of with

* Rename newParentBasedBuilder to parentBasedBuilder
2020-08-28 10:43:38 -07:00
John Watson c3ac67bb85
Preserve the ParentOrElse behavior when changing sampling probability via configuration. (#1595) 2020-08-27 10:13:48 -07:00
John Watson a021a59b94
Update metric description in the BatchSpanProcessor (#1592) 2020-08-26 08:44:24 -07:00
Nikita Salnikov-Tarnovski af39f35086
More aggresive version of BatchSpanProcessor (#1579)
* More aggresive version of BatchSpanProcessor

* Add benchmark

* Polish

* Polish

* Incorporated some changes from #1571

* Rollback one test change

* Polish

* Polish
2020-08-26 08:22:39 -07:00
John Watson 7e87a69ae0
Introduce a ReadWriteSpan interface and pass it to the onStart of the SpanProcessor (#1574)
* start working on a ReadWriteSpan for startSpan

* Finish converting the disruptor and the unit tests to the new model.

* Add some simple javadoc to the ReadWriteSpan interface
2020-08-24 07:48:27 -07:00
jarebudev ca85d8f0eb
prevent parent spanContext from being null in Samplers (#1563) 2020-08-20 10:23:47 -07:00
Nikita Salnikov-Tarnovski ad9f7d4cf5
BatchSpanProcessor now starts daemon timer thread (#1559)
* BatchSpanProcessor now starts daemon timer thread

* BatchSpanProcessor now starts daemon timer thread

* Format
2020-08-19 08:55:07 -07:00
Ken Finnigan 26597266df
Separate the SDK into separate publishable artifacts (#1525)
* Split single "sdk" module into separate pieces for common, correlationcontext, metrics, tracing, and the combination of them all

* Modify comment to not reference implementation class

* Moved JMH code to /sdk/all

* Move new files to adjusted location

* Move new files from rebase
2020-08-18 13:43:17 -07:00