From f9ea8b2fa34ccc6fdfc01e2b4fa86a847ecd99a3 Mon Sep 17 00:00:00 2001 From: Emmanuel Delmas Date: Mon, 11 Jan 2021 21:31:46 +0100 Subject: [PATCH] Document metrics definition behavior with fork Signed-off-by: Emmanuel Delmas --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 7793e2f8..78bd048c 100644 --- a/README.md +++ b/README.md @@ -389,6 +389,11 @@ If you are running in pre-fork servers (such as Unicorn or Puma with multiple pr make sure you do this **before** the server forks. Otherwise, each child process may delete files created by other processes on *this* run, instead of deleting old files. +**Define metrics before fork**: In order the share the same definition of metrics between +your forks, you should make sure to define your metrics before to fork your process. +Indeed, even if the content of the metric is stored in a file, the list of all metrics is +stored in memory. Creating metrics after fork would lead to unexported files metrics. + **Large numbers of files**: Because there is an individual file per metric and per process (which is done to optimize for observation performance), you may end up with a large number of files. We don't currently have a solution for this problem, but we're working on it.