Commit Graph

7 Commits

Author SHA1 Message Date
Josh Suereth 50e2ac76c2
Exemplar data classes should match convention. (#3688)
* Fix #3535 - Exemplar data classes should match convention.

* Fix spotless issue.
2021-10-04 21:03:12 +09:00
Josh Suereth e6424654b2
Implementations of Exemplar Reservoirs (#3592)
* 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>
2021-09-17 13:20:06 +09:00
jack-berg 58c16a9133
Add missing readmes and missing javadoc links (#3500) 2021-08-16 12:36:54 -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
Trask Stalnaker 60c3c5ca0c
Format build.gradle.kts files (#3427) 2021-07-29 13:21:38 +09:00
Josh Suereth ae4bb364cd
Wire Exemplars into the metrics.data package (#3353)
* 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.
2021-07-10 13:20:31 +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