Commit Graph

272 Commits

Author SHA1 Message Date
jack-berg 59a6061dc5
Deprecate InstrumentationLibraryInfo (#4256)
* Deprecate InstrumentationLibraryInfo

* API diff
2022-03-14 14:45:10 -05:00
Anuraag Agrawal 26c04299d3
Make MetricData factories internal (#4257) 2022-03-11 16:30:13 +09:00
Anuraag Agrawal 048a0c8d14
Migrate PointData to interface (#4242) 2022-03-09 11:16:48 +09:00
wallezhang 3a78a9030a
feat: Add enabled resource providers configuration (#4231)
* feat: Add enabled resource providers configuration

* style: Code style changes by running spotlessApply

* test: Add unit test for specific resource providers in both configurations

* test: Add unit test for only specific resource providers in enabled configuration
2022-03-09 09:44:05 +09:00
Anuraag Agrawal 22c7a8e10b
Cleanups to View configuration (#4225) 2022-03-04 10:46:55 +09:00
Anuraag Agrawal a6107d5590
Remove type-specific SumData (#4216)
* Remove type-specific SumData

* scare
2022-03-02 08:40:21 +09:00
jack-berg 9456aeea26
Experimental support for disabling resource keys (#4169)
* Experimental support for disabling resource keys

* Rename property
2022-02-17 14:19:27 -06:00
John Watson f7c52e181e
Update OTLP protobufs to v0.13.0-alpha (#4170)
and add documentation on how to update that dependency.
2022-02-12 10:33:38 -08:00
jack-berg 3f5778e647
Do not register periodic metric reader when exporter is null (#4166) 2022-02-09 14:25:27 -06:00
jack-berg b9074f1d8b
Drop deprecations (#4158)
* Drop OBSERVABLE_SUM and OBSERVABLE_UP_DOWN_SUM

* Drop SdkMeterProviderConfigurer
2022-02-08 14:17:06 +09:00
jack-berg eb92539f94
Logs customizer (#4148) 2022-02-04 10:11:56 -06:00
jack-berg 4392f52e1c
Metrics customizer (#4127)
* Use noop meter provider if no readers registered

* Extend AutoConfigurationCustomizer with metrics customizers

* Switch from inline to instance level mocks

* Deprecate SdkMeterProviderConfigurer
2022-02-03 12:26:04 -06:00
jack-berg bd29e1f2ef
Deprecate SdkTracerProviderConfigurer (#4136)
* Deprecate SdkTracerProviderConfigurer

* Update sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/TestTracerProviderConfigurer.java

Co-authored-by: John Watson <jkwatson@gmail.com>
2022-02-03 14:19:28 +09:00
Anuraag Agrawal 47f7c38ef5
Enable loggers in all tests via slf4j. (#4126)
* Route all test jul logging through slf4j.

* Cleanup and more suppressions
2022-02-02 14:43:25 +09:00
jack-berg 4a015cc794
Set MeterProvider on BatchLogProcessor (#4138) 2022-02-02 08:06:07 +09:00
Ryan Rupp 586ac11803
Make SPI factories instantiate implementations lazily (#4059)
* Make SPI factories instantiate implementations lazily

Previously, this would load all SPI factories and then eagerly instantiate each implementation. This would potentially result in implementations that would get instantiated even if they didn't end up getting used. An example was if the AWS contrib jar was included, this would result in an AwsXrayRemoteSampler being instantiated eagerly despite the configuration not using it. This could then result in errors or unused resources depending on the implementation i.e. in the AwsXrayRemoteSampler example it spawns a thread and makes a network request.

This change transitions the factories so that they only construct the implementation objects if the configuration specifically asks for it. Note the SPI factories themselves must still must be eagerly loaded to determine which factory names are available. This change applies to all auto-configuration areas following this pattern: Samplers, Metric Exporters, Text Map Propagators and Span Exporters.

* Now that instantiating implementations is on-demand (only if used), allow any exceptions to propagate

* format fix

* Change NamedSpiManager from interface to class

Co-authored-by: jack-berg <jberg@newrelic.com>
2022-01-31 15:49:58 -06:00
wallezhang 97d2115dc4
refactor: adjust tracer and meter provider customizer execution order (#4129)
* refactor: adjust tracer and meter provider customizer execution order

* refactor: Modify tracer provider customizer flow

* style: Format code using spotlessApply
2022-01-31 11:56:00 -06:00
jack-berg 87f788a3b4
Cleanup retry configuration (#4131) 2022-01-31 11:30:39 -06:00
Anuraag Agrawal 3cabcc7e45
Improve behavior of some tests (#4123) 2022-01-26 08:17:21 -08:00
jack-berg 0ef60f8233
Use noop meter provider if no readers registered (#4120)
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-01-26 08:08:31 -08:00
Anuraag Agrawal 044cadb47e
Reorganize internal export code. (#4111)
* Reorganize internal export code.

* Cleanups
2022-01-26 14:39:58 +09:00
Anuraag Agrawal 53df4aa8a1
Fix flaky FullConfigTest (#4115) 2022-01-25 07:50:04 -08:00
Ryan Dens 1313265692
BatchSpanProcessor metrics (#4112)
* ♻️ refactor TracerProviderConfiguration.configureBatchSpanProcessor to have MeterProvider provided to it

* 🐛 set meterProvider on BatchSpanProcessorBuilder

* 👌 chain usage of builder APIs where possible

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

* 🎨 formatting

Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
2022-01-24 18:27:14 -08:00
jack-berg 8bbb0e25da
Enable reflective setting of retry policy for OkHttpGrpcExporter (#4097)
* Enable reflective setting of retry policy for OkHttpGrpcExporter

* Drop deprecated method

* Add test coverage
2022-01-21 11:07:00 +09:00
Eugene R 3518c98c45
Annotate AutoValue classes as Immutable (#3875)
* annotate AutoValue classes as Immutable

* Remove @Immutable on internal classes

Co-authored-by: jack-berg <jberg@newrelic.com>
2022-01-14 14:53:14 -06:00
Roberto Cortez 7b570f53ce
Provide a way to register / skip the shutdown hook in AutoConfiguredOpenTelemetrySdkBuilder (#4072) 2022-01-11 09:46:53 -08:00
Roberto Cortez 07a2d2eb28
Customizer for SdkTracerProviderBuilder (#4004) 2022-01-08 11:18:38 +09:00
Anuraag Agrawal c28797ae89
Use configured classloader for resource SPI. (#4064) 2022-01-07 12:44:44 +09:00
Anuraag Agrawal 429afa1c99
Add toString to SDK trace components and print autoconfigured SDK (#4047)
* Add toString to SDK trace components and print autoconfigured SDK

* Clean

* Tweak logging message
2022-01-07 10:55:46 +09:00
Anuraag Agrawal dfb4a74ac5
Update errorprone (#4048) 2022-01-06 11:33:00 +09:00
jack-berg 10f5efa14d
Add log autoconfigure support (#4015)
* Add log autoconfigure support

* Support log logging exporter via autoconfigure

* Add unit test
2022-01-05 08:21:58 -08:00
Kunshuai Zhu 44dccd6c33
Fix the problem that README.md failed to display [javadoc-image] (#4039) 2022-01-01 09:39:45 -08:00
jack-berg 6f755cc812
Add http/protobuf retry (#3983)
* Add http/protobuf retry

* PR feedback
2021-12-17 12:35:29 +09:00
jack-berg 2fb3d633a0
Remove deprecations from autoconfigure module (#3923) 2021-12-17 09:12:39 +09:00
Anuraag Agrawal 1e9fb21c64
Remove deprecated metrics APIs (#3990) 2021-12-15 11:51:32 +09:00
jack-berg 53030b7266
Configurable temporality (#3960)
* Allow configuration of preferred temporality in LoggingMetricExporter and OtlpJsonLoggingMetricExporter

* Make InMemoryMetricReader preferred temporality configurable

* Add create() methods to LoggingSpanExporter, LoggingMetricExporter, and SystemOutLogExporter, deprecate public constructors
2021-12-08 13:58:59 +09:00
Anuraag Agrawal 8e04fbf0b8
Migrate most testsets to test suites. (#3953) 2021-12-07 08:37:15 +09:00
Anuraag Agrawal 737a5e2b26
Deprecate GlobalMeterProvider (#3948) 2021-12-03 08:43:49 +09:00
Anuraag Agrawal b1651a18cf
Rename .observe to .record (#3949)
* Rename .observe to .record

* Apply deprecation
2021-12-03 08:37:22 +09:00
Anuraag Agrawal ae3fe66031
Implement retry for OkHttpGrpcExporter (#3936)
* Implement retry for OkHttpGrpcExporter

* Fix merge

* Smallest is millis

* Cleanup

* More retryable
2021-12-01 09:34:43 +09:00
Anuraag Agrawal 55ff1dc533
Promote metrics API to stable (#3919)
* Add MeterProvider to OpenTelemetry API

* Spot

* Set

* Move NoopMeter to package private

* Merge metrics API code into API package

* Finish

* Fix / clean

* Drift

* Update extensions/noop-api/src/main/java/io/opentelemetry/extension/noopapi/NoopOpenTelemetry.java

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

* Spot

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-11-24 08:39:55 +09:00
Anuraag Agrawal 6933de18e5
Don't use global meter provider for trace export (#3901) 2021-11-19 15:06:22 +09:00
jack-berg 65e7145e9c
OTLP metric temporality configuration (#3847)
* Add ability to configure preferred temporality to OTLP grpc and http metric exporters

* Make OTLP metric preferred temporality configurable

* Make temporality configuration case insensitive
2021-11-12 11:03:20 +09:00
Anuraag Agrawal 72bfd18aba
Allow specifying SPI classloader during autoconfiguraiton. (#3849) 2021-11-11 09:38:29 +09:00
jack-berg 4b7e50928f
Configure periodic metric reader interval with otel.metric.export.interval (#3840) 2021-11-09 13:59:33 +09:00
jack-berg a1a45d2657
Autoconfigure experimental OTLP retry (#3791)
* Add retry policy class and wire into autoconfigure

* Wire up otlp retry for DefaultGrpcExporter

* Add documentation to autoconfigure readme

* Add more tests

* Move delegate accessor to :exporters:otlp:common

* Use jackson for json serialization

* PR feedback
2021-11-09 10:06:47 +09:00
Anuraag Agrawal 872c86cf8a
Migrate jaeger exporter to use GrpcExporter (#3800)
* Migrate jaeger exporter to use GrpcExporter

* Cleanup

* Update integration test

* Fix
2021-10-29 12:01:41 +09:00
Anuraag Agrawal 13c838acfe
Fix merge conflict (#3798) 2021-10-28 10:13:57 +09:00
Anuraag Agrawal 1e073fcff2
Add an auto-configuration builder. (#3753)
* Add an auto-configuration builder.

* Test

* Builder

* More

* Revamp

* Customizer only customizes

* Pass config to customizers

* More specific name

* Cleanup

* Cleanup

* SPI test

* Clean

* Clean

* Clean

* Shutdown once instead of flush and shutdown for simple

* Clean

* Cleanups

* Cleanup
2021-10-28 08:41:14 +09:00
jack-berg c4c2e6c9db
Align SdkMeterProvider with SdkTracerProvider (#3792)
* Align SdkMeterProvider with SdkTracerProvider

* Use noop meter provider when metric exporter is none
2021-10-27 10:03:08 -07:00
Anuraag Agrawal 57888c55e4
Extract common logic for HTTP exporters (#3787) 2021-10-25 11:39:08 -07:00
tnevolin 9cea4ef1f9
Replaced hardcoded test host name with the one properly resolved by OS (#3770)
* Replaced hardcoded localhost with OS resolved localhost name in tests.

* Replaced hardcoded localhost with OS resolved localhost name in tests. #2

* retrigger checks #1
2021-10-20 10:57:19 -07:00
Anuraag Agrawal 969000363d
Add a self-managed Prometheus HTTP server which does not integrate wi… (#3704)
* Add a self-managed Prometheus HTTP server which does not integrate with an apps Registry

* More tests

* Unit test

* Add integration test

* Rename
2021-10-15 15:11:30 +09:00
Anuraag Agrawal ebf5507cde
Add PeriodicMetricReaderBuilder (#3735)
* Add PeriodicMetricReaderBuilder

* More tests

* Cleanup

* Improve default
2021-10-14 18:28:59 -07: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
jason plumb 26aad090ee
Document ResourceProvider SPI and how to disable (#3720)
* add documentation around resource provider spi

* spotless

* Update sdk-extensions/autoconfigure/README.md

Co-authored-by: Fabrizio Ferri-Benedetti <fferribenedetti@splunk.com>

* Update sdk-extensions/autoconfigure/README.md

Co-authored-by: Fabrizio Ferri-Benedetti <fferribenedetti@splunk.com>

* Update sdk-extensions/autoconfigure/README.md

Co-authored-by: Fabrizio Ferri-Benedetti <fferribenedetti@splunk.com>

* add link to sdk-extension resources

* spotless meh

Co-authored-by: Fabrizio Ferri-Benedetti <fferribenedetti@splunk.com>
2021-10-11 13:23:29 -07:00
jack-berg 95949e0713
Remove autoconfigure otlp protocol experimental properties (#3718)
* Remove autoconfigure otel.experimental.exporter.otlp.protocol and otel.experimental.exporter.otlp.{signal}.protocol properties

* Add entry to changelog
2021-10-11 12:05:52 +09:00
Anuraag Agrawal 776b4f71d7
Replace :proto usage with published io.opentelemetry.proto (#3697) 2021-10-06 11:51:17 -07:00
Anuraag Agrawal 63bec0727e
Allow OTLP gRPC exporters to work without grpc-java using okhttp directly. (#3684)
* Allow OTLP HTTP exporter to also export in gRPC format.

* detect classpath

* Revert HTTP exporter

* Apply to metrics / trace

* Most

* Fix

* Integration tests

* Clean

* Fix log message

* Assume validated
2021-10-06 16:26:11 +09:00
jack-berg 6c3010dd08
Change otlp http/protobuf default port from 4317 to 4318 (#3694) 2021-10-05 16:24:06 -07:00
jack-berg 5556795623
Update autoconfigure to append signal path to otlp http endpoint if n… (#3666)
* Update autoconfigure to append signal path to otlp http endpoint if not present

* Use URI.resolve() instead of string concatenation

* revert to string concatenation

* Add URL validation to OTLP endpoint

* Always append signal path to otlp http/protobuf endpoint

* Add changelog entry, clarify tests, append root path if not included on generic http endpoint
2021-10-05 12:48:21 -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
John Watson d25ed2a60c
Change the auto-configured exemplar filters to lowercase, per spec change. (#3674) 2021-09-29 09:41:54 +09:00
Anuraag Agrawal 7c3e22efbc
Fix more nullness (#3655)
* Fix more nullness

* Actually not that improbable

* Null check

* Cleanup
2021-09-28 09:24:42 +09:00
Anuraag Agrawal adaf239605
Pass a cause to ConfigurationException somewhere. (#3658) 2021-09-24 14:01:54 -07:00
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 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
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
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 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 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 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
Anuraag Agrawal 87f2b5e0a8
Update error-prone (#3485) 2021-08-13 09:44:29 -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
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
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
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 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 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
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
John Watson 2a002f20fa
Make the EnvironmentResource public. (#3200) 2021-05-06 16:50:07 -07:00
John Watson cc4720de13
Add the option to configure the zipkin exporter timeout. (#3203) 2021-05-06 09:12:06 +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
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
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
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
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 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 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 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 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
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
Anuraag Agrawal 4623334c7c
Move Getter/Setter to top level (#2840) 2021-02-17 09:46:56 -08:00
Anuraag Agrawal 43f1ecf7ed
Remove support for schemaless URLs for gRPC exporters. (#2834) 2021-02-17 16:37:49 +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 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
Anuraag Agrawal 4670252e20
Move AwsXrayPropagator to extension artifact. (#2771) 2021-02-09 11:36:58 +09: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 e7fcbb7e46
Move the parsing of the otel.resource.attributes into an SPI impl (#2713) 2021-02-04 18:35:05 -08:00
Anuraag Agrawal b8c5acd3ff
Rename TraceConfig -> SpanLimits and move to upper package. (#2686) 2021-02-04 09:10:05 +09: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 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
Anuraag Agrawal 4a7e94e2dc
Use duration parser in autoconfiguration. (#2608) 2021-01-29 10:25:06 -08:00
Josh Suereth 5c45bc1ae4
Add a Duration parser for configuration. (#2439)
* Add a Duration parser for autoconfigure helpers.

- Create a new `getDuration()` method that reads configuration properties as "duration strings"
- Add a utiility parser for extraction of `{number}{unit}` type configuration values.
- Add a parser for `{unit}` strings that convert to a time unit (millis, seconds, minutes, hours, days)
- Update unit tests.

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

* Public / docstring consistency

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2021-01-29 15:45:43 +09:00