Commit Graph

298 Commits

Author SHA1 Message Date
David Poncelow 465664cddc
Add benchmarks for metrics API (#990)
* Add benchmarks for metrics API

* update to meet Google Java style guidelines

* reduce code duplication in measurements

Split measurements and SDKs into two enums that can
be pulled together into a matrix, which has an
additional benefit that comparable metrics are
pulled onto the same scale in the JMH visualizer

* remove generics from tested operation, clean up construction
2020-03-24 07:41:50 -07:00
Carlos Alberto Cortez 690651b65a
Context propagation update (OTEP 66) (#720)
* Initial Propagators refactor.

* Add tests for the new propagators changes.

* Make the SDK compile/pass.

* Make the OT shim compile/pass.

* Make contrib components compile/pass.

* Improvement over Span/SpanContext handling in Context.

* Add Span.setParent(Context) overload.

* Do not provide default values for Span/SpanContext keys in Context.

* Improve the Context's active state handling.

* Rename DistributedContext to CorrelationContext.

* Improve names for correlationcontext's ContextUtils methods.

* Don't provide an automatic default for current CorrelationContext.

* Improve the client-server example after the recent changes.

* Adds CorrelationContext.Builder.setParent(Context) overload.

* s/be/become.

* Fix javadoc.

* No need to use diamond.

* Simply import withScopedContext().

* Fix the API/SDK build.

* Remove the builder from the Propagators interface.

* Fix name.

* Use Collections.emptyList() directly.

* Rename Propagators to ContextPropagators.

* Move context/ members in api/ to context_prop/

* Add check/tests for null scoped Contexts.

* Rename ContextUtils classes to better alternatives.

* Update the context* util classes.

* Make the code compile after the latest master merge.

* Cache the fields() in our default composite propagator.

* Remove the overloads of setParent(Context) for now.

* Use DefaultSpan for the tests instead of calling getTracerProvider()

* Fix the sdk testbed artifact build.

* Make the B3 propagator comply with the new propagator API.

* Simplify the HttpTraceContextTest tests.

* Simplify the ContextUtils* classes handling of default values.

* Minor nit.

* Update api/src/main/java/io/opentelemetry/OpenTelemetry.java

Co-Authored-By: Giovanni Liva <giovanni.liva@dynatrace.com>

* Annotate ContextPropagators with ThreadSafe instead of Immutable.

* Do not use the fully qualified ContextUtils identifier.

* Remove SpanContext support from TracingContextUtils.

* Rever to using non-defaulted key for TracingContextUtils.

* Revert the default keys for CorrelationsContextUtils.

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
2020-03-20 13:38:05 -07:00
Giovanni Liva 73e671d8f1
Revise null values for AttributeValue (#1026) 2020-03-20 18:08:31 +01:00
Christian Neumüller e4e648e435
Clarify javadoc for SpanProcessor#forceFlush (#1033) 2020-03-20 07:55:34 -07:00
Christian Neumüller bbadbe7b4d
Correct minimum Android API level in SDK README. (#1034)
This was forgotten in #823. Probably other READMEs are also affected.
2020-03-20 07:54:58 -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 826ec7e27b
Limit RecordEventsReadableSpan attributes to configured max (#1021) 2020-03-18 19:48:17 +01:00
John Watson 8453bcb14a
Remove LabelSet from the API altogether. (#1023)
* remove LabelSet from the API surface altogether

* rename bindInternal to bind
2020-03-16 16:07:18 -07:00
Bogdan Drutu a8401f933e
Plugin aggregator for observer, add tests, fix lock. (#1018)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-03-16 13:53:13 -07:00
John Watson 29297249ab
remove LabelSet from the Instrument binding API (#1010) 2020-03-16 13:38:10 -07:00
John Watson 014ceeb97c
Add a very basic benchmark for the span implementation (#1012)
* add a very basic benchmark for the span implementation

* small refactoring to make it clear what we're doing.

* remove the spandata conversion and name the methods more explicitly
2020-03-16 13:36:52 -07:00
Bogdan Drutu 0bca032633
Plugin dropped attributes to otlp (#1015)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-03-15 09:32:03 -07:00
John Watson 93f89990fd
Add a helper class that reads metrics every X seconds. (#1011)
* Add a helper class that reads metrics every X seconds.

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

* Adress review feedback

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

* a few final cleanups

* Make the shutdown block until all the tasks are complete (or 5 seconds, whichever is shorter)

* only run the final export if we can shut down the executor properly

Co-authored-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-03-14 09:48:56 -07:00
Mike Goldsmith d9d6f623a0
Add dropped attribute count to SpanData, Link and Event (#1004)
* add dropped attribute count to SpanData, Link and Event

# Conflicts:
#	sdk/src/main/java/io/opentelemetry/sdk/trace/data/SpanData.java

* add private field and update constructor for dropped attr count

* add dropped attribute count to SpanData, Link and Event

* update count to type to int

* remove droppedAttributeCound from api interfaces

* use static int for default value in MessageEvent

* add missing return description for SpanData

* fix up some SpanDataTests

* remove unnecessary methods on Link

* fix linting warning for spacing

* revert changes to MessageEvent
2020-03-13 15:56:41 -07:00
John Watson e248ea7ad7
Remove LabelSet from Observer API (#1008)
* Remove the LabelSet parameter on the DoubleCounter non-bound usage.

* remove LabelSet from the Observer API
2020-03-13 09:33:34 -07:00
John Watson 4d2a9f2bde
remove LabelSet from the BatchRecorder API. (#1006)
also removes a few more usages of the LabelSet interface.
2020-03-13 08:41:04 -07:00
Carlos Alberto Cortez 0ec6cca453
Rename the Context methods returning Scope as withCurrentContextWith() (#976) 2020-03-12 12:55:15 -07:00
John Watson efc49522ac
Remove LabelSet from non-bound instrument usage (#1001)
* Remove the LabelSet parameter on the DoubleCounter non-bound usage.

* remove non-bound labelset measure recording method

* remove non-bound labelset LongMeasure recording method

* remove non-bound labelset LongCounter recording method

* tidy up an access level
2020-03-12 12:54:43 -07:00
Mike Goldsmith 577bab0032
move AttributeValue to common package (#1005) 2020-03-12 12:54:00 -07:00
Armin Ruech 91d2132f62
Rename resource labels to attributes (#970) 2020-03-10 16:35:17 -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
Bogdan Drutu 2080fe196c
Remove generic usage in the metrics API (#956)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-03-09 14:31:55 -07:00
Carlos Alberto Cortez 1d913cb639
Initial relocation of ContextUtils classes. (#904)
* Initial relocation of ContextUtils classes.

Now they will live within the child `propagation` package,
with a prefix based on their cross-cutting concern, to be
referenced easily.
2020-03-08 18:34:46 +01:00
Uladzislau Kiva e15e6d3259
name method's according to return value (#974)
* refactor: name method's according to return value and https://github.com/open-telemetry/opentelemetry-java/blob/master/QUICKSTART.md#tracing

* refactor: name method's according to return value and https://github.com/open-telemetry/opentelemetry-java/blob/master/QUICKSTART.md#tracing-sdk-configuration

* refactor: name method's according to return value and https://github.com/open-telemetry/opentelemetry-java/blob/master/QUICKSTART.md#tracing
2020-03-07 11:06:21 -08:00
John Watson 6ca3d1deaf
Add missing thread safety & immutable annotations in the API. (#972) 2020-03-06 20:02:09 +01:00
Carlos Alberto Cortez 96ee305798
Make sure to shutdown the exporter when the processor is shut down. (#966) 2020-03-05 19:57:56 +01:00
Bogdan Drutu ed98c35c05
Plugin default aggregation for measure, add tests, stresstests (#961) 2020-03-04 21:28:07 -05:00
Bogdan Drutu e824c45bdd
Implement collectAll for observers, need to still install default aggregation (#952)
* Implement collectAll for observers, need to still install default aggregation

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

* Move result callbacks as inner classes.

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-03-04 13:13:10 -05:00
Carlos Alberto Cortez 26a4070d90
Remove Binary format and related members. (#891) 2020-03-03 08:47:41 -05:00
Bogdan Drutu 06dfd95f99
Finish implementation for Aggregation.lastValue and add tests. (#938)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-03-01 11:46:31 -08:00
Uladzislau Kiva 43b59451ab
refactor: name method's according to return value and https://github.com/open-telemetry/opentelemetry-java/blob/master/QUICKSTART.md#tracing (#953) 2020-02-29 08:28:26 -08:00
John Watson c1811ee38d
Add in the aggregation for minMaxSumCount aggregations. (#949) 2020-02-28 13:45:40 -08:00
Bogdan Drutu e06d254f9e
Add MetricProducer for OpenTelemetry metrics SDK (#945)
* Add MetricProducer for OpenTelemetry metrics SDK

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

* Move MetricProducerSdk to MeterSdkProvider as a privet class

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-28 13:24:16 -08:00
John Watson a21adeb45f
Add aggregators for double & long MinMaxSumCount aggregations (#943)
* Add aggregators for double & long MinMaxSumCount aggregations

* use the count to signal un-set min/max values

* make the aggregator constructors private; use the factories for access

* simplify the merge and reset

* early return & fix the default double values.
2020-02-28 10:30:47 -08:00
Bogdan Drutu ecf7067a14
Add collectAll method to the Meter and MeterProvider (#942)
* Add collectAll method to the Meter and MeterProvider

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

* Minor fixes from the review.

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-27 15:02:13 -08:00
Bogdan Drutu dc68060ddd
Plugin the InstrumentRegistry and register all created instruments (#941)
* Plugin the InstrumentRegistry and register all created instruments

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

* Update comments, use instrument equals.

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-27 11:38:35 -08:00
Bogdan Drutu 85a54f546e
Add a first implementation for LastValue aggregator for Observers (#937)
* Add a first implementation for LastValue aggregator for Observers

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

* Fix issue when last value aggregation has no records.

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-27 09:41:32 -08:00
John Watson 2afb61dccc
Add summary metric data type (#940)
* Add a double-valued summary type of MetricData.

* Add a test, rename some classes
2020-02-26 17:10:30 -08:00
Bogdan Drutu 9eeeb3da0c
Avoid calling processors that do not require an event. (#935)
* Avoid calling processors that do not require an event.

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

* Add tests for NoopSpanProcessor

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-26 12:10:58 -08:00
Bogdan Drutu f8c55c199f
Add minimal benchmarks for Counter instruments (#932)
* Add minimal benchmarks for Counter instruments

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

* Update sdk/src/jmh/java/io/opentelemetry/sdk/metrics/DoubleCounterSdkBenchmark.java

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

Co-authored-by: Armin Ruech <armin.ruech@gmail.com>
2020-02-26 09:46:55 -08:00
Bogdan Drutu 06ebc99c42
Add a minimal implementation for BatchRecorder (#921)
* Add a minimal implementation for BatchRecorder

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

* Add null check and test

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-24 16:24:51 -08:00
Bogdan Drutu 4705b250cc
Add an InstrumentRegistry that tracks all created Instruments (#907)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-24 15:25:24 -08:00
Bogdan Drutu 5a09b818d9
More gradle cleanups (#910)
* More gradle cleanups, separate jmh and jmhreport config

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

* Remove the need to includ jmhreport

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

* Only projects with the plugin maven-publish will be published

Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-24 09:58:04 -08:00
Bogdan Drutu c802811971
Return SDK builders in the MeterSdk to avoid casting in tests (#909)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-21 14:03:00 -08:00
Giovanni Liva 073ece13b8
Implementing ForceFlush for SpanProcessor (#882)
* first implementation of ForceFlush

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

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Rename flush -> shutdown. Add test

* Better wording in Javadoc

Co-authored-by: John Watson <jkwatson@gmail.com>
2020-02-21 11:27:18 -08:00
Bogdan Drutu 2ebb3ef352
Add stress tests for counters (#890)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
2020-02-21 10:39:18 -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
Giovanni Liva 24e470522d
Use AttributeValue in Resources (#883)
* Introduce ResourceValue

* Reuse AttributeValue for ResourceValue

* Constant resource value as AttributeValue

* ./gradlew goJF

* Rebase
2020-02-21 10:15:15 -08:00