From 0aa6c062e1ac05d3ecefdaa408da977332b2ddf6 Mon Sep 17 00:00:00 2001
From: Thomas Roehl <thomas.roehl@fau.de>
Date: Thu, 19 Dec 2024 21:17:00 +0100
Subject: [PATCH] Add message processor to all sink documentation

---
 sinks/gangliaSink.md    | 12 ++++++++----
 sinks/libgangliaSink.md |  9 +++++++--
 sinks/prometheusSink.md |  8 +++++++-
 sinks/stdoutSink.md     |  7 ++++---
 4 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/sinks/gangliaSink.md b/sinks/gangliaSink.md
index 9b77ac9..7bee887 100644
--- a/sinks/gangliaSink.md
+++ b/sinks/gangliaSink.md
@@ -8,14 +8,18 @@ The `ganglia` sink uses the `gmetric` tool of the [Ganglia Monitoring System](ht
 {
   "<name>": {
     "type": "ganglia",
-    "meta_as_tags" : true,
     "gmetric_path" : "/path/to/gmetric",
-    "add_ganglia_group" : true
+    "add_ganglia_group" : true,
+    "process_messages" : {
+      "see" : "docs of message processor for valid fields"
+    },
+    "meta_as_tags" : []
   }
 }
 ```
 
 - `type`: makes the sink an `ganglia` sink
-- `meta_as_tags`: print all meta information as tags in the output (optional)
 - `gmetric_path`: Path to `gmetric` executable (optional). If not given, the sink searches in `$PATH` for `gmetric`.
-- `add_ganglia_group`: Add `--group=X` based on meta information to the `gmetric` call. Some old versions of `gmetric` do not support the `--group` option. 
\ No newline at end of file
+- `add_ganglia_group`: Add `--group=X` based on meta information to the `gmetric` call. Some old versions of `gmetric` do not support the `--group` option.
+- `process_messages`: Process messages with given rules before progressing or dropping, see [here](../pkg/messageProcessor/README.md) (optional)
+- `meta_as_tags`: print all meta information as tags in the output (deprecated, optional)
\ No newline at end of file
diff --git a/sinks/libgangliaSink.md b/sinks/libgangliaSink.md
index a0dede7..5d4e91f 100644
--- a/sinks/libgangliaSink.md
+++ b/sinks/libgangliaSink.md
@@ -15,18 +15,23 @@ The `libganglia` sink has probably less overhead compared to the `ganglia` sink
     "cluster_name": "MyCluster",
     "add_ganglia_group" : true,
     "add_type_to_name": true,
-    "add_units" : true
+    "add_units" : true,
+    "process_messages" : {
+      "see" : "docs of message processor for valid fields"
+    },
+    "meta_as_tags" : []
   }
 }
 ```
 
 - `type`: makes the sink an `libganglia` sink
-- `meta_as_tags`: print all meta information as tags in the output (optional)
 - `gmond_config`: Path to the Ganglia configuration file `gmond.conf` (default: `/etc/ganglia/gmond.conf`)
 - `cluster_name`: Set a cluster name for the metric. If not set, it is taken from `gmond_config`
 - `add_ganglia_group`: Add a Ganglia metric group based on meta information. Some old versions of `gmetric` do not support the `--group` option
 - `add_type_to_name`: Ganglia commonly uses only node-level metrics but with cc-metric-collector, there are metrics for cpus, memory domains, CPU sockets and the whole node. In order to get  eeng, this option prefixes the metric name with `<type><type-id>_` or `device_` depending on the metric tags and meta information. For metrics of the whole node `type=node`, no prefix is added
 - `add_units`: Add metric value unit if there is a `unit` entry in the metric tags or meta information
+- `process_messages`: Process messages with given rules before progressing or dropping, see [here](../pkg/messageProcessor/README.md)  (optional)
+- `meta_as_tags`: print all meta information as tags in the output (deprecated, optional)
 
 ### Ganglia Installation
 
diff --git a/sinks/prometheusSink.md b/sinks/prometheusSink.md
index 0996c43..de1a107 100644
--- a/sinks/prometheusSink.md
+++ b/sinks/prometheusSink.md
@@ -11,7 +11,11 @@ The `prometheus` sink publishes all metrics via an HTTP server ready to be scrap
     "type": "prometheus",
     "host": "localhost",
     "port": "8080",
-    "path": "metrics"
+    "path": "metrics",
+    "process_messages" : {
+      "see" : "docs of message processor for valid fields"
+    },
+    "meta_as_tags" : []
   }
 }
 ```
@@ -21,3 +25,5 @@ The `prometheus` sink publishes all metrics via an HTTP server ready to be scrap
 - `port`: Portnumber (as string) for the HTTP server
 - `path`: Path where the metrics should be servered. The metrics will be published at `host`:`port`/`path`
 - `group_as_namespace`: Most metrics contain a group as meta information like 'memory', 'load'. With this the metric names are extended to `group`_`name` if possible.
+- `process_messages`: Process messages with given rules before progressing or dropping, see [here](../pkg/messageProcessor/README.md) (optional)
+- `meta_as_tags`: print all meta information as tags in the output (deprecated, optional)
\ No newline at end of file
diff --git a/sinks/stdoutSink.md b/sinks/stdoutSink.md
index 14ef4bd..aef1db1 100644
--- a/sinks/stdoutSink.md
+++ b/sinks/stdoutSink.md
@@ -13,7 +13,8 @@ The `stdout` sink is the most simple sink provided by cc-metric-collector. It wr
     "output_file" : "mylogfile.log",
     "process_messages" : {
       "see" : "docs of message processor for valid fields"
-    }
+    },
+    "meta_as_tags" : []
   }
 }
 ```
@@ -21,6 +22,6 @@ The `stdout` sink is the most simple sink provided by cc-metric-collector. It wr
 - `type`: makes the sink an `stdout` sink
 - `meta_as_tags`: print meta information as tags in the output (optional)
 - `output_file`: Write all data to the selected file (optional). There are two 'special' files: `stdout` and `stderr`. If this option is not provided, the default value is `stdout`
-- `process_messages`: Process messages with given rules before progressing or dropping
-
+- `process_messages`: Process messages with given rules before progressing or dropping, see [here](../pkg/messageProcessor/README.md)  (optional)
+- `meta_as_tags`: print all meta information as tags in the output (deprecated, optional)