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 `:mbean` sampler config option #75

Closed BrunoBonacci closed 3 years ago

BrunoBonacci commented 3 years ago
Notice type Deprecation warning
Component μ/log sampler :mbean
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 :mbean 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 :mbean
   :mbeans-patterns ["java.lang:type=Memory" "java.nio:*"]
   :transform walk/stringify-keys})

;; AFTER
(μ/start-publisher!
  {:type :mbean
   :mbeans-patterns ["java.lang:type=Memory" "java.nio:*"]
   :transform-samples (partial map walk/stringify-keys)})

Only the config key :transform has changed into :transform-samples Previously the :transform function was applied to a single sample which breaks the general transformation functions, now the :transform-samples applies to a sequence of samples.

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.

See discussion on https://github.com/BrunoBonacci/mulog/issues/72 for more info.