config.yaml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. carbon:
  2. carbon/receiver_settings:
  3. # endpoint specifies the network interface and port which will receive
  4. # Carbon data.
  5. endpoint: localhost:8080
  6. # transport specifies either "tcp" (the default) or "udp".
  7. transport: udp
  8. # tcp_idle_timeout is max duration that a tcp connection will idle wait for
  9. # new data. This value is ignored is the transport is not "tcp". The default
  10. # value is 30 seconds.
  11. tcp_idle_timeout: 5s
  12. # parser section is used to to configure the actual parser to handle the
  13. # received data. The default is "plaintext", see
  14. # https://graphite.readthedocs.io/en/latest/feeding-carbon.html#the-plaintext-protocol.
  15. parser:
  16. # type specifies the type of parser to be used, the default is "plaintext"
  17. type: plaintext
  18. # config specifies any special configuration of the selected parser. What
  19. # goes under the section depends on the type of parser selected.
  20. config:
  21. carbon/regex:
  22. parser:
  23. # The "regex" parser can breakdown the "metric path" of a Carbon metric
  24. # into metric labels. This is typically used to extract the labels from
  25. # a naming hierarchy, see https://graphite.readthedocs.io/en/latest/feeding-carbon.html#step-1-plan-a-naming-hierarchy
  26. type: regex
  27. # config section with the custom config for the "regex" parser.
  28. config:
  29. # Rules with regular expressions to be applied to the received metrics.
  30. # The first rule that matches the metric is applied and no further rules
  31. # are applied. If no rules match the metric is processed by the "plaintext"
  32. # parser.
  33. rules:
  34. # The first rule generates extract dimensions with keys: "base", "env",
  35. # and "host" if the "metric path" matches the regular expression of the
  36. # rule. Regular expression named captures prefixed with "key_" are used
  37. # to populate metric labels, while named captures prefixed with "name_"
  38. # are used to generate the final metric name. The "name_*" captures are
  39. # sorted by name and their values are used to compose the resulting
  40. # metric name.
  41. - regexp: "(?P<key_base>test)\\.env(?P<key_env>[^.]*)\\.(?P<key_host>[^.]*)"
  42. # name_prefix is added when to the resulting metric name.
  43. name_prefix: "name-prefix"
  44. # labels to be added to the metrics matching this rule.
  45. labels:
  46. dot.key: dot.value
  47. key: value
  48. # type is used to select the metric type to be set, the default is
  49. # "gauge", the other alternative is "cumulative".
  50. type: cumulative
  51. # The second rule for this "regex" parser.
  52. - regexp: "(?P<key_just>test)\\.(?P<key_match>.*)"
  53. # Name separator is used when concatenating named regular expression
  54. # captures prefixed with "name_"
  55. name_separator: "_"