Here are the examples of configuration together with explanation how it works.
Is defined in the rules config that is in turn referred to in the main config. This is how it works:
- Routing rules are applied to each incoming record in order;
- If regex or prefix in a rule matches, the record is sent to the clusters in the
clusters
list;- If
continue
is set totrue
, continue matching next rules, stop otherwise.false
is the default;
- If
- If no regex or prefix matches, continue down the list of rules;
- If regex or prefix in a rule matches, the record is sent to the clusters in the
- Multiple rules can be matched to each record;
- Each record is sent to a specific cluster only once. If two rules send it to same cluster, only one instance will be sent;
- Cluster names must be from the set in the clusters config.
Optionally, it is possible to apply the rewrite rules. This is how they work:
- rewrites are applied before the routing;
- all rules are applied to each record one-by-one in order. The record may be modified along the way;
- rule matches if
from
matches;- then metric path is rewritten to
to
in place; - if
copy
istrue
the original metric is copied and sent directly to be routed skipping the following re-writes.copy
isfalse
by default.
- then metric path is rewritten to