Commit Graph

369 Commits

Author SHA1 Message Date
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
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
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
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
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
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 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
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
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 c9fe822c13
Cleanup Samplers (#1233)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-20 10:02:35 -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
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
Giovanni Liva 945eed2046
readEnvironment->readEnvironmentVariables (#1236) 2020-05-18 07:39:47 -07:00
John Watson d9aeb2fdca
Add a couple of tests for cases that weren't previously covered (#1232) 2020-05-15 17:48:04 -07:00
Bogdan Drutu 39f7954b4e Add implementation for UpDownSumObservers (#1224)
* Add implementation for UpDownSumObservers

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

* Fix minor nits in tests

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-15 13:34:43 -07:00
Bogdan Drutu 317ccbc393
Add API for UpDownSumObservers (#1220)
* Add API for UpDownSumObservers

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

* Fix minor nits

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

* Fix more nits

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-15 12:07:12 -07:00
Giovanni Liva a99a571e7a
Unify config api (#1217)
* BatchSpanProcessor

* SimpleSpanProcessor

* package-info

* Expand variable names
2020-05-15 09:06:42 -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 f9c054c3c5
Remove absolute property from measure (#1219)
* Remove absolute property from measure

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

* Fix tests

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-14 12:25:55 -07:00
Bogdan Drutu 47b449ef1a
Add CounterUpDown implementation in the SDK (#1201)
* Add CounterUpDown implementation in the SDK

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

* Always unbind a bound instrument, even if an exception is thrown

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-13 11:55:40 -07:00
Bogdan Drutu fcd627d717
Rename observers, cleanup comments (#1215)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-13 11:43:07 -07:00
Bogdan Drutu e67fe84c60
Add API for UpDownCounter (#1210)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-13 10:00:09 -07:00
Bogdan Drutu 5b31c5ae0c
Remove monotonic property from counters (#1208)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-12 16:43:47 -07:00
Bogdan Drutu ba772a7a7f
Ensure the total number of attributes is counted correctly (#1207)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-12 16:31:30 -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
Bogdan Drutu 7aec1aee71
More minor cleanups in the code (#1204)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-12 10:00:51 -07:00
Bogdan Drutu 4d2f6cc91d
Cleanup names in metrics and ensure consistency with specs (#1202)
* Cleanup names in metrics and ensure consistency with specs

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

* Rename SyncInstrument to SynchronousInstrument

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

* Update api/src/main/java/io/opentelemetry/metrics/SynchronousInstrument.java

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

Co-authored-by: John Watson <jkwatson@gmail.com>
2020-05-12 09:50:02 -07:00
Giovanni Liva b7510761db
Fix remove attributes from span after termination (#1203)
* Fix remove attributes from span after termination

* Remove attribute in the same synchronized block

* Simplify tests
2020-05-12 09:42:45 -07:00
Bogdan Drutu 528d51878d
Add instrument type and value type to InstrumentDescriptor (#1200)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-12 09:33:00 -07:00
Bogdan Drutu bcacf39a9c
Apply intelij inspect suggestions for Java code (#1196)
* Apply intelij inspect suggestions for Java code

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

* Fix comments.
2020-05-11 16:54:39 -07:00
Giovanni Liva cd041c9d30
Fix getTracerLower behavior (#1193)
* Fix getTracerLower behavior

* Add test for negative trace representation
2020-05-11 11:21:14 -07:00
Giovanni Liva fc911235d2
Add system/env vars and properties configuration for Metric classes (#1168)
* Add configuration to IntervalMetricReader

* Add configuration to OTLP

* Add documentation

* Fix year copyright

* Removing Jaeger from javadoc

* 0.4.0 -> 0.5.0
2020-05-10 08:21:55 -07:00
Bogdan Drutu 217dca7bf0
Memoized the result of Resource.hashCode to optimize grpc mapping (#1185)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-05-07 14:13:57 -07:00