Commit Graph

803 Commits

Author SHA1 Message Date
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 439c7c5c79
Remove metrics specific helpers from internal.StringUtils (#2663)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-02 08:21:36 -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 b4218426ee
Prevent setting global OpenTelemetry twice. (#2548)
* Prevent setting global OpenTelemetry twice.

* Unneessary volatile

* Separate testing class

* Cleanup

* Delete

* Update api/all/src/main/java/io/opentelemetry/api/GlobalOpenTelemetry.java

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

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-01-21 13:55:46 +09:00
John Watson 2afae7b024
Reverse the direction of the Resource.merge (#2542) 2021-01-20 08:10:07 -08:00
John Watson 66ca483ede
Generate the ResourceAttributes class (#2540)
* Generate the ResourceAttributes class
* deprecate the old one
* convert usages to the new one

* re-use the template with some special logic for the addition

* deprecate the old resource attributes in the wrong class
2021-01-19 23:02:11 -08: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 4f8de1521b
Make OpenTelemetrySdk propagators final (#2543) 2021-01-18 14:01:37 +09:00
Anuraag Agrawal 77d7c02820
Deprecate BatchSpanProcessor.setExportOnlySampled (#2545) 2021-01-18 14:00:22 +09:00
Bogdan Drutu 4720911d66
Add initial support to define temporality per aggregator (#2534)
In this PR there are quiet some changes:
* Default aggregation for Sum/UpDownSum observers is changed to Sum, now that the sum knows how to produce cumulative for different types of instruments.
* SumAggregationFactory has an argument that allows to configure to produce always cumulative or delta for all types except sum/updownsum observers.
* `toMetricPoint` now accepts all available timestamps start, last collection, now and can decide which one to use.
* LastValue produces only gauge metrics now. The start time is always 0 (a.k.a. unset).

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-15 11:55:18 -08:00
Bogdan Drutu c3574c47de
Move InstrumentProcessor initialization in the Accumulator (#2529)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-14 15:09:49 -08:00
Bogdan Drutu 2bc0541a3a
When creating aggregator pass resource and instrumentation library info. (#2528)
Avoid passing these info again when converting to metrics, and make every aggregator store this.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-14 13:27:14 -08:00
Bogdan Drutu 32747ba1d3
Update metric data util in the aggregator, remove unnecessary helpers (#2520)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-14 09:35:15 -08: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
Bogdan Drutu 04b6b51b5d
Remove deprecated methods from metrics (#2509)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-13 10:31:32 -08:00
Bogdan Drutu c405579419
Remove public from classes/methods that don't need to be (#2510)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-13 10:31:03 -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
Bogdan Drutu ca661b8c40
Avoid using inner classes in SpanData (#2495)
* Avoid using inner classes in SpanData

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

* Javadoc cleanups

* Remove non-existent type param

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-01-12 19:12:00 -08:00
Bogdan Drutu 61eafc62eb
Avoid using inner classes in MetricData (#2493)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-13 11:31:24 +09:00
Bogdan Drutu 488d6b68db
Avoid passing the time to collect by calling the producer public method (#2490)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-12 15:17:58 -08:00
Bogdan Drutu 9175d94f8a
For async instrument tests call the public metric producer method, instead of passing timestamp (#2492)
* Implement MetricProducer directly by the SdkMeterProvider

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

* Call the public metric producer method, instead of passing timestamp

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-12 14:51:33 -08:00
Bogdan Drutu a6d2047b23
Implement MetricProducer directly by the SdkMeterProvider (#2489)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-12 14:51:05 -08:00
Bogdan Drutu cd8c13b905
Add tests for the default meter name (#2491)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-12 13:34:31 -08:00
Bogdan Drutu 1523bbb43e
Rename testSdk with sdkMeter to match the class name (#2488)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-12 12:46:08 -08:00
Bogdan Drutu 0e9e993a58
Create SdkMeter via provider, simplifies initialization logic (#2487)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-12 12:36:55 -08:00
Bogdan Drutu 2ae096044c
Update tests for sync instruments, test for whole data, consistent tests, fix names (#2486)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-12 12:36:39 -08:00
Bogdan Drutu 172a1fc39f
Ensure that all points produce for a metric and all metrics have same start/end timestamps (#2473)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-11 08:10:00 -08:00
Bogdan Drutu f9bf909372
Pass the whole instrument descriptor to the Aggregator factory (#2472)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-09 15:30:04 -08:00
Anuraag Agrawal 620969556f
Cleanup OTLP exporter timeout settings. (#2446)
* Cleanup OTLP exporter timeout settings.

* error prone
2021-01-09 15:32:20 +09:00
Bogdan Drutu 890015b082
Some small fixes in the metrics (#2471)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-08 16:25:47 -08:00
Bogdan Drutu 72dd37b757
Extract Builder as a top-level class (#2469)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-08 15:39:50 -08:00
Bogdan Drutu f71c48bd4e
Cleanup ViewRegistry, move processor creation to InstrumentProcessor (#2467)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-08 12:05:47 -08:00
Anuraag Agrawal 62251dd3d2
Accept TimeUnit and Duration for BSP values instead of forcing millis. (#2444)
* Accept TimeUnit and Duration for BSP values instead of forcing millis.

* Test invalid

* Clean
2021-01-08 11:44:51 -08:00
Bogdan Drutu 757cd79889
With all the operations on the Aggregator, no need to define Accumulation (#2462)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-08 08:28:08 -08:00
Anuraag Agrawal d93a4b2585
Fix logging statement for java version (#2464) 2021-01-08 14:05:40 +09:00
Anuraag Agrawal 75e01110e4
Deprecate OpenTelemetry SPI. (#2453) 2021-01-08 13:37:44 +09:00
Bogdan Drutu 1c40444da3
Remove aggregation and merge functionality into aggregator (#2460)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-07 16:29:45 -08:00
Anuraag Agrawal 4b8a0c8591
Add TraceConfig.builder() (#2445) 2021-01-07 10:02:53 -08:00
Anuraag Agrawal bdbab03332
Deprecate ConfigBuilder. (#2442) 2021-01-07 08:52:39 -08:00
John Watson aa8433d87f
Add a test for the RECORD_ONLY span (#2440)
And remove the old TODOs from the BSP test.
2021-01-06 18:23:08 -08:00
John Watson e1cf785475
Have a default span name in case instrumentation sends in a blank/empty/null name (#2433)
* Have a default span name in case instrumentation sends in a blank/empty/null name.

* add a test for the null name
2021-01-07 09:01:05 +09:00
John Watson 015708b7a7
Move the semantic conventions generated code into its own module (#2423)
* Move the semantic conventions generated code into its own module

* remove un-needed dependencies

* move the semconv module to the top level, out of the API namespace

* Update README.md

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

* move SemanticAttributes to a more appropriate package and deprecate the old ones in the api package.

* Apply suggestions from code review

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-01-06 08:25:17 -08:00
John Watson 3b3f1ae540
Change the SdkTracerManagement shutdown method to return CompletableResultCode (#2422)
* Change the SdkTracerManagement shutdown method to return CompletableResultCode

* protect against a possible NPE due to a race condition

* cleanup from PR feedback

* move the mock to where it's used.
2021-01-06 08:23:49 -08:00
Anuraag Agrawal 4121cdc693
Remove sampling probability attribute when was not accepted to spec. (#2432)
* Remove sampling probability attribute when was not accepted to spec.

* Remove unused

* Remove unused
2021-01-06 08:03:29 -08:00
Anuraag Agrawal 6cf8f934b1
Update dependencies (#2427)
* Update dependencies

* Brave
2021-01-06 16:32:18 +09:00
Anuraag Agrawal fe78126aed
Use logunit instead of tedious jul handler modifications for testing (#2425) 2021-01-06 09:30:35 +09:00
Anuraag Agrawal 3eda37ad7f
Have projects set their release state to alpha instead of recognizing word metrics (#2428) 2021-01-05 09:07:18 -08:00
Anuraag Agrawal 4dbbe807c9
Deprecate addSpanProcessor mutator (#2385) 2021-01-04 08:43:52 -08:00
Bogdan Drutu 450db6c2b2
Change MetricData to expose the Point type that is expected for each data type (#2413)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-01-03 08:32:52 -08:00
Anuraag Agrawal 70876ed4ad
Add SdkMeterProviderBuilder.buildAndRegisterGlobal (#2407) 2021-01-01 13:45:15 -08:00
Bogdan Drutu 838be8ef8e
Move accumulations to a different package (#2412)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-28 17:52:20 -08:00
Anuraag Agrawal 66d08f4f00
Deprecate updateActiveTraceConfig (#2405)
* Deprecate updateActiveTraceConfig

* Spot

* Foo

* Spot++
2020-12-25 11:11:54 +09:00
Anuraag Agrawal f8f409bae5
Rename OpenTelemetrySdkBuilder.build to buildAndRegisterGlobal and ad… (#2387)
* Rename OpenTelemetrySdkBuilder.build to buildAndRegisterGlobal and add non-registering version.

* Some clean
2020-12-25 11:04:02 +09:00
Bogdan Drutu b1a22e03a6
Rename Aggregator -> AggregatorHandle; AggregatorFactory -> Aggregator (#2395)
* Rename Aggregator -> AggregatorHandle; AggregatorFactory -> Aggregator

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

* Update comments for Aggregator and AggregatorHandle

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-24 08:11:18 -08:00
Anuraag Agrawal 2d1bdaff73
Merge non-metrics API into API artifact. (#2369)
* Merge non-metrics API into API artifact.

* Revert kotlin newline
2020-12-24 14:13:54 +09:00
Bogdan Drutu 241ae28a44
Make the toMetricsData to use generic map of labels to accumulations (#2397)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-24 08:49:28 +09:00
Anuraag Agrawal 9f675da85a
Remove usage of updateTraceConfig in tests. (#2402)
* Remove usage of updateTraceConfig in tests.

* Clean
2020-12-23 08:15:50 -08:00
Anuraag Agrawal 24ef29efea
Add SimpleSpanProcessor.create and deprecate SimpleSpanProcessorBuilder (#2374)
* Deprecate SimpleSpanProcessorBuilder

* Null test
2020-12-23 12:31:02 +09:00
Bogdan Drutu fa507d4e7c
Make Aggregation generic, so we can ensure type safety between compon… (#2394)
* Make Aggregation generic, so we can ensure type safety between components

This ensures that we pass the correct type of Accumulation between components inside the SDK.

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

* Adress feedback

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-22 19:13:29 -08:00
Anuraag Agrawal d48eab6aa9
Allow registering TraceConfigSupplier and use it from zpages. (#2390)
* Allow registering TraceConfigSupplier and use it from zpages.

* Finish

* Remove unnecessary method

* Same method name
2020-12-23 11:52:17 +09:00
Anuraag Agrawal 8fc4e627ca
Reduce usage of GlobalOpenTelemetry (#2386)
* Reduce usage of GlobalOpenTelemetry

* Cleanup
2020-12-23 10:17:46 +09:00