Commit Graph

205 Commits

Author SHA1 Message Date
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
Anuraag Agrawal 672330bf51
Upgrade to Gradle 7.0 (#3228) 2021-05-13 08:21:22 +09:00
John Watson 15a1160e56
clean up the package-level docs for the sdk trace export package. (#3208)
Resolves #2903
2021-05-07 08:15:41 +09:00
John Watson 7c9ea8b0f6
default the tracer name to an empty string (#3170) 2021-04-28 10:24:17 -07:00
HaloFour 7d31cddf19
Add Span#setAllAttributes method to add Attributes to a Span (#2799) 2021-04-27 14:41:26 -07:00
John Watson f5c1e0d799
Auto-detect Android and use an Android-friendly IdGenerator instance. (#3176)
* Auto-detect Android and use an Android-friendly IdGenerator instance.

* simplify the random initialization

* Make the AndroidFriendlyRandomIdGenerator even simpler by just keeping a single Random instance
2021-04-27 15:37:02 +09:00
Harshita Srinivas 4bb99964c1
Updated TestClientServer timer execution in Java8 (#3159)
* fixed timer execution in Java 8

* spotless apply

* Updated ClientServer

* Optimised ClientServer timer execution
2021-04-16 13:09:31 +09:00
Anuraag Agrawal c4f612ee5e
Update dependencies (#3105) 2021-04-05 08:49:05 -07:00
Anuraag Agrawal 2f2af19358
Replace ArrayBlockingQueue with jctools queue. (#3034)
* Replace ArrayBlockingQueue with jctools queue.

* Finish

* ArrayQueue

* Fix dependency

* Drift

* Memory note

* Iteration
2021-03-31 15:09:25 +09:00
John Watson 14fd81a8b9
Rename GlobalMetricsProvider to GlobalMeterProvider (#3048) 2021-03-29 08:09:24 -07:00
sbandadd 085eb9d87c
Optimize batch span processor (#2983)
* Optimize batch span processor

Description:
Batch span processor currently is aggressive in the sense that any new spans are sent to the exporter,
this involves lots of overhead from signaling under heavy load and overhead from constant polling by exporter thread
under less load. This PR makes exporter thread wait for maxExportBatchSize to avoid busy polling of the queue.

BatchSpanProcessorMultiThreadBenchmark.java result
![image](https://user-images.githubusercontent.com/62265954/111420486-893c7300-86a8-11eb-8f87-feb2f86f00fc.png)

BatchSpanProcessorCpuBenchmark.java result
![image](https://user-images.githubusercontent.com/62265954/111420492-8e012700-86a8-11eb-800e-7de1fbe2c2b1.png)

* More predictable signaling
2021-03-19 11:47:59 +09:00
sbandadd 23ce8fe392
Add batch span processor benchmarks (#3017)
Description:
This PR adds two benchmarks.

1. Current benchmark executs forceFlush() on every loop and creates a bottleneck which results in not stressing batch span processor. Current benchmark only
measures throughput which is not helpful on its own since number of spans getting exported is also important. BatchSpanProcessorMultiThreadBenchmark is created to address this issue.
2. Measuring CPU usage of exporter thread is also important, but the current benchmarks consumes as much CPU as possible which makes the measurement not meaningful.
To maintain a steady state, this PR creates a benchmark that generates 10k spans per second per thread. One would need to attach a profiler such as yourkit or JProfiler
to the benchmark run to understand the processor's CPU usage. BatchSpanProcessorCpuBenchmark is created for this purpose.

This PR also fixes a bug in calculating number of dropped/export spans. Earlier dropped and exported spans were actually counting the other one.

This PR also fixes a big in calculating number of dropped/export spans. Earlier dropped and exported spans were actually counting the other ones.
2021-03-17 14:47:41 +09:00
Anuraag Agrawal f113c03483
Ignore null / invalid spancontext and handle null attributes for links. (#2985)
* Ignore null / invalid spancontext and handle null attributes for links.

* Cleanup

* Fix
2021-03-07 09:03:33 -08:00
Anuraag Agrawal edf08d7bc1
Have SimpleSpanProcessor keep track of pending exports and wait for t… (#2989)
* Have SimpleSpanProcessor keep track of pending exports and wait for them when flushed.

* Fix CompletableResultCode.ofAll(empty)

* Cleanup
2021-03-07 09:02:45 -08:00
Anuraag Agrawal f553aa0a6b
Add an internal GuardedBy annotation to enable our own error prone ch… (#2978)
* Add an internal GuardedBy annotation to enable our own error prone checker without affecting downstream.

* Method
2021-03-05 11:37:24 +09:00
John Watson a14dfd9f46
fix the BatchSpanProcessorDroppedSpansBenchmark for metrics SDK updates (#2981)
* fix the BatchSpanProcessorDroppedSpansBenchmark for metrics SDK updates

* formatting
2021-03-04 15:43:20 -08:00
Anuraag Agrawal 64ed0415d2
Don't copy events toSpanData if ended. (#2979) 2021-03-04 08:13:39 -08:00
Anuraag Agrawal a33a4ed036
Don't fail on timeout / interrupted since the result isn't really don… (#2957)
* Don't fail on timeout / interrupted since the result isn't really done yet.

* Fix test

* warning
2021-03-03 13:48:51 -08:00
jason plumb 47c96b5dd9
Fix trace benchmark (#2974)
* fix address passed to span processor, which was causing benchmark to not run.

* started some docs on how to run jmh
2021-03-03 10:55:41 -08:00
Anuraag Agrawal 0d467ab670
Pass unmodifiable list to exporters (#2938) 2021-02-26 07:47:34 -08:00
Anuraag Agrawal b393a587dd
Have AttributesMap extend HashMap instead of contain LinkedHashMap (#2906)
* Reduce HashMp allocations for AttributeMap.

* Finish

* Add comment on why wrapper is actually needed.
2021-02-24 09:24:25 -08:00
Bogdan Drutu 3490002234
Move semconv dependency as implementation, not exposed in the API (#2918)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-23 08:45:21 -08:00
Bogdan Drutu 9e1c76b324
Do not allow null description in the StatusData (#2896)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-22 15:31:45 -08:00
Bogdan Drutu a1c25ec784
Move otproto to otlp:internal, so can be marked as stable (#2893)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-20 14:39:27 -08:00
Bogdan Drutu 93dd38a18d
Ensure ParametersAreNonnullByDefault is present in all packages (#2879)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-18 08:58:01 -08:00
Anuraag Agrawal 8f787275fc
[Breaking Change] Make TraceId.getTraceIdRandomPart private (#2839)
* Move traceidrandom

* Make BigEndianEncoding public-internal to use for Android compatibility.

* Rename BigEndianEncoding to sound less useful if accidentally imported.
2021-02-17 16:59:54 -08:00
Anuraag Agrawal 4623334c7c
Move Getter/Setter to top level (#2840) 2021-02-17 09:46:56 -08:00
Anuraag Agrawal fa8bb33646
[Breaking Change] Rename API getDefault to noop! (#2842)
* Noop!

* errorprone
2021-02-17 09:18:22 -08:00
Anuraag Agrawal 224845b6b1
[Breaking Change] Remove attribute value truncation. (#2841) 2021-02-17 09:08:39 -08:00
John Watson f83c21638a
[Breaking Change] Rename TraceStateBuilder.set() to put() (#2830)
Provisionally resolves #2746
2021-02-17 08:16:24 -08:00
John Watson 20a1601089
[Breaking Change] Rename getEmpty() to empty() (#2831) 2021-02-17 08:15:23 -08:00
Anuraag Agrawal ebaceb74a1
Simplify ParentBased equals/hashcode and add coverage. (#2823) 2021-02-17 08:41:21 +09:00
Anuraag Agrawal 23adacaf2e
Use empty default for null attributes and discard for null unit (#2777)
* Use empty / millisecond default for null attributes / unit

* Discard
2021-02-16 09:39:02 -08:00
John Watson cacf0f18f4
Clarify the implementation of the BatchSpanProcessor forceFlush implementation (#2807)
* Clarify the implementation of the BatchSpanProcessor forceFlush implementation

* insert missing word here
2021-02-11 16:15:05 -08:00
John Watson 74b0e9cc7e
Update the span limit defaults to be 128, per spec 1.0.0 (#2798) 2021-02-10 20:01:56 -08:00
Anuraag Agrawal 5c0ea253a5
Add docs about recommendations regarding traceidratiobased sampler (#2791) 2021-02-09 19:47:12 -08:00
John Watson 8898e4c441
save the already known state of SpanContext validity (#2769) 2021-02-08 18:26:02 -08:00
Bogdan Drutu ff5529a422
Partially reverts #2750 (#2756)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-08 12:33:34 -08:00
Anuraag Agrawal 522953bd8f
Restore Trace/SpanId.fromBytes (#2750)
This reverts commit d6fea3a70a.
2021-02-08 07:42:49 -08:00
John Watson eb529cb26d
Revert the SpanContext trace/span id accessor methods. (#2749) 2021-02-08 09:51:49 +09:00
Bogdan Drutu dbfd07faf8
[BREAKING CHANGE] Remove not very used method from SpanData (#2722)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:34:54 -08:00
Bogdan Drutu 07b5ebe868
[BREAKING CHANGE] Remove not very used method from SpanData (#2723)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:34:17 -08:00
Bogdan Drutu e187c18112
Consistent name for Trace/Span ids getters with the specification (#2721)
See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#retrieving-the-traceid-and-spanid

Not breaking change since methods were just renamed anyway.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:33:32 -08:00
Bogdan Drutu eb7e212587
Mark interfaces in trace/data immutable (#2729)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:30:17 -08:00
Bogdan Drutu d6fea3a70a
Remove helper methods fromBytes from Trace/Span Id (#2727)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:29:51 -08:00
Bogdan Drutu d932baa919
Remove trivial usage of fromLong[s] methods (#2730)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 20:28:00 -08:00
Bogdan Drutu 6c30f411f3
Change TraceFlags to be a class, expose all helpers of the class itself. (#2709)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-05 09:06:19 -08:00
John Watson f543fe85f8
Add javadoc to the package-info.java for Sampling (#2694)
* Add javadoc to the package-info.java for Sampling
and update some javadoc for parent-based Samplers.

* Suppress linelength for package-info

* tweak some language, add a link to the spec

* pin the url to a specific SHA

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-02-04 10:56:32 -08:00
Bogdan Drutu bc326c6c0d
Clarify thread-safety requirements for SDK components, fix small issues (#2708)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-04 09:16:23 -08:00
Bogdan Drutu 77d993d653
[BREAKING CHANGE] Cleanup TraceId/SpanId classes. Ensure consistency. (#2696)
Summary of changes:
* getHexLength renamed to getLength
* bytesFromHex/bytesToHex renamed to asBytes/fromBytes.
* bytesFromHex/bytesToHex renamed to asLongHigh/asLongLow
* Update javadoc.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-04 07:38:25 -08:00
Bogdan Drutu 0b250c1c91
Cleanup usages of TraceState and TraceFalgs (#2697)
* Avoid calling TraceState.builder().build() and replace it with TraceState.getDefault();
* Avoid storing TraceFalgs.getDefault() and TraceFalgs.getSampler() and use them directly;

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 18:39:52 -08:00
Anuraag Agrawal b8c5acd3ff
Rename TraceConfig -> SpanLimits and move to upper package. (#2686) 2021-02-04 09:10:05 +09:00
Bogdan Drutu 88e760d01c
[BREAKING CHANGE] Remove AsHexString suffix from ids getters. (#2684)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 10:40:43 -08:00
John Watson 687c3b082c
Update the check in the tracer to see if the SDK has been shut down. (#2673)
* Update the check in the tracer to see if the sdk has been shut down.
This changes the logic so that we only need to have called shutdown on the TracerSharedState, not that it has successfully shut down.

* remove the lock in the hot path
2021-02-03 08:13:57 -08:00
Bogdan Drutu 506a49b48f
Fix SpanWrapper toString to avoid duplicates (#2671)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-03 08:04:34 -08:00
Bogdan Drutu 19c002471e
Move Span.Kind to the upper level as SpanKind (#2646)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-02 12:27:54 -08:00
Bogdan Drutu 301a29d7a3
Move labels outside of the stable package (#2647)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-02 10:24:06 -08:00
Bogdan Drutu 527b5f4549
Expose the SpanContext to the SpanData (#2660)
This helps exporter to have access directly to bytes, hex or any other format we will expose for the ids in the SpanContext.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-02 08:54:26 -08:00
Bogdan Drutu c048ab8954
Mark SamplingResult as immutable (#2630)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-01 09:48:29 -08:00
Bogdan Drutu 3423c008a4
Remove unnecessary public method (#2622)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-01 12:24:27 +09:00
Anuraag Agrawal 6eee5ba4ae
Update dependencies (#2618)
* Update dependencies

* Inline annotations

* Revert "Inline annotations"

This reverts commit 8facc4ddbe.

* Unmodifiable
2021-02-01 12:21:00 +09:00
Bogdan Drutu 4bad109db5
Remove reference to not public class MultiSpanExporter (#2633)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-01 11:46:19 +09:00
John Watson d16e51f798
Remove the remaining deprecated code from the project. (#2612) 2021-01-29 19:26:42 -08:00
Anuraag Agrawal 1a56b8b0d8
Migrate api / sdk projects to build.gradle.kts (#2609) 2021-01-29 10:10:40 -08:00
Anuraag Agrawal 32a63fb8e3
Migrate to using gradle platform to manage dependency versions instea… (#2586)
* Migrate to using gradle platform to manage dependency versions instead of global variables.

* Remove unused and fix test

* Revert test yolo

* Workaround test ordering issue by just merging them

* Spot
2021-01-27 13:54:58 +09:00
Anuraag Agrawal 15fcadd8d7
Move Sampler to SdkTracerProvider (#2585)
* Move Sampler to SdkTracerProvider

* Better zpages

* Test
2021-01-26 20:32:49 -08:00
Anuraag Agrawal 760b012430
Migrate to guava JRE version (#2590) 2021-01-27 13:28:57 +09:00
John Watson 5dd187ed28
a few missed updates to remove _MILLIS to the BSP configs (#2574) 2021-01-22 14:55:36 -08:00
John Watson 1f84ec099b
Create a MANDATORY Resource instance containing mandatory attributes. Merge that into the default resource. (#2366)
* Assign a fallback service name to resources when building the signal Provider instances.

* Add a MANDATORY resource that will contain all mandatory attributes.

* some cleanups of leftover stuff

* make the MANDATORY resource instance private

* updates from ResourceAttributes changes

* be sure to set the service name in the jaeger tests
2021-01-21 09:01:16 -08:00
Anuraag Agrawal 58bcf7fe88
Deprecate tracermanagement and SDK global access (#2547)
* Deprecate SdkTracerManagement

* Deprecate global SDK

* Deprecate more

* Fix

* Cleanup

* Fix

* Handle test order random

* Collector removed queued_retry
2021-01-21 14:39:32 +09:00
Anuraag Agrawal adbed0c0fd
Remove remaining 0.14.0 deprecated stuff. (#2544) 2021-01-19 09:21:44 -08:00
Anuraag Agrawal 3f445538c4
Move sampling Decision to top-level (#2546)
* Move sampling Decision to top-level

* Merge
2021-01-18 14:12:14 +09:00
Anuraag Agrawal 77d7c02820
Deprecate BatchSpanProcessor.setExportOnlySampled (#2545) 2021-01-18 14:00:22 +09:00
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 6bee59e912
Remove OpenTelemetry SPI (#2504) 2021-01-14 11:35:41 +09:00
Anuraag Agrawal e0f6260bc9
Remove ConfigBuilder and deprecated exporter constants / timeouts (#2506)
* Remove deprecated usage from exporters

* Remove ConfigBuilder and deprecated exporter settings.
2021-01-14 09:31:03 +09:00
Bogdan Drutu 53f0e30776
Extract inner classes from metrics API (#2517)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-13 15:26:21 -08:00
Bogdan Drutu 957bd0ad1c
Move jmh benchmarks to the artifact that is testing (#2515)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-13 14:05:51 -08:00
Anuraag Agrawal 03558c3153
Remove TracerProvider mutators (#2503) 2021-01-13 09:07:33 -08:00
Anuraag Agrawal 86cd56441c
Deprecate StatusData.isUnset (#2500)
* Deprecate StatusData.isUnset

* Cleanup

* option 2
2021-01-13 13:58:30 +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