Commit Graph

678 Commits

Author SHA1 Message Date
Anuraag Agrawal fa8bb33646
[Breaking Change] Rename API getDefault to noop! (#2842)
* Noop!

* errorprone
2021-02-17 09:18:22 -08:00
John Watson f83c21638a
[Breaking Change] Rename TraceStateBuilder.set() to put() (#2830)
Provisionally resolves #2746
2021-02-17 08:16:24 -08:00
John Watson 20a1601089
[Breaking Change] Rename getEmpty() to empty() (#2831) 2021-02-17 08:15:23 -08:00
Anuraag Agrawal 5d7f221058
Reduce some NPE in API. (#2835)
* Reduce some NPE in API.

* Drift
2021-02-17 13:55:36 +09:00
John Watson 920f79d151
clean up the javadoc and make examples pasteable (#2824)
* clean up the javadoc and make examples pastable
resolves #2817

* formatting
2021-02-17 12:31:08 +09:00
Anuraag Agrawal 900c35ed8c
Migrate remaining gradle scripts to kotlin (#2820)
* Migrate remaining gradle scripts to kotlin

* Finish more
2021-02-16 14:11:07 -08:00
John Watson 762aca003b
Add documentation about invalid SpanContext inputs. (#2803)
Resolves #2751
2021-02-11 17:53:38 -08:00
Ken Finnigan 339bbb8282
Fix error message formatting on GlobalOpenTelemetry.set() (#2797) 2021-02-10 12:07:12 -08:00
Anuraag Agrawal 817ce5726a
Make StrictContextStorage closeable. (#2776)
* Make StrictContextStorage closeable.

* More javadoc
2021-02-10 10:42:30 -08:00
Anuraag Agrawal 41c05edc58
Don't NPE on null keys when getting from baggage, tracestate, attribu… (#2778)
* Don't NPE on null keys when getting from baggage, tracestate, attributes.

* Restore NPE for now for context
2021-02-10 10:20:32 -08:00
Anuraag Agrawal 170cb4533a
Add VERSIONING document and make sure all internal packages have doc … (#2775)
* Add VERSIONING document and make sure all internal packages have doc about internalness.

* Make internal package caveat even stronger

* Users must not use internal package.
2021-02-10 09:22:44 -08:00
Bogdan Drutu 8e9ff790d0
Improve ImmutableKeyValuePairs dedup, do everything inplace (#2787)
This change will reduce the number of allocations by 2 for the case where all entries are valid,
and by 1 when entries are filtered in the dedup.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-09 19:39:34 -08:00
Bogdan Drutu 985eff9360
Add benchmark for attributes (#2781)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-09 13:06:19 -08:00
Bogdan Drutu 3c150cc4ad
Move sort and dedup to constructor of ImmutableKeyValuePairs (#2779)
This will allow us to store internally an array and size or other combination that makes sense for performance.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-09 11:06:49 -08:00
Bogdan Drutu 0fecfa71c4
Remove comment about internal backwards compatibility guarantees (#2757)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-09 16:16:20 +09:00
Anuraag Agrawal 0385f6d79b
Make StrictContextStorage package-private (#2772) 2021-02-08 19:03:35 -08:00
John Watson 8898e4c441
save the already known state of SpanContext validity (#2769) 2021-02-08 18:26:02 -08:00
Bogdan Drutu 0bd4ddc9a0
Remove unnecessary private class from API (#2760)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 18:06:18 -08:00
Bogdan Drutu dbc3505e42
Remove filterNullValues property from sortAndFilter (#2768)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 17:42:08 -08:00
Bogdan Drutu 28299f1d9e
Null labels means label is not present (#2766)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 16:14:22 -08:00
Bogdan Drutu 3b7080de2c
ArrayBasedTraceStateBuilder:Remove obsolete comment, remove unnecessary null check (#2763)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 15:04:59 -08:00
Bogdan Drutu 9f01d849be
Small javadoc fix for SpanId.fromLong (#2761)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 14:42:59 -08:00
Bogdan Drutu ff0c298a18
Do not throw NPE if span/trace ids are null in isValid (#2754)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 14:39:13 -08:00
Bogdan Drutu 50baa920d7
Fix comments after revert PR did actually more than just revert (#2755)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 12:37:17 -08:00
John Watson d34b66b5cb
Validate the span id and trace id when creating the SpanContext (#2728)
And, remove that extra validation from propagators.
2021-02-08 08:03:33 -08:00
Anuraag Agrawal 522953bd8f
Restore Trace/SpanId.fromBytes (#2750)
This reverts commit d6fea3a70a.
2021-02-08 07:42:49 -08:00
John Watson eb529cb26d
Revert the SpanContext trace/span id accessor methods. (#2749) 2021-02-08 09:51:49 +09:00
Bogdan Drutu d9c4602f8c
Remove one level of indirection, and checks for bytes ids (#2733)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-06 17:47:29 -08:00
Bogdan Drutu bef4707a9e
Remove unused code in BigendianEncoding (#2732)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-06 12:07:18 -08:00
Bogdan Drutu 531d66f943
Remove helper methods for as longs (#2725)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 21:20:58 -08:00
Bogdan Drutu e187c18112
Consistent name for Trace/Span ids getters with the specification (#2721)
See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#retrieving-the-traceid-and-spanid

Not breaking change since methods were just renamed anyway.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:33:32 -08:00
Bogdan Drutu 51d176ffdf
Remove helper methods asBytes from Trace/Span Id (#2726)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:31:10 -08:00
Bogdan Drutu d6fea3a70a
Remove helper methods fromBytes from Trace/Span Id (#2727)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:29:51 -08:00
Bogdan Drutu 7952823322
Mark AbstractWeakConcurrentMap as package protected, no usage (#2731)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:19:28 -08:00
Bogdan Drutu 2c2f0b9280
Add a benchmark that test extract, create client span, inject (#2720)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 14:43:25 -08:00
Bogdan Drutu a18376a942
Make TraceFlags interface to allow agent to re-implement it (#2716)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 10:56:47 -08:00
Bogdan Drutu 6c30f411f3
Change TraceFlags to be a class, expose all helpers of the class itself. (#2709)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 09:06:19 -08:00
Bogdan Drutu b42c27fe81
Better document exceptions that could happen when parsing Span/Trace ids (#2714)
* Better document exceptions that could happen

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

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

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

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-02-05 08:26:15 -08:00
Anuraag Agrawal faa8bf867a
Replace DefaultOpenTelemetry builder / class exposure with a factory … (#2704)
* Replace DefaultOpenTelemetry builder / class exposure with a factory for configuring propagation only.

* newp

* Cleanup
2021-02-05 13:13:12 +09:00
Bogdan Drutu 9bc7a71b20
Remove Memoized for byte arrays. Byte-arrays are not immutable (#2712)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-04 14:22:06 -08:00
Bogdan Drutu 9d8af6f236
Cleanup javadoc in SpanContext (#2711)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-04 14:20:01 -08:00
Anuraag Agrawal 6e89f11041
Return Tracer from DefaultTracer.getInstance (#2705)
* Return Tracer from DefaultTracer.getInstance

* Update api/all/src/main/java/io/opentelemetry/api/trace/DefaultTracer.java

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
2021-02-04 08:07:05 -08:00
Bogdan Drutu 77d993d653
[BREAKING CHANGE] Cleanup TraceId/SpanId classes. Ensure consistency. (#2696)
Summary of changes:
* getHexLength renamed to getLength
* bytesFromHex/bytesToHex renamed to asBytes/fromBytes.
* bytesFromHex/bytesToHex renamed to asLongHigh/asLongLow
* Update javadoc.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-04 07:38:25 -08:00
Bogdan Drutu 0b250c1c91
Cleanup usages of TraceState and TraceFalgs (#2697)
* Avoid calling TraceState.builder().build() and replace it with TraceState.getDefault();
* Avoid storing TraceFalgs.getDefault() and TraceFalgs.getSampler() and use them directly;

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 18:39:52 -08:00
Bogdan Drutu 702e0ae409
Implement ImmutableKeyValuePairs to avoid unnecessary autovalue (#2700)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 18:39:38 -08:00
Bogdan Drutu 88e760d01c
[BREAKING CHANGE] Remove AsHexString suffix from ids getters. (#2684)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 10:40:43 -08:00
Bogdan Drutu d71db8cbea
[BREAKING CHANGE] Rename getEntryMetadata to getMetadata (#2688)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 09:23:48 -08:00
Bogdan Drutu 88bbdc86d1
Extract foreach implementation in the super class (#2690)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 09:20:48 -08:00
Bogdan Drutu 009e1c8054
Mark sortAndFilter methods as protected, reduce public API (#2689)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 09:12:50 -08:00
Bogdan Drutu 5cb09fbb73
Change Baggage.forEach to map other forEach methods, same generics asMap (#2674)
* Removes one custom interface and uses BiConsumer as all the other places.
* Builder no longer needs to create new objects from parent and can reshare them.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 08:51:52 -08:00