2
0

otel-collector-config.yaml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. receivers:
  2. otlp:
  3. protocols:
  4. http:
  5. grpc:
  6. endpoint: 0.0.0.0:4317
  7. filelog/jitsi-containers:
  8. include: ['/var/lib/docker/containers/*/*.log']
  9. encoding: utf-8
  10. operators:
  11. - type: json_parser
  12. id: parser-docker
  13. output: filter_non_tagged_containers
  14. timestamp:
  15. parse_from: attributes.time
  16. layout: '%Y-%m-%dT%H:%M:%S.%LZ'
  17. - type: filter
  18. id: filter_non_tagged_containers
  19. expr: |
  20. (attributes?.attrs?.service != "jitsi-web" and
  21. attributes?.attrs?.service != "jitsi-jicofo" and
  22. attributes?.attrs?.service != "jitsi-jvb" and
  23. attributes?.attrs?.service != "jitsi-prosody")
  24. output: regex_parser_choice
  25. - type: router
  26. id: regex_parser_choice
  27. routes:
  28. - expr: 'attributes.attrs.service == "jitsi-web"'
  29. output: jitsi_web_parser
  30. - expr: 'attributes.attrs.service == "jitsi-jicofo"'
  31. output: jitsi_jicofo_parser
  32. - expr: 'attributes.attrs.service == "jitsi-jvb"'
  33. output: jitsi_jvb_parser
  34. - expr: 'attributes.attrs.service == "jitsi-prosody"'
  35. output: jitsi_prosody_parser
  36. - type: regex_parser
  37. id: jitsi_web_parser
  38. parse_from: attributes.log
  39. regex: "^(?P<message>[\\s\\S]*)$|^(\\[(?P<temp_meta>[\\w\\W]+)\\] (?P<temp_message>[\\S\\s]*)$)"
  40. - type: regex_parser
  41. id: jitsi_jicofo_parser
  42. parse_from: attributes.log
  43. regex: "(^(?P<app>\\w+) (?P<timestamp>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) (?P<level>\\w+): \\[(?P<pid>\\d+)\\]( \\[(?P<meta>[\\w\\W]+)\\])? (?P<codefile>[\\w\\W]+)(#(?P<codeline>\\d+))?: (?P<message>[\\s\\S]*)$)|^(\\[(?P<temp_meta>[\\w\\W]+)\\] (?P<temp_message>[\\S\\s]*)$)"
  44. output: move_meta_key
  45. - type: regex_parser
  46. id: jitsi_jvb_parser
  47. parse_from: attributes.log
  48. regex: "^(?P<app>JVB) \\[(?P<pid>\\d+)\\] (?P<codefile>[\\w\\.]+)#(?P<codeline>\\d+): (?P<message>[\\S\\s]*)$"
  49. - type: regex_parser
  50. id: jitsi_prosody_parser
  51. parse_from: attributes.log
  52. regex: (^(?<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\s+(?<service>\S+)\s+(?<level>\w{0,10})(\t)(?P<message>[\s\S]*)$)|^(\[(?P<temp_meta>[\w\W]+)\] (?P<temp_message>[\S\s]*)$)
  53. output: move_meta_key
  54. - type: move
  55. id: move_meta_key
  56. if: "attributes.temp_meta != nil and attributes.temp_meta != ''"
  57. from: attributes.temp_meta
  58. to: attributes.meta
  59. output: move_message_key
  60. - type: move
  61. id: move_message_key
  62. if: "attributes.temp_message != nil and attributes.temp_message != ''"
  63. from: attributes.temp_message
  64. to: attributes.message
  65. docker_stats:
  66. endpoint: "unix:///var/run/docker.sock"
  67. processors:
  68. batch:
  69. exporters:
  70. logging:
  71. loglevel: debug
  72. loki:
  73. endpoint: "http://loki:3100/loki/api/v1/push"
  74. prometheus:
  75. endpoint: "0.0.0.0:9464"
  76. service:
  77. pipelines:
  78. logs:
  79. receivers: [otlp, filelog/jitsi-containers]
  80. processors: [batch]
  81. exporters: [loki]
  82. metrics:
  83. receivers: [docker_stats]
  84. processors: [batch]
  85. exporters: [prometheus]