Commit Graph

27 Commits

Author SHA1 Message Date
Asaf Mesika b0c337b075
Memory Mode support: Adding memory mode, and implementing it for Asynchronous Instruments (#5709)
Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
2023-09-26 13:21:46 -05:00
jack-berg 07a1bb4419
Fix various gradle warnings (#5556) 2023-06-21 11:15:05 -05:00
jack-berg 2870209fdb
Prototype histogram advice API (i.e. Hints) (#5217) 2023-04-11 17:03:55 -05:00
jack-berg 59043802e6
Merge :sdk:metrics-testing into :sdk:testing (#5144) 2023-01-24 08:42:04 -08:00
jack-berg 8897dd4d5c
Revert removal final newline (#5133)
* Revert removal final newline

* Add to final newlin editorconfigoverride
2023-01-18 08:51:41 -06:00
dependabot[bot] 1e4a7be6be
Bump spotless-plugin-gradle from 6.12.1 to 6.13.0 (#5126)
* Bump spotless-plugin-gradle from 6.12.1 to 6.13.0

Bumps [spotless-plugin-gradle](https://github.com/diffplug/spotless) from 6.12.1 to 6.13.0.
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/gradle/6.12.1...plugin-gradle/6.13.0)

---
updated-dependencies:
- dependency-name: com.diffplug.spotless:spotless-plugin-gradle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix build

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jack Berg <jberg@newrelic.com>
2023-01-17 16:47:56 -06:00
jack-berg 928d112c7d
Revert histogram buckets (#4736)
* Revert "Restore prior histogram defaults (#4717)"

This reverts commit 160af1c480.

* Revert "Update bucket hist defaults to match spec (#4684)"

This reverts commit 8445642052.
2022-09-08 11:23:18 -05:00
jack-berg 160af1c480
Restore prior histogram defaults (#4717)
* Add property for configuring legacy explicit bucket histogram bucket boundaries

* Add clarifying comment

* Spotless
2022-08-25 14:41:46 -05:00
jack-berg e067223409
Convert tests to from :sdk:metrics-testing to :sdk:testing (#4444) 2022-05-09 09:34:09 -05:00
jack-berg ca69bc2adc
Deprecate InMemoryMetricReader (#3989)
* Deprecate InMemoryMetricReader

* Revert "Deprecate InMemoryMetricReader"

This reverts commit bd4fb42084.

* Move InMemoryMetricReader to :sdk:metrics-testing, deprecate version in :sdk:metrics

* Fix build

* Combine test classes, expand coverage
2021-12-22 08:39:11 +09:00
Anuraag Agrawal 1e9fb21c64
Remove deprecated metrics APIs (#3990) 2021-12-15 11:51:32 +09:00
jack-berg 5e39e5958d
Enable animal sniffer on metrics (#3945)
* Enable animal sniffer on metrics

* Use LongAdder/DoubleAdder if available

* Exclude implementation classes instead of used fields.

* keySet

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-12-08 07:52:24 -08:00
Anuraag Agrawal 7972e84c8d
Enable nullaway for metrics SDK (#3845)
* Enable nullaway for metrics SDK

* Fix nullness

* Fix

* Cleanup

* Exception
2021-11-16 11:39:39 +09:00
Josh Suereth 8d0052fd3b
Add diagnostic messages for metric registration conflicts. (#3808)
* Add mechanism to track view/instrument registration for errors.

- Create SourceInfo class to track code/config based sources of errors.
- Add SourceInfo creation to both InstrumentDescritpor and View
- Update DuplicateMetricStorageException to remember source
  MetricDescriptors
- Update MetricDescriptor to include source view + instrument
  descriptors.
- Add new error messages with gory detail on conflict that will be
  logged.

* Move InstrumentDescriptor into internal package

We use this class to track instrument sources/debugging so we don't want it exposed publicly.   This just moves it next to MetricDescriptor.

* Fix logs to include throwable.

* Fix javadoc.

* Add mechanism to enable/disable metric diagnostics.

- Create DebugConfig class that knows whether metrics are on/off
- Add testing utility to enable/disable debug configuraiton.
- Update NoSourceInfo to use real enablement message.
- Move "default on" diagnostic tests into their own group, similar to
  context.

* Update to use Thread.getStackTrace

* Fixes from review.
2021-11-03 18:45:40 -07:00
Anuraag Agrawal 0560c82d5c
Enable nullaway except for metrics. (#3668) 2021-09-28 09:28:00 -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
jack-berg 4a945e63e3
Add gradle ktlint spotless config to all projects (#3543) 2021-08-25 08:36:17 +09: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
Trask Stalnaker 60c3c5ca0c
Format build.gradle.kts files (#3427) 2021-07-29 13:21:38 +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
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 672330bf51
Upgrade to Gradle 7.0 (#3228) 2021-05-13 08:21:22 +09:00
Anuraag Agrawal 1fc7e057ad
Target Android API 21 with animalsniffer and disable it for metrics for now since it's unstable. (#2809) 2021-02-12 11:59:43 -08:00
Anuraag Agrawal 1a56b8b0d8
Migrate api / sdk projects to build.gradle.kts (#2609) 2021-01-29 10:10:40 -08:00