3.0.0
This major release dedicated mostly to reduce memory allocation especially while scrape collection to achieve this we made number of improvements and breaking changes.
Improvements:
- Introduced IMetricsWriter, which used to produce metric samples without creation of CMetricFamily.
- Added target to netcore2.2 which allow us to use non-allocating format methods. This dramatically reduces allocation while scrapping for application run on netcore2.2.
- ICollectorRegistry and ICollector interfaces were reviewed.
- Histogram and Summary now expose current state through Value property (which returns snapshot of the state).
- Added CounterInt64 - counter optimized for integer values. It uses atomic operations instead of optimistic lock on value increment.
- Added IValueObserver abstraction for Histogram and Summary, together with extension methods for convenient duration observation.
- All value observation methods now support explicit setting timestamp for the observation.
- Fluent syntax to register default collectors into the CollectorRegistry.
- Reviewed MetricFactory to avoid unnecessary metric creation before checking CollectorRegistry for existing one.
- Improved unit tests coverage and added benchmarks.
- Library is Strong Named now.
Breaking changes:
- Legacy .Net Framework 4.5 is not supported anymore.
- Removed PerfCounter collectors as a platform dependent feature.
- Removed all Contracts because of moving to IMetricsWriter.
- TextFormatter was removed in favor of MetricsTextWriter.
- CollectorRegistry.Instance was moved into Metrics.DefaultCollectorRegistry to isolate all static API into Metrics entry point.
- Base classes Collector and Labelled have lots of changes to correspond new API and reduce allocation.
- IOnDemandCollector was removed in favor of ICollector.
- ScrapeHandler.Process methods is async now to follow .NET Core 3.0 synchronous operations restrictions.