* 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>
* Update the TraceState key validations to more closely match the w3c spec.
* rework method and variable names for more clarity
* Add some tests and fix a bug
* return an invalid span from the no-op tracer, rather than a random span, when there is no span context.
* add a test to verify that no context means an invalid span
* Add overloads for setParent(Context context).
* Fix the original version.
* Apply feedback.
* Update version for CorrelationContext.
* Add simple extra test for DefaultCorrelationContextManagerTest.
* Extension packages should not use "internal" API package
Add InternalApiProtectionTest which uses ArchUnit to enforce architectural constraints.
This change only verifies that classes in `extensions` packages do not use classes in `internal` package of API module.
Test was added into `opentelemetry-all` module because the latter depends on all other submodules
and therefore sees all classes in the project.
* Polish
* Polish
* Introduce an Attributes interface and have ImmutableAttributes and the AttributesMap implement it.
* make the attribute limiting a little clearer.
* tiny javadoc fix
* Rework to restore the Attributes class, and introduce a ReadableAttributes interface
* polish the javadoc a bit
* fix some broken javadoc
* revert example change; revert test name change
* javadoc de-escalation
* fix bad merge
* Convert Link and Event types to use the new immutable Attributes
update from the upstream branch
update from parent branch changes
* move the limiting of attributes to a custom consumer class
* prototype for class to replace Map<String, AttributeValue)
* safely copy the builder's data
* add the empty constant
* optimization for attributes with a single key/value
* Add an iterator/iterable and some simple tests
* fix animalsniffer complaint
* tests for de-duping and order-independent equality, plus removal of possibly unneeded access methods.
* clean up the sort&filter method a tad
* replace the iterator with a foreach method
* Make the Attributes parameterized by the value type.
* Add basic javadoc
* remove helper class; add a simple test for the builder; make the tests more robust
* Add a varargs method for creating an arbitrary number of key/value pairs.
* static import the check method, for consistency
* Refactor to have an interface and two implementations, with some shared logic.
* fix an accidental rename
* really fix it for real
* add a few more tests
* preserve the `setAttribute` names from existing Span API
* Replace the treemap sorting and filtering with a quicksort and post-filter.
* remove an unneeded list.
* switch to an abstract base class to remove some code duplication
* Updated docs based on feedback.
* Small change to use the builder for the empty implementations.
* add shortcut methods to get tracers and meters
* add shortcut methods to get tracers and meters
* add shortcut methods to get tracers and meters
* add shortcut methods to get tracers and meters
* added jaeger propogator and test
* address PR comments about logging and static var names
* added jaeger client for testing jaeger propagator
* added comment to explain why UTF-8 decoding is needed
* Initial def of string constants for semantic convention span attribute names
* Change to recommended name and update to latest specifications
* Changed constants to objects which enabled typed setting of span attributes
* Sync Javadoc with specifications document.
* Update to latest factory name
* Renaming to make usage clearer
* API improvements and cleanup based on PR comments
* Removed methods required by code reviews
* Made setter classes final
* Initial Propagators refactor.
* Add tests for the new propagators changes.
* Make the SDK compile/pass.
* Make the OT shim compile/pass.
* Make contrib components compile/pass.
* Improvement over Span/SpanContext handling in Context.
* Add Span.setParent(Context) overload.
* Do not provide default values for Span/SpanContext keys in Context.
* Improve the Context's active state handling.
* Rename DistributedContext to CorrelationContext.
* Improve names for correlationcontext's ContextUtils methods.
* Don't provide an automatic default for current CorrelationContext.
* Improve the client-server example after the recent changes.
* Adds CorrelationContext.Builder.setParent(Context) overload.
* s/be/become.
* Fix javadoc.
* No need to use diamond.
* Simply import withScopedContext().
* Fix the API/SDK build.
* Remove the builder from the Propagators interface.
* Fix name.
* Use Collections.emptyList() directly.
* Rename Propagators to ContextPropagators.
* Move context/ members in api/ to context_prop/
* Add check/tests for null scoped Contexts.
* Rename ContextUtils classes to better alternatives.
* Update the context* util classes.
* Make the code compile after the latest master merge.
* Cache the fields() in our default composite propagator.
* Remove the overloads of setParent(Context) for now.
* Use DefaultSpan for the tests instead of calling getTracerProvider()
* Fix the sdk testbed artifact build.
* Make the B3 propagator comply with the new propagator API.
* Simplify the HttpTraceContextTest tests.
* Simplify the ContextUtils* classes handling of default values.
* Minor nit.
* Update api/src/main/java/io/opentelemetry/OpenTelemetry.java
Co-Authored-By: Giovanni Liva <giovanni.liva@dynatrace.com>
* Annotate ContextPropagators with ThreadSafe instead of Immutable.
* Do not use the fully qualified ContextUtils identifier.
* Remove SpanContext support from TracingContextUtils.
* Rever to using non-defaulted key for TracingContextUtils.
* Revert the default keys for CorrelationsContextUtils.
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
* Initial relocation of ContextUtils classes.
Now they will live within the child `propagation` package,
with a prefix based on their cross-cutting concern, to be
referenced easily.
* More gradle cleanups, separate jmh and jmhreport config
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
* Remove the need to includ jmhreport
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
* Only projects with the plugin maven-publish will be published
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
* Switch to use pluginManagement, Use gradle plugin for jmh.
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
* Fix jmh report
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
* Use ' for the moment for plugin ids in main gradle
* test: add benchmarks for http trace context extract and inject
* test: add benchmarks for http trace context extract and inject
* docs: add docs
* style: apply google code style
* style: format jmh.gradle, use not deprecated archiveFileName
* test: add params for trace id and span id
* fix: fix merge conflicts
* feat: use HashMap move params to inner state
* feat: use same measurement params
* fix: apply google code style
* fix: extract span creation for more clear benchmark
* test: use vector of traceparents, increase iterations to 50k
* style: apply google code style
* feat: use vector of traceparents in inject benchmark
* Add counters to the batch recorder.
Also, allow non-monotonic batch recordings.
* remove the throws on the javadoc
* put the proper since tags on the new methods
* remove an import that seems only necessary for IDEA
* formatting
* Move unbind to the Bound to simplify usage
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
* Change names to be English friendly
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
* Introduce automatic module names into all libraries being built.
* Centralise manifest config of automatic module name into root build.gradle file.
* Adding empty new lines