Commit Graph

695 Commits

Author SHA1 Message Date
John Watson 6dd3eac097
Remove the documentation about explicit exceptions thrown when TraceFlags are invalid. (#2945) 2021-02-26 09:58:48 -08:00
John Watson 1102efae1d
Update the docs on the TextMapPropagator to be closer to the specification. (#2931) 2021-02-24 13:06:57 -08:00
Bogdan Drutu bf5fa57df5
Move c-like comment to javadoc in TextMapPropagator (#2930)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-24 12:19:03 -08:00
Anuraag Agrawal 18df74eb19
Don't throw on null in propagator implementations. (#2904)
* Don't throw on null in propagator implementations.

* Baggage too
2021-02-24 09:28:16 -08:00
Anuraag Agrawal b393a587dd
Have AttributesMap extend HashMap instead of contain LinkedHashMap (#2906)
* Reduce HashMp allocations for AttributeMap.

* Finish

* Add comment on why wrapper is actually needed.
2021-02-24 09:24:25 -08:00
Anuraag Agrawal 0b973d9a3c
Defend against null in a few more places. (#2928) 2021-02-24 08:05:24 -08:00
Bogdan Drutu becded2181
Remove throws statements from the API until we decide how to document it (#2912)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-22 18:30:09 -08:00
Bogdan Drutu 9e1c76b324
Do not allow null description in the StatusData (#2896)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-22 15:31:45 -08:00
Anuraag Agrawal 77e8f71480
Reduce usage of errorprone annotations to MustBeClosed. (#2898) 2021-02-20 11:43:59 -08:00
Bogdan Drutu 55e96b3e87
Do not throw exception if byte array too short for fromBytes (#2868)
* Do not throw exception if byte array too short for fromBytes

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

* Update api/all/src/test/java/io/opentelemetry/api/trace/TraceIdTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-02-18 11:58:31 +09:00
Bogdan Drutu 49f4bd016e
Remove package protected unused class (#2870)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-18 11:35:31 +09:00
Bogdan Drutu 617162073a
Remove Nonnull annotations, we use package default Nonnull (#2871)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-18 11:35:21 +09:00
Anuraag Agrawal 8f787275fc
[Breaking Change] Make TraceId.getTraceIdRandomPart private (#2839)
* Move traceidrandom

* Make BigEndianEncoding public-internal to use for Android compatibility.

* Rename BigEndianEncoding to sound less useful if accidentally imported.
2021-02-17 16:59:54 -08:00
John Watson bd6a329211
Obfuscate the GlobalOpenTelemetry instance. (#2829)
* Obfuscate the GlobalOpenTelemetry instance.
This is to prevent people from casting to the SDK implementation.
Resolves #2788

* Add some more tests for the global obfuscation
2021-02-18 08:59:56 +09:00
Bogdan Drutu 509a2eee01
Mark GlobalMetricsProvider as final (#2852)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 12:43:03 -08:00
Anuraag Agrawal fa15e8b2d0
Remove BaggageBuilder.setParent / setNoParent (#2838) 2021-02-17 09:57:56 -08:00
Anuraag Agrawal 4623334c7c
Move Getter/Setter to top level (#2840) 2021-02-17 09:46:56 -08:00
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