Commit Graph

360 Commits

Author SHA1 Message Date
Josh Suereth 95551dbbdb
Finish wiring exemplars into metrics SDK (#3599)
* 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.

* Expose aggregation configuration and wire in exemplar sampler

- Expose classes for aggregation configuration that are visible in exemplar sampler
- Create default exemplar sampler that samples w/ traces
- Expand metric benchmarks to include exemplar + no-exemplar to check overhead.

* Fix merge conflict.

* Wire exemplar filter config into autoconfigure module.

* Expose aggregation configuration and wire in exemplar sampler

- Expose classes for aggregation configuration that are visible in exemplar sampler
- Create default exemplar sampler that samples w/ traces
- Expand metric benchmarks to include exemplar + no-exemplar to check overhead.

* Fix merge conflict.

* Wire exemplar filter config into autoconfigure module.

* Migrate exemplar reservoir instantiation into aggregations.  Start migrating off AggregatorFactory -> Aggregation.

* Small cleanup.

* Fixes from review (and report of clsasloader fixes from other laptop.

* Migrate to null-object pattern.

* Add internal boilerplate.

* Run spotless.

* Fix toString of aggregation values.

* Fix ==
2021-09-24 13:55:46 -07:00
Anuraag Agrawal b1e1c47403
Don't use hashmap for zpage buckets since the keys are constant. (#3649) 2021-09-22 09:02:14 -07:00
Anuraag Agrawal b311d50d03
Fix some nullness. (#3647)
* Fix some nullness.

* Log
2021-09-22 09:00:57 -07:00
Anuraag Agrawal a262a1eb2a
Make LogRecord required parameters final. (#3648) 2021-09-22 08:34:52 -07:00
Anuraag Agrawal b88bfe16cc
Use repo ghcr images for integration tests. (#3644) 2021-09-22 08:28:09 -07:00
Anuraag Agrawal 0cef3f79b5
Migrate Jaeger exporter to marshaler (#3625)
* Migrate Jaeger exporter to marshaler

* Remove Jaeger protos from public API

* Separate our jaeger-proto artifact.

* Move

* Cleanups

* Spot
2021-09-21 07:40:15 -07:00
John Watson 04455a7ef1
Rename the logging AnyValue to Body and allow only String values for now. (#3624)
* Rename AnyValue to Body and allow only String values for now.

* Apply suggestions from code review

Thanks Jason!

Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com>

* Convert Body to an interface.

* update from upstream changes

* move the StringBody into its own, non-public class

Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com>
2021-09-18 10:13:15 +09:00
Anuraag Agrawal c7c4252142
Update more dependencies. (#3631) 2021-09-18 10:09:15 +09:00
jack-berg a1ea0d5ce1
Remove experimental prefix from otlp protocol config properties (#3622)
* Remove experimental prefix from otlp protocol config properties

* Restore experimental otlp protocol configuration options, but mark as deprecated.
2021-09-17 12:17:52 +09:00
ran8080 5643958493
Implement LogAdapter (#3588)
* Created an empty LogAdapter class and started reading equivalent implementation of SpanAdapter

* Started implementing LogAdapter, added Resource and InstrumentationLibraryInfo to LogRecord.

* Started implementing LogAdapter, added Resource and InstrumentationLibraryInfo to LogRecord.

* Continue the implementation of LogAdapter.

* Finished implementing LogAdapter.java, now moving on to writing a test for it.

* started implementing LogAdapterTest functions.

* Fixed error in log adapter

* Added Java docs

* Fixed errors with build.

* Finished LogAdapterTest

* Fixed PR Comments.

* Added "internal class boiler plait comment" to LogAdapter

* CR fixes.

* CR fixes.

* Fixed CR requests

* Fixed CR requests

* Fixed CR requests

* Update exporters/otlp/common/src/main/java/io/opentelemetry/exporter/otlp/internal/LogAdapter.java

Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>

* Update sdk/testing/build.gradle.kts

* Update exporters/otlp/common/build.gradle.kts

* Test dependency

Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-09-17 12:16:58 +09:00
Anuraag Agrawal 72d33c4153
Update autoconfigure README (#3615) 2021-09-14 07:53:28 -07: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 2670fe2926
Add autoconfigure support for OTLP gzip compression (#3589)
* Add autoconfigure support for OTLP gzip compression

* Respond to PR feedback.
2021-09-10 13:03:21 +09:00
Anuraag Agrawal 856a9955e5
Rename ConfigProperties.getList / getMap. (#3593) 2021-09-10 11:33:01 +09:00
Anuraag Agrawal 4af95fc3e6
Catch exceptions when loading a configurable SPI. (#3579)
* Catch exceptions when loading a configurable SPI.

* Warn when it's the requested configurable.

* Clean
2021-09-08 11:19:46 +09:00
Josh Suereth 8d91eaee1b
Rework LabelsProcessor to have access to context - Update View SDK API (#3562)
* Rename LabelsProcessor to attribtues processor and allow it to interact with context/baggage appropriately.

* Flesh out view API from SDK specification and add tests for new features.

* Add better end-to-end test of baggage/context usage in attributes processor.

* Shrink size of attributes processor from early prototype.

* Reduce public aggregator API to match latest specification. (#3557)

* Move aggregators to internal package so it's not exposed in public API for first release.

* Continue migrating aggregators to hidden api, expose new public api.

* Fix tests.

* Fix up some name issues.

* Fix up javadoc.

* Fix autoconfigure tests.

* Minor cleanups.

* Fixes from review.

* Fixes from review.

* Remove aggregation extension and update tests.

* Fixes from review.

* Fix merge conflicts.

* update from PR feedback.

* Run spotless.

* Fixes from review.
2021-09-03 10:59:02 -07:00
Anuraag Agrawal 9fa98de1cb
Separate gRPC and HTTP OTLP tests (#3574) 2021-09-03 06:37:03 -07:00
Anuraag Agrawal 29cc44ed08
Update to Gradle 7.2 (#3572)
* Update to Gradle 7.2

* Only block properties we use in security manager instead of all of them.
2021-09-02 13:17:29 +09:00
Anuraag Agrawal e8f054615e
Separate out autoconfigure-spi artifact with tracing autoconfiguratio… (#3570)
* Separate out autoconfigure-spi artifact with tracing autoconfiguration SPI.

* Split
2021-09-01 10:21:01 -07:00
Josh Suereth 3c1c863a98
Reduce public aggregator API to match latest specification. (#3557)
* Move aggregators to internal package so it's not exposed in public API for first release.

* Continue migrating aggregators to hidden api, expose new public api.

* Fix tests.

* Fix up some name issues.

* Fix up javadoc.

* Fix autoconfigure tests.

* Minor cleanups.

* Fixes from review.

* Fixes from review.

* Remove aggregation extension and update tests.

* Fixes from review.
2021-09-01 08:12:54 +09:00
Anuraag Agrawal 98fdf9b4bc
Move ConfigProperties / ConfigurationException to SPI package and consistently pass ConfigProperties (#3558) 2021-08-31 12:55:36 +09:00
Anuraag Agrawal 6ef3091cfb
Copy in spotless-conventions from instrumentation repo (#3554)
* Copy in spotless-conventions from instrumentation repo.

* Reformat

* A few more dotfiles
2021-08-27 08:28:31 -07:00
Anuraag Agrawal 12a8936cb5
Disable Metrics SDK by default in autoconfigure. (#3555)
Also return the no-op API when there's no exporter.
2021-08-27 07:55:34 -07:00
jack-berg 4a945e63e3
Add gradle ktlint spotless config to all projects (#3543) 2021-08-25 08:36:17 +09:00
jack-berg ea4b6b4026
Refactor package to io.opentelemetry.exporter.otlp.http.metrics for c… (#3538)
* Refactor package to io.opentelemetry.exporter.otlp.http.metrics for consistency

* Fix package reference in MetricExporterConfiguration
2021-08-23 17:48:13 -07:00
jack-berg a0b0ab4e2c
Support comma separated list for exporters for otel.traces.exporter. (#3529)
* Support comma separated list for exporters for otel.traces.exporter.

* Respond to PR feedback.
2021-08-23 14:34:24 -07:00
jack-berg 16cfb66fc4
Add support for configuring OTLP protocol to autoconfigure module. (#3522) 2021-08-23 09:40:46 -07:00
jack-berg 3555965a34
Extract common OTLP config logic to utility function (#3525) 2021-08-20 12:32:11 -07:00
Anuraag Agrawal e868c82ff1
Use higher timeout for signal-specific timeout tests. (#3448) 2021-08-17 15:12:35 +09:00
jack-berg 58c16a9133
Add missing readmes and missing javadoc links (#3500) 2021-08-16 12:36:54 -07:00
jack-berg dd84ccaec7
Fix javadoc (#3499)
* Add javadoc links for otlp-http modules

* Fix otlp module javadoc links

* Fix logging exporter javadoc link

* Fix jaeger exporters javadoc links

* Fix prometheus exporter javadoc link

* Fix zipkin exporter javadoc link

* Fix extension annotations javadoc link

* Fix extension trace propagators javadoc links

* Fix sdk-extensions aws javadoc link

* Fix sdk-extensions async-processor javadoc links
2021-08-16 10:35:42 -07:00
Anuraag Agrawal 87f2b5e0a8
Update error-prone (#3485) 2021-08-13 09:44:29 -07:00
Anuraag Agrawal 08690412c0
Deprecate AwsXrayIdGenerator (#3478) 2021-08-13 09:18:13 -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
Pavol Loffay 0979e40526
Make Jaeger remote sampler available via SPI (#3368)
* Make Jaeger remote sampler available via SPI

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* use env vars

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* Add more tests

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* fix

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>

* fix

Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
2021-08-12 08:23:07 -07:00
jason plumb cb5198ba99
encapsulate Resource.getAttribute() to help with some law of Demeter violations. (#3468) 2021-08-12 09:06:31 +09:00
jack-berg ca416fe947
Fix merge conflict. (#3465) 2021-08-10 17:43:23 -07:00
Josh Suereth 29bd061399
Add a new configurable metric exporter to autoconf (for pluggable metric exporters like span exporters) (#3457) 2021-08-11 08:06:47 +09:00
Mateusz Rzeszutek 171c62cf05
Allow using custom configuration sources in sdk-autoconfigure (#3441)
* Allow using custom configuration sources in sdk-autoconfigure

* code review comments

* OpenTelemetryResourceAutoConfiguration

* Update sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/OpenTelemetrySdkAutoConfiguration.java

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

* code review comments

* method order

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-08-10 10:18:40 -07:00
John Watson 07d263a622
Add some explanation to the javadoc on the custom channel option. (#3452) 2021-08-09 08:08:20 -07:00
Anuraag Agrawal 8a597c6c6b
Allow Jaeger remote sampler to be closed. (#3446) 2021-08-06 09:50:05 -07: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
jack-berg 20f872d8dc
Add OTLP signal specific certificate autoconfiguration (#3439)
* Add setTrustedCertificates support to OtlpGrpcMetricExporterBuilder

* Add signal specific certificate configuration to autoconfiguration

* Improve test coverage.

* Try to meet code coverage requirements.

* Qualify SslUtil.setTrustedCertificatesPem
2021-08-05 17:10:48 +09:00
jack-berg 42831fe004
Add support for signal specific timeout and headers autoconfiguration. (#3434)
* Add support for signal specific timeout and headers autoconfiguration.

* Attempt to fix build.

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-08-03 10:43:45 -07:00
Trask Stalnaker 60c3c5ca0c
Format build.gradle.kts files (#3427) 2021-07-29 13:21:38 +09:00
John Watson daef9c147d
Provide an option to not set the autoconfigured SDK as the global. (#3419) 2021-07-21 20:51:13 -07:00
lo-jason 2cb461d4ae
#3308 Support adding container.id to resource metadata (#3321)
* Support adding container.id to resource metadta

* Address review comments

* Address review feedback

* Change containerResource to cached Resource factory

* Make method private

* Change to Paths and Files

* Fix bad merge and change regex

* Remove debug code, remove regex

* Add nullable annotation

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-07-21 16:40:57 -07: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
Anna Nosek f606a5b19b
Add documentation for OTEL_SERVICE_NAME (#3396)
* add doc for OTEL_SERVICE_NAME

* Update sdk-extensions/autoconfigure/README.md

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

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
2021-07-14 07:49:51 -07:00
Anuraag Agrawal f13fe7961d
Allow forceFlush of IntervalMetricReader, globally too for autoconfigure / agent. (#3385) 2021-07-09 22:46:40 +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
John Watson d8999911fc
Remove the AWS XRay sampler code (#3379)
* Remove the AWS XRay sampler code and deprecate the AwsXrayIdGenerator

* de-deprecate the AWS Xray ID Generator
2021-07-09 08:31:39 +09:00
Anuraag Agrawal a36cc90f90
Fix tests on Java 16+ and add 16/17-ea to CI. (#3370)
* Fix tests on Java 16 and add to CI.

* JDK for mockito

* Java 17
2021-07-08 13:41:29 +09:00
Anuraag Agrawal 431bb1281a
Use property to specify test java version instead of adding tasks. (#3365)
* Use property to specify test java version instead of adding tasks.

* Typo
2021-07-05 11:15:48 +09: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
Anuraag Agrawal 7134da1277
Add reservoir borrowing and statistics collection to x-ray sampler. (#3355)
* Add reservoir borrowing and statistics collection to x-ray sampler.

* Cleanup
2021-06-30 11:19:58 +09:00
Anuraag Agrawal f83a9531be
Add the actual XRay remote sampler which polls rules and orders / app… (#3343)
* Add the actual XRay remote sampler which polls rules and orders / applies them.

* Test cleanup

* Don't spam logs
2021-06-27 10:46:21 +09:00
Anuraag Agrawal e81e95df78
Add logic for processing a xray remote SamplingRule (#3341)
* Add logic for processing a xray remote SamplingRule

* Cleanup
2021-06-24 08:16:23 +09:00
Anuraag Agrawal 08ec61708a
Add support for fetching xray sampling targets. (#3335)
* Add support for fetching xray sampling targets.

* Cleanup
2021-06-23 08:16:42 +09:00
Anuraag Agrawal ce9c8854c7
Extract publishing and animalsniffer plugins. (#3334) 2021-06-22 08:23:16 +09:00
Anuraag Agrawal c3614b6b23
Add support for fetching xray sampling rules. (#3331)
* Add support for fetching xray sampling rules.

* Small tweak

* Remove unused

* Cleanup

* Creators
2021-06-21 13:26:42 +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 5f03e70628
Migrate protobuf logic to plugin (#3329)
* Migrate protobuf build logic to plugin

* Cleanup
2021-06-18 08:50:18 -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 39ec5bae65
Use autoconfigure SPI for trace-propagators extension. (#3294)
* Use autoconfigure SPI for trace-propagators extension.

* final
2021-06-08 09:01:00 +09:00
John Watson f63c7a0552
Update the metrics autoconfigure code with support for duration units. (#3282)
* Update the metrics autoconfigure code with support for duration units.

* rename variable!
2021-06-04 09:53:40 +09:00
John Watson 5b4763321e
Implement handling the OTEL_SERVICE_NAME env var. (#3253)
* Implement handling the OTEL_SERVICE_NAME env var.

* Update to use the semconv module and attributes testing helpers.

* add unit tests for testing API additions
2021-05-27 09:55:26 -07:00
John Watson b22d125acd
Update the OTLP protobuf version to 0.9.0. (#3233)
* Update the OTLP protobuf version to 0.9.0.
Note: this does not include enforcing the semantic change of requiring histogram/summary sums to be excluded when the recordings are not all positive.

* rename method to be more accurate
2021-05-18 16:47:22 -07:00
Anuraag Agrawal 672330bf51
Upgrade to Gradle 7.0 (#3228) 2021-05-13 08:21:22 +09:00
John Watson e6c1f65b09
Change the autoconfigure module to only have a test dependency on the semantic conventions module. (#3219) 2021-05-11 11:30:11 -07:00
Piotr Glazar 8722677e5c
Use JDK 10 API to fetch process pid (#3212) 2021-05-11 08:18:57 -07:00
John Watson 2a002f20fa
Make the EnvironmentResource public. (#3200) 2021-05-06 16:50:07 -07:00
John Watson aba088b135
Update the semantic convention classes for spec v1.3.0 (#3202) 2021-05-06 10:25:28 +09:00
John Watson cc4720de13
Add the option to configure the zipkin exporter timeout. (#3203) 2021-05-06 09:12:06 +09:00
John Watson 005b8c97ef
Add some javadoc to the new ExecutorServiceSpanProcessor & builder. (#3171) 2021-04-23 18:12:08 +09:00
Trask Stalnaker ea3d795cfb
Support otel.exporter.jaeger.timeout (#3145)
* Support otel.exporter.jaeger.timeout

* Mention milliseconds

* Update sdk-extensions/autoconfigure/README.md

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

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-04-20 09:48:54 -07:00
Piotr Glazar 68b047e027
BatchSpanProcessor that uses provided ScheduledExecutorService (#3036)
* BatchSpanProcessor that uses provided ScheduledExecutorService

* Fixing spotless violations

* Checkstyle fix

* Spotless fix

* Fixing spotless violations

* Fixing checkstyle violations

* Fixing spotless violations

* Moving the code to the incubator module

* Delete obsolete gradle module

* Copy BatchSpanProcessor benchmarks to be used by ExecutorServiceSpanProcessor

* spotless fixes

* Better thread utilisation

* After merge main

* Convert AtomicBoolean into local variable

* Remove WorkerBase and introduce WorkerExporter

* More code review fixes
2021-04-20 09:28:36 -07:00
YuDong Tang b3860d4e1e
add host.name as default attribute by add HostResourceProvider (#3162)
* add HostResourceProvider

* add host.arch
2021-04-16 08:12:43 -07:00
John Watson fb9cb2239e
Have the B3Propagator only include the relevant fields for injection format. (#3154)
See this spec change from v1.2.0: https://github.com/open-telemetry/opentelemetry-specification/pull/1570
2021-04-15 08:53:02 +09:00
John Watson e52969d94c
Update the CHANGELOG as of APR-02-2021 and add @since tags for new APIs. (#3098) 2021-04-05 07:49:38 -07:00
jack-berg 415ed22ec4
Add autoconfiguration SdkMeterProviderConfigurer SPI. (#3060) (#3079) 2021-04-02 07:59:46 -07:00
Anuraag Agrawal 40c430e3a8
Fix merge and pin ubuntu to 18.04 to workaround SSL issue (#3092)
* Fix merge

* Add logging decorator

* Try older ubuntu

* Update all workflows
2021-04-01 18:35:36 -07:00
Anuraag Agrawal 11bda8c9e9
Fix flaky test (#2958) 2021-04-01 12:26:58 -07:00
John Watson 5c18578538
Introduce a ThrottlingLogger wrapper and use for error logging in exporters (#3051)
* initial implementation of logging throttling

* simplify the throttle and incorporate into all the exporters

* small cleanup

* try the ratelimiter and see if it can work

* try the ratelimiter and see if it can work

* re-implement the ThrottlingLogger using the RateLimiter from Jaeger.

* code cleanup & additional tests

* add a unit test for the log level check

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

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

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-03-31 20:36:02 -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
John Watson fea5ecc0be
Don't auto-start the IntervalMetricReader in the constructor. (#3026)
* Don't auto-start the IntervalMetricReader in the constructor.

* a little more protection around the possibility of double-starting the IMR

* add a test that verifies we only start once

* tweak the values to see if CI likes it better

* make the test simpler for CI

* try a little bit longer time?

* change the test to make an assertion on a passed-in scheduler.
2021-03-19 08:23:23 +09:00
Anuraag Agrawal f5e0a82e04
Add ConfigurableSamplerProvider to allow custom samplers in agent, etc (#3029) 2021-03-17 13:33:22 +09:00
Prathik Kaliyambath 5f32df7b9b
fixed docs (#3028) 2021-03-13 10:36:04 -08:00
John Watson 84052a8ce9
Update the SemanticAttributes and ResourceAttributes for specification v1.1.0 (#3016)
Note: this contains breaking changes to ResourceAttributes.
2021-03-12 07:58:48 -08:00
Chris Marks 72db16e58e
Update description on otel.exporter.otlp.headers to indicate using commas, not semicolons. (#3019) 2021-03-11 20:47:52 -08:00
Anuraag Agrawal 9d4b123174
Fix AWS detectors to initialize singleton after statics (#3008) 2021-03-11 10:20:56 +09:00
John Watson 8678b16b29
Implement a leak-detecting SpanProcessor using the WeakConcurrentMap … (#2984)
* Implement a leak-detecting SpanProcessor using the WeakConcurrentMap from the context internals.

* remove unnecessary double-wrapping of the throwable in the logs

* formatting

* Update sdk-extensions/tracing-incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/trace/LeakDetectingSpanProcessor.java

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

* Update sdk-extensions/tracing-incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/trace/LeakDetectingSpanProcessor.java

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

* Update sdk-extensions/tracing-incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/trace/LeakDetectingSpanProcessor.java

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

* Add a few more tests

* Formatting

* Make the test more robust, and change the WeakReference to hold a `ReadableSpan` rather than just the SpanContext.

* remove an extra gc call and inline a private constructor

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-03-10 15:56:26 -08:00
Sergei Malafeev 9d96758195
Support OTEL_EXPORTER_OTLP_METRICS/TRACES_ENDPOINT (#3000)
* Support OTEL_EXPORTER_OTLP_METRICS/TRACES_ENDPOINT

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* update README.md

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* update README.md

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* add test

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* reset global ot for tests

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* add not global test

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* update test

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* update test

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* added tearDown

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
2021-03-10 08:13:24 -08:00
John Watson 724b3bd064
update the autoconfigure docs to show the correct default value for the jaeger endpoint (#3004) 2021-03-09 18:22:19 -08:00
John Watson 7cb828838f
Add some notes about shutdown hooks and JUL. (#2991)
resolves #1147
2021-03-06 09:49:51 -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
Anuraag Agrawal 9997dee68e
Don't use singleton in resource test (#2970) 2021-03-03 13:42:33 +09:00
Anuraag Agrawal c670b859d6
Ignore classpath error when otlp is set as metrics exporter but is no… (#2960)
* Ignore classpath error when otlp is set as metrics exporter but is not on the classpath since the default value is otlp but metrics is alpha.

* Update sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/MetricExporterConfiguration.java

Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>

Co-authored-by: Bogdan Drutu <lazy@splunk.com>
Co-authored-by: Nikita Salnikov-Tarnovski <gnikem@gmail.com>
2021-03-02 15:57:22 -08:00
YuDong Tang c9246b30a4
fix doc link (#2929) 2021-02-24 07:53:52 -08:00
Bogdan Drutu 75ea07e597
Fix more api dependencies which should be implementation (#2919)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-23 12:20:06 -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 f28947655b
Remove unnecessary dependencies on alpha artifacts (#2892)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-18 19:43:52 -08:00
John Watson 02ed0bdfcd
mark the proto modules as alpha, since they contain metrics and logs (#2888) 2021-02-18 13:46:37 -08:00
Anuraag Agrawal dc4de41cec
Add tests for resources with securitymanager enabled. (#2873) 2021-02-18 09:14:58 -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
Bogdan Drutu 64b9badaa5
Move Builder as non inner class in async-processor (#2866)
* Move Builder as non inner class in async-processor

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

* Update sdk-extensions/async-processor/src/main/java/io/opentelemetry/sdk/extension/trace/export/DisruptorAsyncSpanProcessorBuilder.java

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

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-02-18 08:40:39 -08:00
Anuraag Agrawal 0aef15b5cd
Make jaeger rate limit sampler only rate limit (#2875) 2021-02-18 08:39:33 -08:00
Bogdan Drutu e60b8101d1
[Breaking Change] Remove B3Propagator.Builder, add static methods to access possible instances (#2863)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-18 12:40:48 +09:00
Bogdan Drutu 904ca1d873
Move Builders as non inner classes in sdk-extension/logging (#2864)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 15:05:33 -08:00
Bogdan Drutu 6bb9894b2f
Mark public classes as final in sdk-extensions/logging (#2861)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 13:25:11 -08:00
Bogdan Drutu cdebf865ce
Mark public classes as final in sdk-extensions/autoconfigure (#2860)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 13:10:34 -08:00
Bogdan Drutu 865b596dba
Mark public classes as final in sdk-extensions/jaeger-remote-sampler (#2855)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 12:43:56 -08:00
Anuraag Agrawal 0730a9e79c
[Breaking Change] Move ResourceProvider SPI to autoconfigure module (#2837)
* autoconfigure

* Finish

* Refactor

* Fix OsResource to use empty

* Fix BeanstalkResource to use empty

* Fix ResourceTest to use empty

* Fix Ec2Resource to use empty

* Fix EcsResource to use empty

* Fix ProcessRuntimeResource to use empty

* Fix ProcessRuntimeResource to use empty

* Fix EksResource to use empty

* Fix LambdaResource to use empty

* Fix ProcessResource to use empty

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Bogdan Drutu <lazy@splunk.com>
2021-02-17 12:41:07 -08:00
Bogdan Drutu 4166c961bc
Remove public unused class CommonProperties in otproto (#2848)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2021-02-17 12:28:49 -08:00
Anuraag Agrawal 4623334c7c
Move Getter/Setter to top level (#2840) 2021-02-17 09:46:56 -08:00
John Watson 20a1601089
[Breaking Change] Rename getEmpty() to empty() (#2831) 2021-02-17 08:15:23 -08:00
Anuraag Agrawal 43f1ecf7ed
Remove support for schemaless URLs for gRPC exporters. (#2834) 2021-02-17 16:37:49 +09:00
John Watson 920f79d151
clean up the javadoc and make examples pasteable (#2824)
* clean up the javadoc and make examples pastable
resolves #2817

* formatting
2021-02-17 12:31:08 +09:00
Reginald McDonald 14ace1ec32
2816: Autoconfigure to use SimpleSpanProcessor when logging exporter is used (#2832)
* Default to use SimpleSpanProcessor for LoggingSpanExporter when configured through env

When the SDK is configured to use a logging exporter from environment variables using autoconfiguration, a SimpleSpanProcessor will be used instead of a BatchSpanProcessor. For all other exporters, a BatchSpanProcessor will be used.

* Replace set of strings with a direct string equality
2021-02-16 18:38:17 -08:00
John Watson 931ad5b723
Properly shutdown tracer providers synchronously via close() (#2828)
* Properly shutdown tracer providers synchronously via close()
Resolves #2825

* formatting
2021-02-17 10:39:19 +09:00
John Watson 0960999d62
Set the default propagators if none are specified. (#2827) 2021-02-16 16:30:05 -08:00
Anuraag Agrawal 29140bdf7b
Add docs for autoconfiguration options. (#2812)
* Add docs for autoconfiguration options.

* Better docs

* quickstart
2021-02-17 09:23:25 +09:00
Anuraag Agrawal 900c35ed8c
Migrate remaining gradle scripts to kotlin (#2820)
* Migrate remaining gradle scripts to kotlin

* Finish more
2021-02-16 14:11:07 -08:00
Anuraag Agrawal 3264ae9e5f
Enable animal sniffer for resources artifact. (#2819) 2021-02-15 15:40:17 -08:00
Anuraag Agrawal 1a10c83506
Default exporters to OTLP per spec. (#2811) 2021-02-15 12:37:37 +09:00
Anuraag Agrawal e4886283a7
Migrate sdk-extensions to kts. (#2814) 2021-02-15 12:21:10 +09:00
Anuraag Agrawal 9ee2bdddee
Update ottrace env var value. (#2813) 2021-02-12 07:56:42 -08:00
John Watson 27dacb09fa
update the READMEs for 0.16.0 (#2783)
* update the READMEs for 0.16.0

* update context, add baggage

* trim down to trace
2021-02-09 13:31:00 -08:00
Anuraag Agrawal 4670252e20
Move AwsXrayPropagator to extension artifact. (#2771) 2021-02-09 11:36:58 +09:00
Anuraag Agrawal 522953bd8f
Restore Trace/SpanId.fromBytes (#2750)
This reverts commit d6fea3a70a.
2021-02-08 07:42:49 -08:00
Carlos Alberto Cortez 73d17911e4
Rename OtTracerPropagator to OtTracePropagator. (#2718)
* Rename OtTracerPropagator to OtTracePropagator.

* fix

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-02-08 18:23:01 +09: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 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 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 e7fcbb7e46
Move the parsing of the otel.resource.attributes into an SPI impl (#2713) 2021-02-04 18:35:05 -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 04ae15da36
update the trace-related env vars to match the spec (#2677) 2021-02-03 11:35:05 +09: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