Commit Graph

124 Commits

Author SHA1 Message Date
jack-berg 59a6061dc5
Deprecate InstrumentationLibraryInfo (#4256)
* Deprecate InstrumentationLibraryInfo

* API diff
2022-03-14 14:45:10 -05:00
Anuraag Agrawal 5fb1189b98
Add int overload for equalTo attribute assertion (#4249) 2022-03-09 08:23:34 +09:00
Anuraag Agrawal 242f509dd1
Add ability to do loose attribute matching while checking all keys. (#4173)
* Add ability to do loose attribute matching while checking all keys.

* equalTo

* Support absent keys
2022-02-22 12:15:17 +09:00
jack-berg cde99eb77d
Add InMemoryLogExporter (#3757)
* Add InMemoryLogExporter

* Use synchronized list in in memory exporters

* merge conflict

* Use ConcurrentLinkedQueue
2021-10-21 15:08:52 +09:00
Anuraag Agrawal 3085c58073
Avoid zipSatisfy (#3705) 2021-10-07 08:11:28 -07:00
Anuraag Agrawal b311d50d03
Fix some nullness. (#3647)
* Fix some nullness.

* Log
2021-09-22 09:00:57 -07:00
jack-berg 58c16a9133
Add missing readmes and missing javadoc links (#3500) 2021-08-16 12:36:54 -07:00
Anuraag Agrawal ca8a12ff01
Add AttributesAssert.containsKey (#3433) 2021-08-03 12:51:49 -07:00
Anuraag Agrawal 2d9a949c70
Add Iterable versions of hasTraces / Spans (#3429) 2021-08-03 10:32:36 -07:00
Trask Stalnaker 60c3c5ca0c
Format build.gradle.kts files (#3427) 2021-07-29 13:21:38 +09:00
Anuraag Agrawal d4bbaf405d
Add containsEntry overload that accepts int (#3412) 2021-07-21 13:41:59 +09:00
Anuraag Agrawal 8163b9fc00
Add assertion for exception (#3409) 2021-07-20 08:49:40 +09:00
Anuraag Agrawal 3d0485364b
Add hasNoParent assertion (#3406) 2021-07-15 14:09:25 +09:00
Anuraag Agrawal 669bf0b42b
Add TraceAssert.getSpan (#3386)
* Add TraceAssert.getSpan

* Fix and comment
2021-07-09 07:45:29 -07:00
Anuraag Agrawal f90040579e
Allow users to access the default Clock and TestClock (#3363)
* Allow users to access the default Clock and TestClock

* Update TestClock API

* Doc

* Fix

* html

* Less newlines

* Update sdk/common/src/main/java/io/opentelemetry/sdk/common/Clock.java

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

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-07-09 11:26:55 +09:00
Anuraag Agrawal d7e8651767
Add vararg hasEvents assertion (#3377)
* Add vararg hasEvents assertion

* Test
2021-07-09 10:01:49 +09:00
Anuraag Agrawal b5d202a08c
Add hasAttributes which takes a list of entries. (#3378) 2021-07-09 08:06:50 +09:00
Anuraag Agrawal ce9c8854c7
Extract publishing and animalsniffer plugins. (#3334) 2021-06-22 08:23:16 +09:00
Anuraag Agrawal 7f544416e4
Define an extension for otel-specific configuration of Java. (#3317) 2021-06-17 15:54:25 +09:00
Anuraag Agrawal b9ca09b6c1
Extract java conventions plugin. (#3316) 2021-06-15 12:29:47 -07:00
John Watson 5b4763321e
Implement handling the OTEL_SERVICE_NAME env var. (#3253)
* Implement handling the OTEL_SERVICE_NAME env var.

* Update to use the semconv module and attributes testing helpers.

* add unit tests for testing API additions
2021-05-27 09:55:26 -07:00
John Watson 9a330d03e7
Make the test extensions defensively reset the GlobalOpenTelemetry instance before setting. (#3110) 2021-04-07 09:12:41 +09:00
John Watson aac9284f83
Add a new module for extensions to the tracing APIs. (#2962)
* Add a new module for extensions to the tracing APIs.
Includes one simple possible example.

* formatting

* rename and add javadoc

* Clean up & simplify based on feedback

* rename the module to just incubator

* Move to a package named more like the core api trace package.

* repackage to match the module
2021-03-17 18:53:38 -07:00
Anuraag Agrawal 1ec484e2d6
Add event assertion, full attributes assertion, and fuzzy attribute value assertion. (#2927) 2021-02-24 08:02:08 -08:00
Bogdan Drutu 013643c707
Add package-info for all packages (#2902)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-21 10:44:00 -08:00
Bogdan Drutu 7c038e00e9
Mark classes final, or hide ctor for testing classes (#2847)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 15:18:46 -08:00
Bogdan Drutu a633d1ee87
[Breaking Change] Remove metrics exporter from stable testing package (#2857)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 12:29:05 -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
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 0385f6d79b
Make StrictContextStorage package-private (#2772) 2021-02-08 19:03:35 -08:00
Bogdan Drutu dbfd07faf8
[BREAKING CHANGE] Remove not very used method from SpanData (#2722)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:34:54 -08:00
Bogdan Drutu 07b5ebe868
[BREAKING CHANGE] Remove not very used method from SpanData (#2723)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:34:17 -08:00
Bogdan Drutu d932baa919
Remove trivial usage of fromLong[s] methods (#2730)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:28:00 -08:00
Bogdan Drutu 19c002471e
Move Span.Kind to the upper level as SpanKind (#2646)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-02 12:27:54 -08:00
Bogdan Drutu 301a29d7a3
Move labels outside of the stable package (#2647)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-02 10:24:06 -08:00
Bogdan Drutu 527b5f4549
Expose the SpanContext to the SpanData (#2660)
This helps exporter to have access directly to bytes, hex or any other format we will expose for the ids in the SpanContext.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-02 08:54:26 -08:00
John Watson d16e51f798
Remove the remaining deprecated code from the project. (#2612) 2021-01-29 19:26:42 -08:00
Anuraag Agrawal 1a56b8b0d8
Migrate api / sdk projects to build.gradle.kts (#2609) 2021-01-29 10:10:40 -08:00
Anuraag Agrawal 32a63fb8e3
Migrate to using gradle platform to manage dependency versions instea… (#2586)
* Migrate to using gradle platform to manage dependency versions instead of global variables.

* Remove unused and fix test

* Revert test yolo

* Workaround test ordering issue by just merging them

* Spot
2021-01-27 13:54:58 +09:00
Anuraag Agrawal 58bcf7fe88
Deprecate tracermanagement and SDK global access (#2547)
* Deprecate SdkTracerManagement

* Deprecate global SDK

* Deprecate more

* Fix

* Cleanup

* Fix

* Handle test order random

* Collector removed queued_retry
2021-01-21 14:39:32 +09:00
Anuraag Agrawal b4218426ee
Prevent setting global OpenTelemetry twice. (#2548)
* Prevent setting global OpenTelemetry twice.

* Unneessary volatile

* Separate testing class

* Cleanup

* Delete

* Update api/all/src/main/java/io/opentelemetry/api/GlobalOpenTelemetry.java

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

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-01-21 13:55:46 +09:00
Bogdan Drutu cbcec6b359
Rename Point to PointData to suggest that it represents data reprezentation (#2519)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-14 13:05:40 +09:00
Bogdan Drutu ca661b8c40
Avoid using inner classes in SpanData (#2495)
* Avoid using inner classes in SpanData

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

* Javadoc cleanups

* Remove non-existent type param

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-01-12 19:12:00 -08:00
Bogdan Drutu 61eafc62eb
Avoid using inner classes in MetricData (#2493)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-13 11:31:24 +09:00
Anuraag Agrawal fe78126aed
Use logunit instead of tedious jul handler modifications for testing (#2425) 2021-01-06 09:30:35 +09:00
Anuraag Agrawal 24ef29efea
Add SimpleSpanProcessor.create and deprecate SimpleSpanProcessorBuilder (#2374)
* Deprecate SimpleSpanProcessorBuilder

* Null test
2020-12-23 12:31:02 +09:00
Anuraag Agrawal 68b939faab
Remove most addspanprocessor mutator invocations. (#2373)
* Remove more addSpanProcessor mutations

* Merge

* Cleanup
2020-12-22 11:28:19 +09:00
Anuraag Agrawal 70f665992e
Migrate assertThrows -> assertThatThrownBy (#2375) 2020-12-21 08:57:33 -08:00
Anuraag Agrawal 94422d9dc0
Remove dependency on metrics from sdk:all (#2356)
* Remove dependency on metrics from sdk:all

* Update sdk/all/build.gradle

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

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
2020-12-18 08:16:04 -08:00
Anuraag Agrawal 6954d1f624
Use normal filesystem-based Gradle paths. (#2332)
* Use normal filesystem-based Gradle paths.

* Update workflow by making agnostic to jacoco project name

* More merge
2020-12-18 12:07:33 +09:00
dengliming 718f512701
Make MetricExporter shutdown method returns CompletableResultCode. (#2321) 2020-12-16 09:11:50 -08:00
Anuraag Agrawal 8a369e3695
Make public src/main classes final where possible. (#2309)
* Make public src/main classes final where possible.

* methods

* Spot
2020-12-16 13:13:04 +09:00
Bogdan Drutu 25bf879df7
Split global functionality into a separate class (#2233)
This ensure clear separation of functionality. This PR does not change any functionality, it just restructures the code to separate global functionality from
the Default implementation. Also helps to ensure that Global initialization does not happen by mistake when working only with the default implementation.

Also it helps with methods like `OpenTelemetry.get()` and `OpenTelemetry.set()` to understand they are interacting with global instance

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-15 10:27:35 -08:00
Anuraag Agrawal 91dc119181
Move Sdk to be prefix of implementation classes instead of suffix/midfix. (#2292) 2020-12-14 11:59:28 -08:00
Bogdan Drutu d4bddd1fdf
Change MetricData to be consistent with protos, move creation to the Aggregation (#2274)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-11 11:04:12 -08:00
Bogdan Drutu ae63b9fbe7
Update types to reflect the names in proto (#2243)
* Update types to reflect the names in proto

NON_MONOTONIC_SUM will be soon merged with SUM and offer the "isMonotonic" as a property.

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

* Update names to follow, type + aggregation pattern

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-09 13:13:32 -08:00
Anuraag Agrawal 469900eb34
Add a system property that can enable strict context checking for staging environments. (#2195) 2020-12-07 12:38:27 +09:00
Anuraag Agrawal 8697de9afa
Detect GC leaks of scopes in StrictContextStorage. (#2164)
* Detect GC leaks of scopes in StrictContextStorage.

* More

* Finish

* Force GC more aggressively

* Cleanup

* Vendor code directly

* Copy test too

* Try waiting more

* ep

* oops

* Remove from build.gradle

* Drift

* Log on multiple

* Cleaner ourselves.

* EP

* Move into if

* Revert accidental
2020-12-04 13:04:27 +09:00
Anuraag Agrawal 4762c6a25d
Remove ReadableAttributes (#2187)
* Remove ReadableAttributes

* Don't rewrite history

* Drift
2020-12-03 11:26:24 -08:00
Anuraag Agrawal ca3714053f
Replace SpanData.hasRemoteParent/getParentSpanId with getParentSpanContext (#2146)
* Remove SpanData.hasRemoteParent

* Replace parentSpanId with parentSpanContext

* Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/RecordEventsReadableSpan.java

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

* Keep parentId

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
2020-12-01 09:50:11 -08:00
Christian Neumüller bbe8702257
Rename HttpTraceContext to W3CTraceContextPropagator. (#2116)
* Rename HttpTraceContext to W3CTraceContextPropagator.

* Add javadoc.
2020-11-25 10:27:07 +09:00
Anuraag Agrawal ac672e56bf
Update dependencies (#2115) 2020-11-21 09:39:27 -08:00
Anuraag Agrawal 0e013e5c73
Hide default context propagators implementation behind interface. (#2089)
* Hide default context propagators implementation behind interface.

* Deprecate

* Revamp
2020-11-20 10:58:34 +09:00
Anuraag Agrawal 9d17c6619a
Add assertj helpers for asserting traces and expose from the junit5 h… (#2051)
* Add assertj helpers for asserting traces and expose from the junit5 helper.

* Style and stability of map

* Revert rename, any order comes in future.

* Add coverage for protected method implementations.

* Test hasTraceId

* Check hasTraceId failure too.
2020-11-12 09:06:00 +09:00
Anuraag Agrawal cdc725c3c3
Add AssertJ custom assertions for SpanData and ReadableAttributes. (#2035)
* Add AssertJ custom assertions for SpanData and ReadableAttributes.

* Simpler?

* Cleanup
2020-11-09 08:36:27 -08:00
Anuraag Agrawal 570924b4b7
Fix post-merge conflict in OpenTelemetryRule. (#2014) 2020-11-04 19:05:43 -08:00
Anuraag Agrawal f01456bebd
Add a junit4 rule for OTel testing. (#1996)
* Add a junit4 rule for OTel testing.

* Docs to 4

* A bit more 4

* Volatile just in case
2020-11-05 11:37:51 +09:00
Bogdan Drutu 18d45beb4f
Remove inmemory exporter artifact, move to sdk-testing (#1991)
* Remove unused class InMemoryTracing, junit5 helper is enough

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

* Remove inmemory exporter artifact, move to sdk-tracing

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-04 08:18:01 -08:00
Bogdan Drutu 6dfbc14e19
Rename package name for exporters to singular exporter (#1992)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-03 16:27:57 -08:00
Anuraag Agrawal db93a841ed
Rename exporter artifacts to singular (#1984)
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-03 14:24:00 -08:00
Bogdan Drutu 2046ec050e
Move testing-internal artifact to sdk-testing (#1987)
* Move testing-internal artifact to sdk-testing

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

* Fix missed usage of TestSpanData

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-03 13:54:43 -08:00
Anuraag Agrawal 95fa0eae4d
Add a StrictContextStorage which keeps track of scope open / close to… (#1938)
* Add a StrictContextStorage which keeps track of scope open / close to throw errors when it's incorrect for tests.

* Separate out SettableContextStorageProvider

* Check noop too

* Update sdk/testing/src/main/java/io/opentelemetry/sdk/testing/context/StrictContextStorage.java

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
2020-11-03 10:11:37 +09:00
Anuraag Agrawal a506b3a695
Add a JUnit5 extension for setting up OpenTelemetry in a test. (#1880)
* Add a JUnit5 extension for setting up OpenTelemetry in a test.

* git add

* Split API and management accessors.

* Update sdk/testing/src/main/java/io/opentelemetry/sdk/testing/junit5/OpenTelemetryExtension.java

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
2020-10-28 09:01:20 +09:00