1313# # foo: $$FOO_BAR
1414# #
1515
16+ # #
17+ # # ClickHouse database credentials.
18+ # #
19+ ch :
20+ # Connection string for ClickHouse database. For example:
21+ # clickhouse://<user>:<password>@<host>:<port>/<database>?sslmode=disable
22+ #
23+ # See https://clickhouse.uptrace.dev/guide/golang-clickhouse.html#options
24+ dsn : ' clickhouse://default:@clickhouse:9000/uptrace?sslmode=disable'
25+
1626# #
1727# # A list of pre-configured projects. Each project is fully isolated.
1828# #
@@ -26,6 +36,10 @@ projects:
2636 - service.name
2737 - host.name
2838 - deployment.environment
39+ # Group spans by deployment.environment attribute.
40+ group_by_env : false
41+ # Group funcs spans by service.name attribute.
42+ group_funcs_by_service : false
2943
3044 # Other projects can be used to monitor your applications.
3145 # To monitor micro-services or multiple related services, use a single project.
@@ -36,6 +50,49 @@ projects:
3650 - service.name
3751 - host.name
3852 - deployment.environment
53+ # Group spans by deployment.environment attribute.
54+ group_by_env : false
55+ # Group funcs spans by service.name attribute.
56+ group_funcs_by_service : false
57+
58+ # #
59+ # # Create metrics from spans and events.
60+ # #
61+ metrics_from_spans :
62+ - name : uptrace.tracing.spans_duration
63+ description : Spans duration (excluding events)
64+ instrument : histogram
65+ unit : microseconds
66+ value : span.duration / 1000
67+ attrs :
68+ - span.system as system
69+ - service.name as service
70+ - host.name as host
71+ - span.status_code as status
72+ where : not span.is_event
73+
74+ - name : uptrace.tracing.spans
75+ description : Spans count (excluding events)
76+ instrument : counter
77+ unit : 1
78+ value : span.count
79+ attrs :
80+ - span.system as system
81+ - service.name as service
82+ - host.name as host
83+ - span.status_code as status
84+ where : not span.is_event
85+
86+ - name : uptrace.tracing.events
87+ description : Events count (excluding spans)
88+ instrument : counter
89+ unit : 1
90+ value : span.count
91+ attrs :
92+ - span.system as system
93+ - service.name as service
94+ - host.name as host
95+ where : span.is_event
3996
4097# #
4198# # To require authentication, uncomment the following section.
@@ -78,16 +135,6 @@ auth:
78135 # # Defaults to 'preferred_username'.
79136 # claim: preferred_username
80137
81- # #
82- # # ClickHouse database credentials.
83- # #
84- ch :
85- # Connection string for ClickHouse database. For example:
86- # clickhouse://<user>:<password>@<host>:<port>/<database>?sslmode=disable
87- #
88- # See https://clickhouse.uptrace.dev/guide/golang-clickhouse.html#options
89- dsn : ' clickhouse://default:@clickhouse:9000/uptrace?sslmode=disable'
90-
91138# #
92139# # Alerting rules for monitoring metrics.
93140# #
@@ -102,8 +149,8 @@ alerting:
102149 - $net_errors > 0 group by host.name
103150 # for the last 5 minutes
104151 for : 5m
105- # in the project id=1
106- projects : [1]
152+ annotations :
153+ summary : ' {{ $labels.host_name }} has high number of net errors: {{ $values.net_errors }} '
107154
108155 - name : Filesystem usage >= 90%
109156 metrics :
@@ -114,15 +161,26 @@ alerting:
114161 - where device !~ "loop"
115162 - $fs_usage{state="used"} / $fs_usage >= 0.9
116163 for : 5m
117- projects : [1]
164+ annotations :
165+ summary : ' {{ $labels.host_name }} has high FS usage: {{ $values.fs_usage }}'
118166
119167 - name : Uptrace is dropping spans
120168 metrics :
121169 - uptrace.projects.spans as $spans
122170 query :
123171 - $spans{type=dropped} > 0
124172 for : 1m
125- projects : [1]
173+ annotations :
174+ summary : ' Uptrace has dropped {{ $values.spans }} spans'
175+
176+ - name : Always firing (for fun and testing)
177+ metrics :
178+ - process.runtime.go.goroutines as $goroutines
179+ query :
180+ - $goroutines >= 0 group by host.name
181+ for : 1m
182+ annotations :
183+ summary : ' {{ $labels.host_name }} has high number of goroutines: {{ $values.goroutines }}'
126184
127185 # Create alerts from error logs and span events.
128186 create_alerts_from_spans :
@@ -139,8 +197,8 @@ alerting:
139197# #
140198alertmanager_client :
141199 # AlertManager API endpoints that Uptrace uses to manage alerts.
142- # urls:
143- # - 'http://alertmanager:9093/api/v2/alerts'
200+ urls :
201+ - ' http://alertmanager:9093/api/v2/alerts'
144202
145203# #
146204# # Various options to tweak ClickHouse schema.
0 commit comments