* 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
* Use noop meter provider if no readers registered
* Extend AutoConfigurationCustomizer with metrics customizers
* Switch from inline to instance level mocks
* Deprecate SdkMeterProviderConfigurer
* 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>
* refactor: adjust tracer and meter provider customizer execution order
* refactor: Modify tracer provider customizer flow
* style: Format code using spotlessApply
* ♻️ 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>
* 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
* 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>
* Add ability to configure preferred temporality to OTLP grpc and http metric exporters
* Make OTLP metric preferred temporality configurable
* Make temporality configuration case insensitive
* 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
* 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
* Replaced hardcoded localhost with OS resolved localhost name in tests.
* Replaced hardcoded localhost with OS resolved localhost name in tests. #2
* retrigger checks #1
* 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
* 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>
* 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 ==
* 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.
* 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.
* 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>
* Add setTrustedCertificates support to OtlpGrpcMetricExporterBuilder
* Add signal specific certificate configuration to autoconfiguration
* Improve test coverage.
* Try to meet code coverage requirements.
* Qualify SslUtil.setTrustedCertificatesPem
* Add support for signal specific timeout and headers autoconfiguration.
* Attempt to fix build.
Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
* 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.
* 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
* 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
* 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.
* 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>
* 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>
* 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>
* 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
* 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>