BrunoBonacci / mulog

μ/log is a micro-logging library that logs events and data, not words!
https://cljdoc.org/d/com.brunobonacci/mulog/
Apache License 2.0
490 stars 48 forks source link

DEPRECATION WARNING: on `:filesystem-metrics` sampler config option #74

Closed BrunoBonacci closed 3 years ago

BrunoBonacci commented 3 years ago
Notice type Deprecation warning
Component μ/log sampler :filesystem-metrics
Version affected 0.8.0+
Warning removed version 0.10.0

A config change is required if you use custom transformations via :transform with the :filesystem-metrics sampler.

Description

In order to unify the custom transform behaviour across all the samplers and the publishers and avoid confusion the following change in behaviour is adopted:

transform-samples -> sample-seq -> sample-seq

The :transform-samples function will be executed on the samples before being recorded, this is an important difference with the publishers custom :transform which is applied to events (not samples) that are already recorded and about to be published.

Changes from v0.7.1

You need to update your publisher configuration ONLY if you were using a custom transform:

;; BEFORE
(μ/start-publisher! 
  {:type :filesystem-metrics
   :transform (partial filter #(> (:total-bytes %) 1e9))})

;; AFTER
(μ/start-publisher! 
  {:type :filesystem-metrics
   ;; KEY CHANGED
   :transform-samples (partial filter #(> (:total-bytes %) 1e9))})

Only the config key :transform has changed into :transform-samples, behaviour stays the same.

A warning message appears only if the old :transform key is used. The warning will be removed and the old key will be ignored from version v0.10.0 onward.