Commit Graph

36 Commits

Author SHA1 Message Date
Bogdan Drutu feedef2366
Rename accumulator to processor to match Go (#2255)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-09 20:19:31 -08:00
Bogdan Drutu 583b2cc68b
Remove unused fields from AbstractInstrument (#2254)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-09 17:15:43 -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
Bogdan Drutu 658ab98610
Remove all implementations of the InstrumentAccumulator, kepp only the AllLabels (#2248)
This PR fixes a small bug where the AllLabels implementation was expecting "unmapped" boolean, which was passed correctly by the Sync instruments, but incorrectly by the Async.
This causes an unnecessary allocation for all the async instruments recordings.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-09 13:12:15 -08:00
Bogdan Drutu d9260d0656
Rename batcher to instrumentaccumulator, remove active batcher (not used) (#2245)
* Rename batcher to instrumentaccumulator, remove active batcher (not used)

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

* Fix tests, add back check for has records

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-09 11:27:20 -08:00
Bogdan Drutu efd6b9f3e4
Remove deprecated setCallback, change SDK to avoid volatile (#2216)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 18:37:45 -08:00
Anuraag Agrawal 18355e9683
Remove Guava dependencies from SDK (#2148)
* Remove Guava from SDK

* Clean
2020-12-01 11:10:38 -08:00
Anuraag Agrawal 09d371ba09
Enable tooling for mrjar and use it to get epoch time in best way for Java 8 or 9+. (#2154) 2020-12-01 09:30:05 +09:00
John Watson 73bad773dd
Move the AsynchronousInstrument callbacks to the builders. (#2120)
Deprecate the existing setCallback method.
Update the code in the SDK to use the new API.
2020-11-30 14:12:49 -08:00
Anuraag Agrawal ac672e56bf
Update dependencies (#2115) 2020-11-21 09:39:27 -08:00
John Watson c4791e9fbb
Very basic Aggregation-configuration API in the SDK. (#2037)
CHANGELOG: SDK : Enhancement: A basic aggregation configuration API has been added to the SDK's meter provider implementation.

* Create a very basic view API in the SDK.

* fix formatting

* move the ViewRegistry up one package, and clean up the visibility of other classes

* Support matching by instrument name

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/ViewRegistry.java

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

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/view/ViewSpecification.java

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

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/view/ViewSpecification.java

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

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/view/ViewSpecification.java

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

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/view/ViewSpecification.java

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

* fix formatting issues from GH

* small renaming to a big name

* small renaming to a big name

* re-order matching check and fix a merge issue

* Update from upstream changes.

* Update from upstream changes.

* Adjust defaults based on the latest behavior

* refactor before writing tests

* tests for the AggregationChooser and a bugfix they uncovered

* tests for the ViewRegistry

* Javadoc for the AggregationConfiguration

* Add more javadoc.

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/Batcher.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/AggregationConfiguration.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/AggregationConfiguration.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/view/AggregationConfiguration.java

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

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/view/AggregationConfiguration.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/AggregationConfiguration.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

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

* fix formatting issues

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/InstrumentSelector.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-11-18 13:05:37 -08:00
Marius Volkhart 4bc4f04e75
Prevent SDK from throwing on null instrumentation name (#1941)
CHANGELOG: the SDK will no longer throw an exception with a null instrumentation name on tracers or meters, but this is still not recommended usage.

* Provide a default Tracer and Meter for invalid instrumentation names

According to the spec, https://github.com/open-telemetry/opentelemetry-specification/blob/v0.6.0/specification/trace/api.md#tracerprovider-operations both a null and empty instrumentation name are invalid and a default implementation should be provided.

However, the spec is vague on what default means. See https://github.com/open-telemetry/opentelemetry-specification/issues/586#issuecomment-669856711

This change interprets "default" as meaning, "it should still work, but it's not ideal". Accordingly, a real Tracer or Meter implementation from the SDK is used. It meets the requirements of exporters and such by using a valid instrumentation name. It meets the requirements of application developers by producing valid tracing data. It also warns library and application developers by logging at the WARN level that an invalid value has been given.

The rational for this interpretation is that things should always work for the application developer. If an app developer doesn't provide a name, they should be chided, but they are instrumenting their own app, and likely don't care about the lack of name. If an app developer incorporates a library that doesn't specify the instrumentation name, the instrumentation should still be made available to application devs, but they should be able to turn if off (hence a valid name) and be made aware of something not being right (hence the logging) so they can report it to the library maintainers.

Fies #1879

* Mark instrumentation version nullable in MeterProvider and TracerProvider

The spec dictates this to be optional, and the implementations treat it as nullable already.

* Remove ComponentRegistry#get(String) overload

This overload is not no longer used by our code.

* fixup! Mark instrumentation version nullable in MeterProvider and TracerProvider

* fixup! Provide a default Tracer and Meter for invalid instrumentation names

* fixup! Provide a default Tracer and Meter for invalid instrumentation names

* fixup! Remove ComponentRegistry#get(String) overload

This reverts commit db56814c

* Revert "Mark instrumentation version nullable in MeterProvider and TracerProvider"

This reverts commit 7e92b396
2020-11-13 09:48:44 -08:00
John Watson 5ea50d3104
Make the BatchRecorderSdk actually batch the recordings (#2007)
* Make the BatchRecorderSdk actually batch the recordings
Rather than just forwarding them immediately.

* rework the batch recorder to use a queue of recordings

* remove an allocation per recording by introducing some typed classes
2020-11-10 09:44:16 -08:00
John Watson d69752a6be
Move the SPI interfaces to .spi.* packages (#2005) 2020-11-06 11:08:35 +09:00
Anuraag Agrawal 9c4c52dfee
Switch animal sniffer signature to gummy bears. (#2015) 2020-11-06 08:56:26 +09: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 3d69aa19a8
Restore source/targetCompatibility declarations for intellij to set version correctly and remo… (#1920)
* Restore source/targetCompatibility declarations for intellij and remove animalsniffer for java 8.

* Newer syntax
2020-10-29 08:11:15 -07:00
Tyler Benson e1d207b519
Use LongAdder and DoubleAdder instead of atomic variants (#1896)
* Use LongAdder instead of AtomicLong

Now that we're based on Java 8, we can use LongAdder instead.

* Use DoubleAdder instead of AtomicDouble

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2020-10-27 18:14:42 -07: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 ea1a0a0486
Rename OpenTelemetry interface methods to normal interface conventions. (#1842) 2020-10-21 19:21:57 -07:00
John Watson fe07cff3ba
Add a new Gauge metric type, and hook it up to Prometheus and OTLP exporters. (#1788) 2020-10-16 10:09:52 -07:00
Anuraag Agrawal 0ceff17dfa
Remove since tags until 1.0.0 (#1796)
* Remove since tags until 1.0.0

* Spotless
2020-10-14 09:29:27 -07:00
John Watson ff73ae8142
Convert the ValueObserver instruments to use the LastValue aggegration. (#1689)
* Convert the ValueObserver instruments to use the LastValue aggegration.

* update for rebase
2020-10-12 15:19:54 -07:00
Bogdan Drutu 69117e6dea
Fix warnings found by idea IDE in the SDK dir. (#1773)
* Fix warnings found by idea IDE.

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

* Run spotlessApply

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

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2020-10-12 17:42:09 +09:00
Anuraag Agrawal 78fd4d1c8f
Add package-info.java to all packages and ParamatersAreNonNullByDefault. (#1772) 2020-10-08 08:26:49 -07: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
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
Jason Plumb cfbe6bfe81
Rename dangling references to MeterRegistry (#1683)
* rename getMeterRegistry() to getMeterProvider() in javadocs.

* rename meterRegistry variable to meterProvider

* reformat
2020-09-22 19:37:47 -07: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
Jason Liu 51e93f7273
SDK: Remove Javadocs since tags (for pre 1.0 release) (#1650)
* Add since for SDK (corresponding to the version in API)

* Add since based on release branches

* Remove all since tags in SDK
2020-09-17 13:09:08 +09:00
Giovanni Liva 2f9443b3eb
Case-insensitive names for metric instruments (#1643)
* Fix case-insensitive

* s/NAME_MAX_LENGTH/METRIC_NAME_MAX_LENGTH
2020-09-16 16:31:42 +09: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
Ken Finnigan 26597266df
Separate the SDK into separate publishable artifacts (#1525)
* Split single "sdk" module into separate pieces for common, correlationcontext, metrics, tracing, and the combination of them all

* Modify comment to not reference implementation class

* Moved JMH code to /sdk/all

* Move new files to adjusted location

* Move new files from rebase
2020-08-18 13:43:17 -07:00