* Add min and max to HistogramPointData
* Add hasMin, hasMax to HistogramPointData instead of @Nullable
* Add javadoc about describing behavior when hasMin / hasMax is false
* Get rid of @Nullable on HistogramAccumulation
* Simplify MetricReader
* Tighten up PR
* Restore some methods / classes and deprecate
* Revert "Restore some methods / classes and deprecate"
This reverts commit fee90e5da7.
* draft for exponential histogram aggregator
* autoscaling for exponential histogram
* more tests for exp histogram
* re-add nr copyright notice after spotlessapply deleted them; convert some comments to javadoc
* change to long index for bucketmapper
* add scale to hashCode for buckets
* implement jsuereth initial review for exphist
* move data and pointdata for exphist into data package
* replace windowedCounterArray with minimal map implementation
* use Arrays.asList() for exposing bucket counts
* remove WindowedCounterArray and MultiTypeCounterArray
* javadoc for ExponentialCounter
* implement and test merge() for exponential histogram aggregation; fix scale reduction bug
* appease spotless check
* optimize inital hashmap size for MapCounter
* merging exphist accumulation not alter original accumulation
* more tests, with a currently failing limit tester
* change map counter to be able to copy any of its interface type
* add dummy switch cases for exponential histogram exporter to appease build
* test fixes
* metrics-testing helpers for exponential histogram
* javadoc and linting
* multithreaded test on update/merge for exphist
* some cleanup
* resolve conflicts
* Update sdk/metrics-testing/src/main/java/io/opentelemetry/sdk/testing/assertj/metrics/ExponentialHistogramAssert.java
Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
* address some review
* spotless
* add static factories to interface as per anuraag review
* use string concatenation in favour of String.format()
* address minor review comments
* make doIncrement() atomic
* change index from long to int
* refactor aggregator to align with recent Aggregator refactor
* implement diff() for exponential histogram aggregator
* add missing javadoc for metric assertions
* more javadoc for diff()
* remove unnecessary comment
* add another test for diff exphist
* spotless
* address comment regarding failure message
* metric assertions test for exponential histogram assertions
* replace warning log with IllegalStateException
* improve test coverage
* make record package private
* remove unnecessary double check to improve code cov
* add comments
Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
* Major refactoring to Aggregator
- Remove all state from Aggregator but for exemplar reservoir factory.
- Reosurce/IL passed from MP/MeterSharedState
- MetricDescriptor already stored on MetricStorage.
- Give Aggregators explicit "diff" and "merge" operations, split Sum aggregator
- Update Storage to use explicit diff/merge in appropriate locations.
- Aggregtors are now passed AggregationTemporality in as a parameter
- Update MetricStorage to take requested aggregation tempoarlity as parameter, always storing data for either.
Note: Things compile, aggregator + storage tests pass, but e2e is broken until aggregation temporality is appropriatley wired through to readers.
* Remove extraneous bits of information from AggregatorFactory interface
* Spotless + remove extraneous pieces of data from Aggregation interface.
* Added supported + preferred temprality to export interfaces.
- Add supported/preferred temporality to export interfaces
- Update tracking of collection information through internal packages to pass
one data class instead of many individual components.
* Finish wiring configured temporality through Views.
- Update gauge tests to account for start time (as recommended in spec).
- Allow configured temporality to be null for views
- Propogate configured temporality from View API through to storage
* Fix remaining gauge tests
* Update exporters to specify desired temporality
* Other build fixes
* Fix javadoc
* add tests for cumulative+delta in temporal storage
- Add cumulative+delta tests
- Fix error messages from sum data assert
* Move diffInPlace and megeInPlace into utility class
* Add explicit test for delta vs. cumulative exporters.
* Spotless fixes
* Remove AggregatorFactory
This interface was fully replaced by Aggregation, and offerred little benefit post-refactor.
* Fixes from review
* Add javadoc for new parameters in temporal metric storage.
* Fixes from review.
* Add some unit tests for the aggregation config
* Add "diff" unit test for histogram + lastvalue
* Apply suggestions from code review
Co-authored-by: John Watson <jkwatson@gmail.com>
* Fixes from code review.
Co-authored-by: John Watson <jkwatson@gmail.com>
* Rename MetricData to MetricDataBuilder and extract MetaData interface
* rename abstract class and pull create methods up
* add package private constructor for consistency/safety
* move the defaults into their respective types
* rename default -> empty
* 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.
* Update sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/exemplar/AbstractFixedSizeExemplarReservoir.java
Co-authored-by: John Watson <jkwatson@gmail.com>
* Fix name from review.
* Update sdk/common/src/main/java/io/opentelemetry/sdk/internal/RandomSupplier.java
Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
* 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 Exemplars into `metrics.data` pacakge
- Add Exemplars to match OTLP spec
- Add assertj helpers for exemplar extraction on points.
* Wire exemplar export to OTLP exporter
* Wire exemplar export to Prometheus exporter
* Add javadoc for AbstractSampledPointDataAssert
* Fixes from review.
* Fixes from review.
* Fixes from review.
* Fixes from spotless.
* Fixes froom review.
* Add clarification to javadoc from review.
* ONe last javadoc cleanup.
* Fixes to javadoc build.
* Update method name from review.
* Fixes from review.
* 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.