Commit Graph

370 Commits

Author SHA1 Message Date
John Watson ee435201b5
Immutable Attributes and Labels (#1304)
* 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.
2020-06-08 17:16:39 -07:00
Bogdan Drutu afabbd1e06
Remove duplicate Result interfaces (#1312)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-05 14:37:50 -07:00
Shivkanya Andhare b68b994b6c
Fix:spelling mistakes (#1294)
* Fix:spelling mistakes

* Fix:spelling mistakes
2020-05-31 15:49:32 -07:00
Carlos Alberto Cortez dbf365c978
Do not inject invalid SpanContext instances. (#1285) 2020-05-29 08:57:31 -07:00
Bogdan Drutu 833c30af98
Do not allow adding attributes, links after startSpan. (#1266)
* Do not allow adding attributes, links after startSpan.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Add tests for edge cases

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-26 06:47:24 -07:00
shivkanya9146 ff4d055655
Fix:Spelling mistake (#1270) 2020-05-25 14:16:40 -07:00
Bogdan Drutu 84f5a3eab0
Add API for ValueObserver (#1265)
* Add API for ValueObserver

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Address feedback

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-22 06:32:06 -07:00
John Watson ccb99f1c4c
change the naming of the SPI provider classes to be less confusing and line up with the auto-instrumentation project (#1261) 2020-05-21 14:05:01 -07:00
Bogdan Drutu 33b33c17f9
Add more tests for the metrics API (#1251)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-20 06:30:24 -07:00
Bogdan Drutu 6d2a8a6f54
Remove check for non-negative values in ValueRecorder (#1247)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-19 16:02:18 -07:00
Bogdan Drutu 8a1a241efa
Rename Measure to ValueRecorder, fix comments and javadoc (#1243)
* Rename Measure to ValueRecorder, fix comments and javadoc

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Fix more legacy javadoc

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Address feedback

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-19 11:31:16 -07:00
John Bley 49f271f3a1
Correct spelling of key/file for the TraceProvider service lookup. (#1240)
* Correct spelling of key/file for the TraceProvider service lookup.

* More name fixing.

* Java Format.
2020-05-18 08:26:51 -07:00
Bogdan Drutu 317ccbc393
Add API for UpDownSumObservers (#1220)
* Add API for UpDownSumObservers

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Fix minor nits

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Fix more nits

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-15 12:07:12 -07:00
Bogdan Drutu 019c4dbe19
Add a Builder in the SynchronousInstrument (#1221)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-15 09:06:08 -07:00
Bogdan Drutu f9c054c3c5
Remove absolute property from measure (#1219)
* Remove absolute property from measure

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Fix tests

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-14 12:25:55 -07:00
Bogdan Drutu fcd627d717
Rename observers, cleanup comments (#1215)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-13 11:43:07 -07:00
Bogdan Drutu e67fe84c60
Add API for UpDownCounter (#1210)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-13 10:00:09 -07:00
Bogdan Drutu 5b625d2e1f
Avoid unnecessary public classes. (#1211)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-13 08:20:32 -07:00
Bogdan Drutu 5b31c5ae0c
Remove monotonic property from counters (#1208)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-12 16:43:47 -07:00
Bogdan Drutu 5dff1b9165
Remove unnecessary throws statements (#1205)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-12 10:54:16 -07:00
Bogdan Drutu 7aec1aee71
More minor cleanups in the code (#1204)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-12 10:00:51 -07:00
Bogdan Drutu 4d2f6cc91d
Cleanup names in metrics and ensure consistency with specs (#1202)
* Cleanup names in metrics and ensure consistency with specs

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Rename SyncInstrument to SynchronousInstrument

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update api/src/main/java/io/opentelemetry/metrics/SynchronousInstrument.java

Co-authored-by: John Watson <jkwatson@gmail.com>

Co-authored-by: John Watson <jkwatson@gmail.com>
2020-05-12 09:50:02 -07:00
Bogdan Drutu bcacf39a9c
Apply intelij inspect suggestions for Java code (#1196)
* Apply intelij inspect suggestions for Java code

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Fix comments.
2020-05-11 16:54:39 -07:00
Giovanni Liva cd041c9d30
Fix getTracerLower behavior (#1193)
* Fix getTracerLower behavior

* Add test for negative trace representation
2020-05-11 11:21:14 -07:00
Gregor Zeitlinger ebcd508a88
add shortcut methods to get tracers and meters (#1159)
* 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
2020-05-06 11:30:33 -07:00
Armin Ruech 19d7e03572
Fix typo in OpenTelemetry.getTracerProvider (#1179) 2020-05-06 08:48:41 -07:00
Trask Stalnaker 79d664fc10
Prevent casting to TraceProviderSdk (#1152)
* Prevent casting to TraceProviderSdk

* Fix javadoc

* Parameterize Obfuscated interface
2020-05-01 12:12:12 -07:00
Uladzislau Kiva 5aa00c57c3
Iterations benchmark (#1151)
* test: use iterations in benchmarks

* test: use iterations in benchmarks

* docs: added javadoc
2020-04-28 11:33:45 -07:00
Giovanni Liva 4bcfdb703f
Array values for span attributes (#807)
* [API] - Add Arrays for span attributes

* [SDK] - Add Arrays for span attributes

* [Exporters/Shim] - Add Arrays for span attributes

* add tests

* Adjust jaeger exporter to specification. Add tests.

* Fix checkstyle naming issue

* Add further tests.

* Align null value behavior of attributes with spec

* fix javadoc @since

* API must not crash on misusage of AttributeValue

* API - Remove Attribute ArrayValues from Span surface

* Immutable String array values for AttributeValue

* Immutable values for AttributeValue arrays

* ./gradlew goJF

* Implement ArrayAttribute

* Rebase and add tests

* Adapt RecordEventsReadableSpan
2020-04-21 11:08:24 -07:00
Bogdan Drutu 6a4fd2d46a
Remove labels keys from instruments (#1121)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-20 09:24:45 -07:00
Carlos Alberto Cortez 36661f1a06
Update the Jaeger benchmarks code. (#1118) 2020-04-15 18:40:43 -07:00
jarebudev a19b0075fb
Add jaeger propagator benchmarks (#1108) 2020-04-16 00:55:27 +02:00
Bogdan Drutu e11344c235
Fix HttpTraceContext propagator (#1102)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-11 16:31:01 -07:00
Carlos Alberto Cortez 68bac8f431
Move B3/Jaeger propagators to their own contrib artifact (#1098) 2020-04-10 18:03:09 +02:00
John Watson 73858ccf7b
Let the carrier be null on the inject methods, to support possible lambda usages (#1088) 2020-04-09 22:23:26 +02:00
John Watson 8b0fcfbc99
simple benchmarks for the default tracer APIs (#1090)
* simple benchmarks for the default tracer APIs
* do some painful gyrations to make the animalsniffer happy
2020-04-08 14:05:10 -07:00
John Watson 7d4576e7f7
Use a reentrant lock as the mutex for initializing/reading the global instance (#1071) 2020-04-03 21:59:49 +02:00
John Watson 5ceff22cc6
fix a typo in the SemanticAttributes (#1078) 2020-04-03 20:34:49 +02:00
jarebudev b14a2dd87d
added jaeger propagator and tests (#1046)
* 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
2020-04-02 08:27:36 -07:00
Bogdan Drutu 1f97c4bce0
Small fixes for #758 (#1057)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-03-30 21:33:19 -07:00
Kevin Brockhoff 46ee284b0a
Define constants for semantic convention attribute names (#758)
* 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
2020-03-30 15:41:17 -07:00
Carlos Alberto Cortez 690651b65a
Context propagation update (OTEP 66) (#720)
* 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>
2020-03-20 13:38:05 -07:00
John Watson 8453bcb14a
Remove LabelSet from the API altogether. (#1023)
* remove LabelSet from the API surface altogether

* rename bindInternal to bind
2020-03-16 16:07:18 -07:00
John Watson 29297249ab
remove LabelSet from the Instrument binding API (#1010) 2020-03-16 13:38:10 -07:00
John Watson e248ea7ad7
Remove LabelSet from Observer API (#1008)
* Remove the LabelSet parameter on the DoubleCounter non-bound usage.

* remove LabelSet from the Observer API
2020-03-13 09:33:34 -07:00
John Watson 4d2a9f2bde
remove LabelSet from the BatchRecorder API. (#1006)
also removes a few more usages of the LabelSet interface.
2020-03-13 08:41:04 -07:00
Carlos Alberto Cortez 0ec6cca453
Rename the Context methods returning Scope as withCurrentContextWith() (#976) 2020-03-12 12:55:15 -07:00
John Watson efc49522ac
Remove LabelSet from non-bound instrument usage (#1001)
* Remove the LabelSet parameter on the DoubleCounter non-bound usage.

* remove non-bound labelset measure recording method

* remove non-bound labelset LongMeasure recording method

* remove non-bound labelset LongCounter recording method

* tidy up an access level
2020-03-12 12:54:43 -07:00
Mike Goldsmith 577bab0032
move AttributeValue to common package (#1005) 2020-03-12 12:54:00 -07:00
Mike Goldsmith 438ea8d24a
Add B3 propagator (#979) 2020-03-12 16:53:24 +01:00