Commit Graph

840 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
Bogdan Drutu 643d25d244
Avoid mockito magic for span processors test, test with empty configmap (#1309)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-04 11:20:34 -07:00
Bogdan Drutu 37b64df70b
Test flush method for multispan exporter (#1308)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-04 09:32:12 -07:00
Bogdan Drutu 25c9c2d4ac
Start 0.6.0 development cycle (#1306)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-04 08:31:53 -07:00
Giovanni Liva 4808387afb
Cleanup and additional tests for ConfigBuilder (#1296)
* Cleanup and tests for ConfigBuilder

* Add more tests

* Document mockito extension

* Reformat after rebase
2020-06-02 11:33:21 -07:00
Bogdan Drutu a1bae308db
Add implementation for value observers (#1300)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-01 21:11:02 -07:00
Bogdan Drutu b633bf9d21
Refactor batchers to make it more explicit what is used. (#1299)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-01 15:08:35 -07:00
Bogdan Drutu f04ddd8f2a
Cleanup metrics SDK. Rename variables, allow different aggregation for async (#1298)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-01 13:02:18 -07:00
Rashmi 322b661e37
Support env vars for TraceConfig initialization (#1255) 2020-06-01 20:51:13 +02:00
Anuraag Agrawal 9c56905bf6
Directly fetch AWS resource metadata without depending on heavyweight… (#1289)
* Directly fetch AWS resource metadata without depending on heavyweight AWS SDK and allow extension for non-EC2 resources like ECS.

* Set HOST_NAME too

* Cleanups

* Not public

* Update test
2020-06-01 11:32:44 -07:00
Giovanni Liva 7798fb3c10
Update Zipkin readme (#1297) 2020-06-01 16:18:36 +02:00
Shivkanya Andhare b68b994b6c
Fix:spelling mistakes (#1294)
* Fix:spelling mistakes

* Fix:spelling mistakes
2020-05-31 15:49:32 -07:00
Shivkanya Andhare 6ca117d6f0
Fix minor typo (#1295) 2020-05-31 15:48:36 -07:00
Brandon Kimberly a392120914
Renamed SpanDataImpl to TestSpanData and moved to subdir test (#1291) (#1293) 2020-05-30 14:47:25 -07:00
Nikita Salnikov-Tarnovski 7aca0d9192
Apply bom imports only if needed (#1281) 2020-05-29 12:35:15 -07:00
Carlos Alberto Cortez dbf365c978
Do not inject invalid SpanContext instances. (#1285) 2020-05-29 08:57:31 -07:00
Anuraag Agrawal a9c7c7237d
Update config / deps to allow building on Java 14. (#1287)
* Update config / deps to allow building on Java 14.

* Finish comment
2020-05-29 08:55:38 -07:00
Paulo Janotti 7fb0d4da98
Remove SpanID from sampling parameters (#1286)
* Remove SpanID from sampling parameters

* Generate SpanId only for sampled spans

* Revert "Generate SpanId only for sampled spans"

This reverts commit 5b51eaed88.
2020-05-29 08:52:46 -07:00
Bogdan Drutu 554b5559c2
Small fix to publish bom artifact (#1282)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-29 07:56:53 -07:00
Giovanni Liva b30790c97e
Configuration for Disruptor and Zipkin (#1254)
* add configuration for Disruptor and Zipkin

* Fix checkstyle violation

* Address feedback

* Update Javadoc

* Add missing config test for Zipkin Exporter
2020-05-28 07:15:54 -07:00
Christian Neumüller f137182fe9
Add public Samplers.emptyDecision(boolean) and decision(boolean, Map). (#1256)
* Add public Samplers.emptyDecision(boolean).

This is meant for use by custom Sampler implementations. As of now, you have to use an anonymous inner class or otherwise derive a new class because there is no publicly accessible implementation of Decision.

* Fix build, add unit test.

* Add Samplers.decision(boolean, Map).

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Copy decision attributes, fix comment.

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-27 21:01:08 -07:00
ET f8c7e0d3c3
Fix examples to use [Batch|Simple]SpanProcessor (#1280)
https://github.com/open-telemetry/opentelemetry-java/pull/1241 changed the names of
[Batch|Simple]SpansProcessor to [Batch|Simple]SpanProcessor but did not change the examples to
match. This fixes the examples so that they now build correctly.
2020-05-27 20:35:30 +02:00
John Watson 192137e775
Convert the exportable Event to an interface (#1277)
* change Event to an interface with an impl to match

* make TimedEvent implement the Event interface

* don't make copies of already immutable event data

* copy the wrapped event, so as not to hold to user's data
2020-05-26 13:55:33 -07:00
Sameer Kulkarni 2577fc71a0
Separating the B3 logic for Single and Multiple headers (#1235)
* Separating the B3 logic for Single and Multiple headers

* Refactored to static variables for Single/Multi Headers

* Fixes review comments - javadoc and ctor changes

* exposing B3Propagator via static getters

* Dummy commit to test the build

* Converted the abstract class into interface for injector/extractor
2020-05-26 10:26:05 -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
Anuraag Agrawal 561c81e231
Inline generation of XRay trace IDs to remove heavyweight SDK depende… (#1274)
* Inline generation of XRay trace IDs to remove heavyweight SDK dependency.

* Revert unnecessary

* Squash
2020-05-26 06:46:58 -07:00
Pavol Loffay f54ae3e4f0
Fix Jaeger remote sampler flaky test (#1276)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2020-05-26 15:06:59 +02:00
Anuraag Agrawal adc02dad4f
Expose RandomIdsGenerator so it can be delegated to. (#1268)
* Expose RandomIdsGenerator for delegation and allow customizing Random.

* Unit tests

* checkNotNull

* More interesting test

* format

* Checkstyle

* requireNonNull

* Revert RandomSupplier

* Format and fuzz
2020-05-25 20:25:24 -07:00
Bogdan Drutu 791d8d5d33
Update InstrumentType to reflect the current types (#1267)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-25 14:56:17 -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
Trask Stalnaker 3d002984f2
Remove verbose logging (#1263)
Making it consistent with HttpTraceContext logging behavior.
2020-05-21 14:05:39 -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
John Watson 17cb2c7407
Add a few missing unit tests (#1264)
* add tests for configuration of the SSP

* add tests for the EnvVarResource
2020-05-21 14:02:37 -07:00
Bogdan Drutu aa77435a9e
Copy map attributes always to avoid unexpected changes (#1259)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-21 12:26:34 -07:00
Bogdan Drutu 5cf9f5a625
Refactor the logic to get immutable attributes, links and events (#1260)
* Refactor the logic to get immutable attributes, links and events

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

* Remove support for null links, never happens

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-21 07:52:04 -07:00
John Watson b85e7365b3
Add tests to verify immutability of the SpanData representation (#1257)
* Add tests to verify immutability of the SpanData representation, and remove an extra wrapping of links.

* Add an additional mutability test, and fix a bug with a span that hasn't ended.

* fix a tiny typo
2020-05-20 15:35:55 -07:00
John Watson 5fdc3d4848
Return a wrapped span for SpanData so only the mutable data is copied. (#1231)
* Return a wrapped span so only the mutable data is copied.

* Add a benchmark for the span pipeline

* tweak the benchmark a bit

* use unmodifiable wrappers around the collections in the wrapper.
2020-05-20 12:26:17 -07:00
Bogdan Drutu 8257dbb729
Require coverage 95% for api and sdk (#1252)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-20 11:40:45 -07:00
Bogdan Drutu c9fe822c13
Cleanup Samplers (#1233)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-20 10:02:35 -07:00
Uladzislau Kiva 0f924a4f71
fix: force maven publish to include version for api conf (#1250) 2020-05-20 07:48:17 -07:00
Giovanni Liva 590be57734
Update javadoc (#1238)
* Update javadoc

* typos

* Formatting

* Update links in javadoc

* Polish documentation
2020-05-20 07:14:11 -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 b954c7cda1
Remove unused code in metrics sdk (#1248)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-19 16:01:35 -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 Watson 586793f405
Update the examples for the latest changes (#1242)
* fix the examples for the latest

* pick up formatting changes
2020-05-18 15:29:28 -07:00
Bogdan Drutu a71f905672
Rename [Batch|Simple]SpansProcessor to [Batch|Simple]SpanProcessor (#1241)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-18 10:02:50 -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