* Remove getCurrentContext and withSpan from Tracer
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Remove old java7 example
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Turn the Baggage metadata into a simple wrapper for a String.
* whoops missing final modifier
* remove unneeded nullable annotation
* Remove the method to parent via Baggage.
Parenting is still implemented via the Context.
Also, renamed many old variables and method to use the new baggage name.
* update for context changeover
* Remove the method to parent via Baggage.
Parenting is still implemented via the Context.
Also, renamed many old variables and method to use the new baggage name.
* Basic implementation of baggage header extraction.
* inject implemented
* cleanup checks
* update for context changeover
* Turn the Baggage metadata into a simple wrapper for a String.
* whoops missing final modifier
* remove unneeded nullable annotation
* Remove the method to parent via Baggage.
Parenting is still implemented via the Context.
Also, renamed many old variables and method to use the new baggage name.
* small javadoc tweak
* update for context changeover
* Turn the Baggage metadata into a simple wrapper for a String.
* whoops missing final modifier
* javadoc cleanup
* use the empty metadata as the OT Shim default
* remove unneeded nullable annotation
* subsume methods from AttributesKeys to AttributeKey
* remove missed instance of AttributesKeys
* make javadoc wording more representative of method intent
* Remove Link from API, use SpanData.Link in Sampler
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Fix tracing_incubator
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Remove addLink that accepts Link interface
Currently the Link interface cannot easily be removed, used in the Sampler interface,
will do a separate PR for that.
Based on the specs we don't have to offer a "lazy" formatted Link API (was removed some time ago).
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Copy javadoc instead of reference
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
* Remove Event interface, and it's usage
Based on the specification we are not required to expose this interface or have APIs that accept this interface.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Fix links to Event
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Fix more javadocs references to Event
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Make setting null-valued attributes a no-op, and document that their behavior is undefined.
* also have the span itself ignore null attribute values
* Update api/src/main/java/io/opentelemetry/common/Attributes.java
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
* Set the non-null-by-default annotation on the package level for the common code.
* add no-op validating tests with a caveat
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
* check traceparent for extra trailing characters for version 00
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* add tests and make "00" a constant
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* #1674 validate version from traceparent according to spec
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* add test
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* add test
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* rename TraceVersion to WireFormatUtils
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* rename test method
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* use precalculated versions
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* get rid of unneded class
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* get rid of empty lines
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* fix style
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
* Reverse the precedence on Labels and Attributes to prefer the last one added, rather than the first.
Note: this necessitated changing the way Resources were merged, and the way recordException was implemented.
Added an addAll method to the builder to support efficiently addition of attributes from existing attributes.
* run the formatter
* revert 2 unneeded assertion changes
* Update from rebase
* Add a generic type for the key on the ImmutableKeyValuePairs.
This necessitated changing the `get` to `getValue` to avoid clashing with the java.util.Map interface.
Also introduced convenience sub-interfaces for consuming labels and attributes, so consumers don't have to worry about the types if they don't want to.
* Make AttributesMap not extend map, and restore the get method name for Attributes.
* key class and implementation
* key class and implementation
* The code compiles
* little tweaks
* some cleanup, tests are passing
* remove AttributeValue and clean up misc. references to it.
* clean up some unused bits
* add a TODO
* a bit of cleanup; fix a todo
* update for changes from the main branch
* Change method to get the underlying key.
Move the key creators to a AttributesKeys class.
Hide the implementation classes and replace with interface use.
* use autovalue for the key implementations
* fix javadoc issues
* update benchmark keys, and a few tweaks from PR review
* Add javadoc notes to encourage using the lower-overhead attribute options.
* Add javadoc clarifying subclass responsibilities around empty keys.
* make the compareTo on AttributeKeyImpl null-safe, for extra safety
* fix formatting
* switch to java 8
* update the READMEs and use Object.equals in a couple of cases to test that we're really compiling for java 8/android 24.
* formatting
* use the newer release options for the build, and change the int test to not be java 7 any more.
* switch back to source/target compatibility
* sure wish I could run docker locally to test this out.
* move TraceFlags into the SpanContext, and expose the relevant flags.
* Cleanup from rebase from main branch
* Address comments from PR review
* Update extensions/trace_propagators/src/main/java/io/opentelemetry/extensions/trace/propagation/AwsXRayPropagator.java
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
* Undo @anuraaga's bad suggestion. ;)
* change the traceFlags input to the TraceContext be a byte, rather than a boolean.
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
* Add a generic type for the key on the ImmutableKeyValuePairs.
This necessitated changing the `get` to `getValue` to avoid clashing with the java.util.Map interface.
Also introduced convenience sub-interfaces for consuming labels and attributes, so consumers don't have to worry about the types if they don't want to.
* Add some javadoc to the new interfaces.
* Make AttributesMap not extend map, and restore the get method name for Attributes.
* make ImmutableKeyValuePairs also have a parameterized key type
* 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>