12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- carbon:
- carbon/receiver_settings:
- # endpoint specifies the network interface and port which will receive
- # Carbon data.
- endpoint: localhost:8080
- # transport specifies either "tcp" (the default) or "udp".
- transport: udp
- # tcp_idle_timeout is max duration that a tcp connection will idle wait for
- # new data. This value is ignored is the transport is not "tcp". The default
- # value is 30 seconds.
- tcp_idle_timeout: 5s
- # parser section is used to to configure the actual parser to handle the
- # received data. The default is "plaintext", see
- # https://graphite.readthedocs.io/en/latest/feeding-carbon.html#the-plaintext-protocol.
- parser:
- # type specifies the type of parser to be used, the default is "plaintext"
- type: plaintext
- # config specifies any special configuration of the selected parser. What
- # goes under the section depends on the type of parser selected.
- config:
- carbon/regex:
- parser:
- # The "regex" parser can breakdown the "metric path" of a Carbon metric
- # into metric labels. This is typically used to extract the labels from
- # a naming hierarchy, see https://graphite.readthedocs.io/en/latest/feeding-carbon.html#step-1-plan-a-naming-hierarchy
- type: regex
- # config section with the custom config for the "regex" parser.
- config:
- # Rules with regular expressions to be applied to the received metrics.
- # The first rule that matches the metric is applied and no further rules
- # are applied. If no rules match the metric is processed by the "plaintext"
- # parser.
- rules:
- # The first rule generates extract dimensions with keys: "base", "env",
- # and "host" if the "metric path" matches the regular expression of the
- # rule. Regular expression named captures prefixed with "key_" are used
- # to populate metric labels, while named captures prefixed with "name_"
- # are used to generate the final metric name. The "name_*" captures are
- # sorted by name and their values are used to compose the resulting
- # metric name.
- - regexp: "(?P<key_base>test)\\.env(?P<key_env>[^.]*)\\.(?P<key_host>[^.]*)"
- # name_prefix is added when to the resulting metric name.
- name_prefix: "name-prefix"
- # labels to be added to the metrics matching this rule.
- labels:
- dot.key: dot.value
- key: value
- # type is used to select the metric type to be set, the default is
- # "gauge", the other alternative is "cumulative".
- type: cumulative
- # The second rule for this "regex" parser.
- - regexp: "(?P<key_just>test)\\.(?P<key_match>.*)"
- # Name separator is used when concatenating named regular expression
- # captures prefixed with "name_"
- name_separator: "_"
|