Commit Graph

115 Commits

Author SHA1 Message Date
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
Anuraag Agrawal b68fc82b89
Make classes that can be shutdown Closeable (#2285)
* Make classes that can be shutdown Closeable

* Glad not my password

* Drift
2021-01-13 13:57:20 +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 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
Anuraag Agrawal 9bce6f17fe
Manually structure output of log exporter instead of delegating to unstable toString (#2293) 2020-12-17 14:14:05 +09:00
Anuraag Agrawal 17fa4e9c97
Only apply java-library to projects and configure reactively. (#2319)
* Use java-library

* Only apply java-library to projects and configure reactively.

* Consistency

* Cleanup
2020-12-17 09:11:44 +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 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 0da7eeca66
Remove Java 8 animalsniffer because we use -release flag (#2153) 2020-11-30 08:53:41 -08:00
Anuraag Agrawal 96c7f404b4
Don't repeat Java 8 support among all the subproject READMEs and at top level, clarify that published artifacts are Java 8, but building requires additional instructions. (#2124) 2020-11-24 09:04:40 -08:00
Anuraag Agrawal 9c4c52dfee
Switch animal sniffer signature to gummy bears. (#2015) 2020-11-06 08:56:26 +09: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
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 7ebbe7979d
Move API packages to .api. package (#1892)
* Move API packages to .api. package

* Cleanup
2020-10-28 08:39:41 +09:00
Anuraag Agrawal e2b5245d73
Rename newBuilder to builder for consistency. (#1790) 2020-10-13 13:17:06 -07:00
Anuraag Agrawal d361dfa2f9
Remove SpanData implementation classes from public API. (#1761) 2020-10-06 10:17:11 -07:00
Bogdan Drutu eb4a18febc
Remove Status object from API, keep StatusCanonicalCode (#1741)
* Remove Status object from API, keep StatusCanonicalCode

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

* Respond to comments, change more old usages

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

* Fix build, run gojf

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-05 11:33:40 +09:00
Ioannis Mavroukakis 42cdff446c
subsume methods from AttributesKeys to AttributeKey (#1743)
* subsume methods from AttributesKeys to AttributeKey

* remove missed instance of AttributesKeys

* make javadoc wording more representative of method intent
2020-10-04 10:41:37 -07:00
Bogdan Drutu a706fb3350
Rename EventImpl to ImmutableEvent (#1738)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-02 08:56:12 -07:00
dengliming 71ba8e1b87
Use the concise license header without the year (#1623)
* Use the concise license header without the year

* Use the concise license header without the year
2020-10-02 22:42:53 +09:00
Bogdan Drutu 5fa1dbab87
Remove Descriptor from metrics data to be consistent with proto (#1716)
* Remove Descriptor from metrics data to be consistent with proto

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

* Remove references to descriptor

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-30 08:07:48 -07:00
Bogdan Drutu 2d146bbbb9
Remove constant labels from instruments and MetricData (#1692)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-24 15:14:04 +09:00
John Watson bf52c0af73
Implement the keyed-attributes proposal (#1631)
* Add a generic type for the key on the ImmutableKeyValuePairs.
This necessitated changing the `get` to `getValue` to avoid clashing with the java.util.Map interface.
Also introduced convenience sub-interfaces for consuming labels and attributes, so consumers don't have to worry about the types if they don't want to.

* Make AttributesMap not extend map, and restore the get method name for Attributes.

* key class and implementation

* key class and implementation

* The code compiles

* little tweaks

* some cleanup, tests are passing

* remove AttributeValue and clean up misc. references to it.

* clean up some unused bits

* add a TODO

* a bit of cleanup; fix a todo

* update for changes from the main branch

* Change method to get the underlying key.
Move the key creators to a AttributesKeys class.
Hide the implementation classes and replace with interface use.

* use autovalue for the key implementations

* fix javadoc issues

* update benchmark keys, and a few tweaks from PR review

* Add javadoc notes to encourage using the lower-overhead attribute options.

* Add javadoc clarifying subclass responsibilities around empty keys.

* make the compareTo on AttributeKeyImpl null-safe, for extra safety

* fix formatting
2020-09-21 08:52:40 -07:00
John Watson 27090b8336
Switch to java 8 (#1665)
* switch to java 8

* update the READMEs and use Object.equals in a couple of cases to test that we're really compiling for java 8/android 24.

* formatting

* use the newer release options for the build, and change the int test to not be java 7 any more.

* switch back to source/target compatibility

* sure wish I could run docker locally to test this out.
2020-09-19 11:28:13 +09:00
John Watson 485cc52c6f
SpanContext hides the TraceId/SpanId implementations (#1594)
*  This is a combination of 2 commits.
 This is the 1st commit message:

WIP on converting to String-based SpanContext

don't hand out the byte arrays publicly, but require making copies

make sure to hand out fresh invalid byte arrays.

Use strings for span and trace ids.

Switch over to CharSequence instead of String for the ids

Fix a couple of places that were casting to String

Add some simple wrappers for the generated longs to save converting until the last moment to the character-based representation.

introduce a reusable threadlocal char buffer for generating random ids.

update for changes from upstream

Change the SpanContext to store the ids as Strings internally
Change the id access methods on SpanContext to be clearly labeled as the base16 representations
Add a new create method that allows specifying offsets for traceId and spanId CharSequences

Provide an option for creating a SpanContext from longs or Strings, optionally.

fix a typo

update from upstream

 The commit message #2 will be skipped:

 don't hand out the byte arrays publicly, but require making copies

* WIP on converting to String-based SpanContext

* Update the SpanContext to only store Strings internally for Trace and Span ids.

* remove dead files

* cleanup some CharSequence usages to String

* Update api/src/main/java/io/opentelemetry/trace/BigendianEncoding.java

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

* Update extensions/trace_propagators/src/main/java/io/opentelemetry/extensions/trace/propagation/B3PropagatorInjectorSingleHeader.java

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

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

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

* Update api/src/main/java/io/opentelemetry/trace/TraceId.java

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

* updates from PR suggestion fubars

* some cleanup from PR feedback

* Switch back to String from CharSequence

* Get rid of the overload with the offsets

* Lots of bits of cleanup from PR feedback.

* more renaming of base16 to hex

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-09-03 10:03:41 -07:00
Anuraag Agrawal c6c179c267
Make sure forceFlush / shutdown can have callers wait for them to be done by returning CompletableResultCode. (#1571)
* Make sure forceFlush / shutdown can have callers wait for them to be done by returning CompletableResultCode.

* Merge
2020-08-28 10:51:39 -07:00
Christopher Hunt d6b53e60f4
Makes Export methods async (#1428)
* Makes Export methods async

This commit recognises that the export and flush methods of span and trace exporters can be, and often are, implemented with long-lived operations over networks. We therefore see that these method return types are represented using Java's Future type to account for this common behaviour.

* PR feedback
2020-08-18 11:45:26 -07:00
Anuraag Agrawal 66c5054f2d
Move TestSpanData to a testing package instead of in the published SDK. (#1512) 2020-08-06 09:44:44 -07:00
Anuraag Agrawal 8d0a4787ff
Migrate from Truth to AssertJ (#1493)
* Migrate from Truth to AssertJ

* Fix test

* Update andAndUpdate
2020-08-03 17:08:36 -07:00
Anuraag Agrawal 6dffbb8fc4
Migrate tests to JUnit5 (#1489)
* Add JUnit 5 dependency

* Revert unintended
2020-07-31 11:10:27 -07:00
John Watson e1ddcaec24
update errorprone, grpc and autovalue (#1403)
Also, clean up new errorprone warnings
2020-07-12 07:56:44 -07:00
Bogdan Drutu 76ef38955a
Start using real java8 in tests. (#1352)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-18 09:09:28 -07:00
Bogdan Drutu b5520ee14c
Change resource to use the new Attributes class (#1345)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-17 14:20:23 -07:00
John Watson fccc6d9bc3
Convert the usages of the LabelSetSdk to use the Labels class. (#1338) 2020-06-17 10:43:11 -07:00
John Watson d80bd1ad67
Convert Link and Event types to use the new immutable Attributes (#1325)
* Convert Link and Event types to use the new immutable Attributes

update from the upstream branch

update from parent branch changes

* move the limiting of attributes to a custom consumer class
2020-06-10 12:13:57 -07:00
Brandon Kimberly a392120914
Renamed SpanDataImpl to TestSpanData and moved to subdir test (#1291) (#1293) 2020-05-30 14:47:25 -07: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
John Watson d7f6d5a641
Extract SpanData to an interface (#1218)
* Extract SpanData to an interface.

* Move the inner link and event classes to the top level and rename for consistency.

* clean up a few errant references to the impl

* use the right annotation

* move the Link and Event back into the SpanData and give them simple names.
2020-05-14 18:10:38 -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
Giovanni Liva c723e67593
Add flush method to [Span|Metric] Exporters (#1113)
* Add flush to exporters

* Add javadoc

* format

* Wording and tests

* Flush all handler

* formatting
2020-04-17 15:28:27 -07:00
John Watson 8be114af66
Switch the SpanExporter interface to take a collection. (#1031) 2020-03-19 12:30:20 -07:00
John Watson 8e17f86fb1
Add a shutdown method on the metric exporter interface. (#1030) 2020-03-18 19:40:09 -07:00
Mike Goldsmith 577bab0032
move AttributeValue to common package (#1005) 2020-03-12 12:54:00 -07:00
John Watson 74611ce9bc
Remove the child count from the span data, and callers. (#989) 2020-03-10 12:23:56 -07:00
Bogdan Drutu 4c7072a1e4
Add javadoc link to all readmes (#981)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-03-09 14:32:22 -07:00
John Watson bd6c6fc91f
Very minor cleanup to change the logging exporters to use string-interpolated logging. (#954) 2020-03-02 10:26:30 -08:00
John Watson cd4d4ca1f4
A very simple logging metric exporter (#951)
* A very simple logging exporter for metrics.

* add comments about what we're testing.

* follow the rules
2020-03-01 11:27:58 -08:00
John Watson d5b0f8d816
Rename the exporter in preparation for creating one for metrics. (#950) 2020-02-28 14:05:02 -08:00
Bogdan Drutu a148263597
Switch to use pluginManagement, Use gradle plugin for jmh. (#903)
* Switch to use pluginManagement, Use gradle plugin for jmh.

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

* Fix jmh report

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

* Use ' for the moment for plugin ids in main gradle
2020-02-21 10:19:51 -08:00
Bogdan Drutu 38d9352a84
Move SpanData to data package, consistent with metrics. (#848)
* Move SpanData to data package, consistent with metrics.

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

* Update SpanDataTest.java
2020-02-11 17:53:23 -08:00
John Watson 69b9c09d60
Remove the Android API level enforcement. (#823)
* Remove the Android API level enforcement.
Keep the Java 7 enforcement.

* put android 14 enforcement back onto the API

* update based on PR comments

* put back android verification at api level 24
2020-02-11 06:29:32 -08:00
Jonathan Giles ecad8609aa Introduce automatic module names into all libraries being built. (#781)
* Introduce automatic module names into all libraries being built.

* Centralise manifest config of automatic module name into root build.gradle file.

* Adding empty new lines
2020-01-22 18:22:00 -08:00
John Watson 5517dcb55d Clean up the external interface for the RecordEventsReadableSpan (#751)
* WIP on cleaning up the testing-only accessors.

* more WIP on cleanup of the RERSpan

* re-add the 3 attributes and put them onto the SpanData

* reformat

* re-add and clean up the clock inheritance tests
2020-01-14 14:20:07 -08:00
Christian Neumüller ff067e005f Add hasEnded to ReadableSpan and SpanData (split from #693) (#733)
* Add hasBeenEnded property to ReadableSpan.

* Add hasBeenEnded to SpanData.

* Rename hasBeenEnded to hasEnded.

In-reply-to: https://github.com/open-telemetry/opentelemetry-java/pull/693#discussion_r358217782

* Check SpanData.hasEnded in unit test.

* Fix mismerge.
2020-01-07 17:02:22 -05:00
Bogdan Drutu ce1cd9c3bd
Remove Timestamp and change start/end times to use epoch nanos (#646)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-28 19:51:39 -07:00
Bogdan Drutu 741a635841
Convert SpanData TimedEvent to use epoch nanos (#638)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-28 08:16:50 -07:00
Bogdan Drutu d6befaf711
Remove special timestamp definition (#619)
* Remove sepcial timestamp definition

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

* Update api/src/main/java/io/opentelemetry/trace/Span.java

Co-Authored-By: Armin Ruech <armin.ruech@gmail.com>

* ./gradlew goJF

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

* fix build

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-22 18:14:55 -07:00
Bogdan Drutu 7c0af113a1
Remove util/Events. (#622)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-22 17:32:11 -07:00
Bogdan Drutu 9c60dc1a09
Move utils from API to SDK. (#613)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-14 17:45:33 -07:00
John Watson d80eb04f94 Create a Logging span exporter (#592)
* a simple logging span exporter
2019-10-10 19:03:55 +02:00