1+ extensions :
2+ health_check :
3+
4+ receivers :
5+ otlp :
6+ protocols :
7+ grpc :
8+ endpoint : " 0.0.0.0:4317"
9+ http :
10+ endpoint : " 0.0.0.0:4318"
11+ statsd :
12+ endpoint : " 0.0.0.0:8125"
13+ aggregation_interval : 10s
14+ enable_metric_type : true
15+ redis :
16+ endpoint : " merginmaps-redis:6379"
17+ collection_interval : 10s
18+ # password: "${REDIS_PASSWORD}"
19+ # This replaces Promtail
20+ filelog :
21+ include :
22+ - /var/lib/docker/containers/*/*.log
23+ start_at : end
24+ include_file_path : true
25+ operators :
26+ - type : json_parser
27+ - type : move
28+ from : attributes.log
29+ to : body
30+ - type : regex_parser
31+ parse_from : attributes["log.file.path"]
32+ regex : ' /var/lib/docker/containers/(?P<container_id>[a-f0-9]{12})'
33+ on_error : send
34+
35+ processors :
36+ resourcedetection/docker :
37+ detectors : [env, docker]
38+ timeout : 2s
39+ override : true
40+ filter/exclude_collector :
41+ logs :
42+ log_record :
43+ - ' IsMatch(body, ".*exporterhelper.*")'
44+ - ' IsMatch(body, ".*Debug.*")'
45+ - ' IsMatch(body, ".*kind.*exporter.*")'
46+ batch :
47+ transform/logs :
48+ log_statements :
49+ - context : log
50+ statements :
51+ - set(resource.attributes["container_id"], attributes["container_id"]) where attributes["container_id"] != nil
52+ transform :
53+ metric_statements :
54+ - context : metric
55+ statements :
56+ - set(name, "mergin_gunicorn_workers") where name == "app.gunicorn.workers"
57+ - set(name, "mergin_gunicorn_request_duration") where name == "app.gunicorn.request.duration"
58+ # these metrics are not working
59+ - set(name, "mergin_gunicorn_request_rate") where name == "app.gunicorn.requests"
60+ - set(name, "mergin_gunicorn_log_critical") where name == "gunicorn.log.critical"
61+ - set(name, "mergin_gunicorn_log_error") where name == "gunicorn.log.error"
62+ - set(name, "mergin_gunicorn_log_warning") where name == "gunicorn.log.warning"
63+ - set(name, "mergin_gunicorn_log_exception") where name == "gunicorn.log.exception"
64+ - set(name, "mergin_gunicorn_response_code_200") where name == "app.gunicorn.request.status.200"
65+ # log_statements:
66+ # - context: log
67+ # statements:
68+ # - set(attributes["service_name"], attributes["docker_id"])
69+ # - set(resource.attributes["service.name"], attributes["docker_id"])
70+ attributes :
71+ actions :
72+ - key : service.name
73+ action : insert
74+ value : " merginmaps"
75+
76+
77+ exporters :
78+ prometheus :
79+ endpoint : " 0.0.0.0:8889" # The Collector will "host" metrics here
80+ resource_to_telemetry_conversion :
81+ enabled : true # Converts OTel resource attributes to Prometheus labels
82+ add_metric_suffixes : true
83+ otlp :
84+ endpoint : " merginmaps-tempo:4317"
85+ tls :
86+ insecure : true
87+ loki :
88+ endpoint : " http://merginmaps-loki:3100/loki/api/v1/push"
89+ # This ensures the trace and span IDs are included in the log metadata
90+ default_labels_enabled :
91+ exporter : true
92+ job : true
93+ instance : true
94+ level : true
95+ debug :
96+ verbosity : detailed
97+ otlphttp/loki :
98+ endpoint : " http://loki:3100/otlp"
99+ tls :
100+ insecure : true
101+
102+ service :
103+ extensions : [health_check]
104+ telemetry :
105+ metrics :
106+ address : 0.0.0.0:8888 # This enables the /metrics port
107+ logs :
108+ level : " warn"
109+ pipelines :
110+ metrics :
111+ receivers : [otlp, statsd, redis]
112+ processors : [transform, batch]
113+ exporters : [prometheus]
114+ traces :
115+ receivers : [otlp]
116+ processors : [batch]
117+ exporters : [otlp]
118+ logs :
119+ receivers : [filelog]
120+ processors : [filter/exclude_collector, resourcedetection/docker, attributes, transform/logs, batch]
121+ exporters : [otlphttp/loki]
0 commit comments