Commit Graph

185 Commits

Author SHA1 Message Date
Anuraag Agrawal 3869ecf491
Remove final from methods on final class. (#3816) 2021-11-02 07:48:34 -07:00
jack-berg 9ad1d55779
Fix DelegatingSpanData#toString() typo (#3781) 2021-10-20 15:24:30 -07:00
Anuraag Agrawal 27c48f6ffe
Promote DelegatingSpanData out of incubator. (#3768)
* Promote DelegatingSpanData out of incubator.

* Not final equals
2021-10-20 12:48:56 +09:00
Anuraag Agrawal 5bc953ec68
Replace InMemoryMetricReader constructor with factory. (#3727)
* Replace InMemoryMetricReader constructor with factory.

* Update InMemoryMetricReader.java
2021-10-12 11:06:05 +09:00
Anuraag Agrawal 776b4f71d7
Replace :proto usage with published io.opentelemetry.proto (#3697) 2021-10-06 11:51:17 -07:00
Josh Suereth 70086cf014
MetricReader and Multi-export features (#3578)
* Start of multi-exporter codebase.

* Restore InMemoryExporter + fix javadocs.

* Quick javadoc fix

* Fix some javadoc build failures and missing things.

* Fix bug with autoconfigure

* Modify InMemoryMetricReader + register methods to allow for immutable SdkMeterProvider

- InMemoryMetricReader is now a factory + reader
- Hide register on SdkMeterProvider
- Update all tests to make sure things pass.

* Make metric-readers 'immutable' post-construction of SdkMeterProvider.   Update all code around registration of readers and autoconfigure.   Create new 'sdk noop' meter provider for when we have no readers configured.

* Fix integration test.

* Fix jmh benchmarks for trace.

* Fix jmh build.

* Fix broken in-memory exporter things, and Noop API issue.

* Migrate MetricReader.Factory to MetricReaderFactory.

* Rename PeriodMetricReader.Factory to PeriodicMetricReaderFactory.

* Apply suggestions from code review

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

* Minor cleanup of ColectionHandle.

* Fixes from review.

* Extract delta accumulation and add tests.

* Fragment the abstraction in SynchronousMetricStorage for better separation of responsibilities.

* Add tests (and minor optimisation) for delta metric storage.

* Add test for temporal metric storage.

* Update temporal metric storage to fix issue w/ async instruments.

* Migrate Async storage to use temporal metric storage (with better tests).

* Another fix from review.

* Remove start epoch nano parameter from storage constructors.

* Fixes from review.

* Migrate flush -> forceFlush as per review.

* Add test coverage for flush.

* Fixes from review.

* Fix public API breakage.

* Fixes from review.

* Fix threadsafe annotations

Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-09-30 22:22:09 +09:00
Anuraag Agrawal 534eeac73d
Add tests for illegal span limits (#3673) 2021-09-28 09:15:44 -07:00
Anuraag Agrawal f59087b183
Don't crash on null spans in BSP (#3664) 2021-09-27 08:23:23 -07:00
Anuraag Agrawal b70c114f51
Use concatenation instead of stringbuilder in RERS. (#3646) 2021-09-22 08:16:40 -07:00
Josh Suereth e6424654b2
Implementations of Exemplar Reservoirs (#3592)
* Initial implementation of simple ExemplarReservoirs

- Add an implementation of naive fixed-bucket reservoir sampling
- Add an implementation of FixedSizeHistogram reservoir sampling where latest-measurement per-histogram-bucket is kept.
- Add assertions for exemplars.

* Remove explicit locks for mild performance boost.

* Create a new random holder abstraction.

- Create new random holder abstraction that allows
  - ThreadLocalRandom when efficient
  - simple detection of Android + workaround for TLR
  - Overridable with mocked random for testing.
- Update tracing RandomIdGenerator to leverage new RnadomHolder
- Expand exemplar reservoir tests to use new random holder
- Remove android-only random id generator test

* Add api diff + fix silly naming thing.

* Move random hodler to be Supplier, other updates from code review.

* Fixes from review.

* Fix bytebuddy issue with mocking.

* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/exemplar/AbstractFixedSizeExemplarReservoir.java

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

* Fix name from review.

* Update sdk/common/src/main/java/io/opentelemetry/sdk/internal/RandomSupplier.java

Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-09-17 13:20:06 +09:00
jack-berg 9b9ef48b34
Add autoconfigure for span attribute value length limits (#3602)
* Rename SpanLimitsBuilder.setMaxAttributeLength to setMaxAttributeValueLength

* Add span attribute value length limits to autoconfigure

* Fix build
2021-09-10 14:01:33 -07:00
jack-berg 060e50ed5f
Add attribute length limits to SpanLimits. (#3551)
* Add attribute length limits to SpanLimits.

* Respond to PR feedback

* Respond to PR feedback

* Remove test utility function

* Rename method to getMaxAttributeValueLength
2021-09-10 09:49:55 +09:00
Trask Stalnaker 86eea94b76
Allow creating a SpanContext without validation for internal use (#3564)
* Avoid unnecessary calls to TraceId and SpanId.isValid()

* Alternative: move ImmutableSpanContext to internal package

* javadoc

* Only skip for safe IdGenerators

* Simplify

* Errorprone

* Add test and fix boolean logic

* Spotless

* Add test

* Revert toString test change
2021-08-31 11:09:19 -07:00
Anuraag Agrawal adbf811249
Only compute nanoTime once for a root span. (#3567)
* Only compute nanoTime once for a root span.

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

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

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

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-08-31 08:43:09 +09:00
jack-berg 58c16a9133
Add missing readmes and missing javadoc links (#3500) 2021-08-16 12:36:54 -07:00
Anuraag Agrawal 42da2da1cc
Fix some nullability in SDK. (#3474)
* Fix some nullabiity in SDK.

* Cleanup

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

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

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
2021-08-15 09:47:39 +09:00
Trask Stalnaker 651df06cc9
Add getAttribute to ReadableSpan (#3458)
* Add getAttribute to ReadableSpan

* javadoc
2021-08-14 10:33:33 +09:00
Anuraag Agrawal 87f2b5e0a8
Update error-prone (#3485) 2021-08-13 09:44:29 -07:00
Anuraag Agrawal 2844471335
Fix Resource version properties lookup and extract version file gener… (#3467)
* Fix Resource version properties lookup and extract version file generation.

* Only published

* Cleanup

* Better merge

* Fix merge
2021-08-12 10:15:51 -07:00
Anuraag Agrawal 7fb6061af7
Don't create test-specific mocks in BSPTest. (#3469) 2021-08-12 10:05:34 -07:00
HaloFour b5f56ccac7
Adds getParentSpanContext to ReadableSpan interface (#3454)
* Adds getParentSpanContext to ReadableSpan

* Unit tests
2021-08-08 11:17:40 +09:00
Josh Suereth 0ef19291c2
Swap old Metrics API for currently specified Metrics API (#3423)
* Update the API to the latest SDK specification.

* API updates to other sdk areas.

* First half of SDK updates for API.

Passing off to other cmoputer.

* Get SDK compiling again.

* Get tests compiling again (and failing).

* Fix bad copy-paste error.

* Get all SDK tests passing.

* More fixes to builds across SDK impls.

* Remove unecessary publics

* more fixes for new API.

* spotless fixes.

* Make tests for metric points order independent.

* Restore readme.

* Fix readmes.

* Add noop meter provider tests for code coverage.

* Add code coverage for assertion library.

* Fix wierd test failure that gradle cache is preventing me from seeing locally.

* Fix javadoc/spelling comments from review.

* Remove marker interfaces.

* Switch from atomic ref to volatile.

* Fixes from review.

* Apply suggestions from code review

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

* Fixes from review.

* Fixes from review.

* Update OTLP HTTP exporter to use new metrics api

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-08-05 13:58:49 -07:00
Trask Stalnaker 60c3c5ca0c
Format build.gradle.kts files (#3427) 2021-07-29 13:21:38 +09:00
BrianYan 9fdd001e58
Add factories for SamplingResult (#3410)
* fix:rebase it

* Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/SamplingResult.java

* Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/SamplingResult.java

* Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/SamplingResult.java

* Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/SamplingResult.java

* Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/SamplingResult.java

* Update sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/SamplingResult.java

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-07-20 08:44:53 -07:00
Anuraag Agrawal 25a053cc54
Make MonotonicClock not implement Clock and move to package private. (#3372)
* Make MonotonicClock not implement Clock and move to package private.

* Anchored

* Remove nanoTime

* Not really milliseconds now adays
2021-07-09 12:29:00 +09:00
Anuraag Agrawal 1196e836b9
Remock shutdown after reset. (#3382) 2021-07-09 12:03:48 +09: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 e3bcc8b2a1
Different pattern for embedding shaded dependency. (#3371) 2021-07-08 08:52:46 -07:00
Josh Suereth b12a57ed21
Migrate Metrics SDK "data' package to Attributes (#3352)
* Update java metrics data model and create assertion based testing library.

* Update existing SDK for Label => Attribute in data model

- Finish wiring through changes to all code/tests.
- DOES NOT touch API
- Update existing tests to use new testing library to be sensitive to attribute vs. label hashing alterations + equality of the metrics.data package types.

* Fix javadoc breakages

* Fix JMH compile

* Finish javadoc

* Fixes from review

* Remove botched file.

* Fixes from review.
2021-07-01 09:15:44 -07:00
brunomed 535b5b9eff
BatchSpanProcessor falls back to ArrayBlockingQueue if `jdk.unsupported` is not available (#3340)
* rename JcTools' newMpscArrayQueue to newFixedSizeQueue

* falls back to ArrayBlockingQueue if `jdk.unsupported` is not available
2021-06-24 08:21:52 +09:00
Anuraag Agrawal ce9c8854c7
Extract publishing and animalsniffer plugins. (#3334) 2021-06-22 08:23:16 +09:00
John Watson df1f47d929
Add the OpenTelemetry schema URL to the Resource. (#3319)
* Add the OpenTelemetry schema URL to the Resource.

* A few cleanups from PR review.
2021-06-18 08:52:56 -07:00
Anuraag Agrawal 864508983e
Extract JMH conventions plugin. (#3324) 2021-06-17 08:37:49 -07: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
Anuraag Agrawal 1443da140a
Reorder methods on SpanData for better AutoValue toString (#3312) 2021-06-15 08:28:26 +09:00
Christian Neumüller 7be6d242a8
Use Context.root() to simplify logic. (#3314) 2021-06-15 08:25:19 +09:00
John Watson ca92a9ab03
Introduce usage of the OpenTelemetry schema with a Tracer/MeterBuilder (#3309)
* Add the OpenTelemetry schema URL to the InstrumentationLibraryInfo and the corresponding API calls.

* small refactoring and doc tweaks from feedback

* make the instrumentation version nullable on the method that takes a schema

* update the apidiffs

* add since tags and a few more missing nullable annotations

* Switch to using a Builder rather than method overloads.
2021-06-11 20:50:23 -07:00
Anuraag Agrawal 7ecb2e260e
Only check one part of trace ID is valid since it guarantees a value … (#3291)
* Only check one part of trace ID is valid since it guarantees a value full ID.

* Valid 64-bit IDs.
2021-06-10 21:47:36 +09:00
Anuraag Agrawal 0a9e77f751
Small tweak to name of internal method. (#3292)
* Small tweak to name of internal method.

* Apply
2021-06-08 17:00:55 +09:00
Anuraag Agrawal 4a691cf567
Use switch instead of enummap for status creation (#3290)
* Use switch instead of enummap for status creation

* Combine tests
2021-06-08 16:49:48 +09:00
Anuraag Agrawal cf1fa9f9fe
Fix drift in SpanLimits comments. (#3293)
* Fix drift in SpanLimits comments.

* Nope
2021-06-08 16:38:54 +09:00
Anuraag Agrawal d191424379
Copy simplespanprocessor warning to factory method too and scope it down to logging. (#3289) 2021-06-07 08:31:27 -07:00
Anuraag Agrawal 37cd112e9d
Don't use AutoValue for TraceIdRatio sampler (#3275) 2021-06-03 08:01:00 -07:00
Nikita Salnikov-Tarnovski e86680cd13
Update otel.yaml (#3270) 2021-05-31 09:00:51 -07:00
Anuraag Agrawal 782e38fe6e
Remove unneeded forEach from AttributesMap. (#3266) 2021-05-30 08:21:33 -07:00
John Watson ed99ea357f
Fix the SpanPipelineBenchmark so that it runs. (#3264)
* Fix the SpanPipelineBenchmark so that it runs.
I also updated it to create 100 spans, rather than just a single span, so we can amortize the cost of the Resource, etc.

* Be sure to flush the SDK.

* formatting
2021-05-30 11:44:45 +09:00
Nikita Salnikov-Tarnovski ae3860e069
Add benchmark for recording exception on a span (#3262)
* Add benchmark for recording exception on a span

* Spotless
2021-05-27 11:20:41 -07:00
Nikita Salnikov-Tarnovski fc4b154dcb
Add a benchmark comparing OTLP and Jaeger exporter (#3261)
* Add a benchmark comparing OTLP and Jaeger exporter

* Spotless
2021-05-27 08:12:49 -07:00
Anuraag Agrawal 608f431479
Remove null checks from SdkSpanBuilder (#3244) 2021-05-21 13:45:26 -07:00