Skip to content

Commit 99f8464

Browse files
authored
chore: update otel example to the latest versions (#2606)
1 parent 6f0af68 commit 99f8464

File tree

4 files changed

+76
-186
lines changed

4 files changed

+76
-186
lines changed

example/otel/config/alertmanager.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

example/otel/config/vector.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
[sources.syslog_logs]
22
type = "demo_logs"
33
format = "syslog"
4-
interval = 0.1
54

65
[sources.apache_common_logs]
76
type = "demo_logs"
87
format = "apache_common"
9-
interval = 0.1
108

119
[sources.apache_error_logs]
1210
type = "demo_logs"
1311
format = "apache_error"
14-
interval = 0.1
1512

1613
[sources.json_logs]
1714
type = "demo_logs"
1815
format = "json"
19-
interval = 0.1
2016

2117
# Parse Syslog logs
2218
# See the Vector Remap Language reference for more info: https://vrl.dev

example/otel/docker-compose.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22

33
services:
44
clickhouse:
5-
image: clickhouse/clickhouse-server:22.7
5+
image: clickhouse/clickhouse-server:22.10
66
restart: on-failure
77
environment:
88
CLICKHOUSE_DB: uptrace
@@ -12,17 +12,34 @@ services:
1212
timeout: 1s
1313
retries: 30
1414
volumes:
15-
- ch_data:/var/lib/clickhouse
15+
- ch_data1:/var/lib/clickhouse
1616
ports:
1717
- '8123:8123'
1818
- '9000:9000'
1919

20+
postgres:
21+
image: postgres:15-alpine
22+
restart: on-failure
23+
environment:
24+
PGDATA: /var/lib/postgresql/data/pgdata
25+
POSTGRES_USER: uptrace
26+
POSTGRES_PASSWORD: uptrace
27+
POSTGRES_DB: uptrace
28+
healthcheck:
29+
test: ['CMD-SHELL', 'pg_isready']
30+
interval: 1s
31+
timeout: 1s
32+
retries: 30
33+
volumes:
34+
- 'pg_data1:/var/lib/postgresql/data/pgdata'
35+
ports:
36+
- '5432:5432'
37+
2038
uptrace:
21-
image: 'uptrace/uptrace:1.3.0'
39+
image: 'uptrace/uptrace:1.4.7'
2240
#image: 'uptrace/uptrace-dev:latest'
2341
restart: on-failure
2442
volumes:
25-
- uptrace_data:/var/lib/uptrace
2643
- ./uptrace.yml:/etc/uptrace/uptrace.yml
2744
#environment:
2845
# - DEBUG=2
@@ -33,7 +50,7 @@ services:
3350
clickhouse:
3451
condition: service_healthy
3552

36-
otel-collector:
53+
otelcol:
3754
image: otel/opentelemetry-collector-contrib:0.58.0
3855
restart: on-failure
3956
volumes:
@@ -43,22 +60,10 @@ services:
4360
- '4318:4318'
4461

4562
vector:
46-
image: timberio/vector:0.24.X-alpine
63+
image: timberio/vector:0.28.X-alpine
4764
volumes:
4865
- ./config/vector.toml:/etc/vector/vector.toml:ro
4966

50-
alertmanager:
51-
image: prom/alertmanager:v0.24.0
52-
restart: on-failure
53-
volumes:
54-
- ./config/alertmanager.yml:/etc/alertmanager/config.yml
55-
- alertmanager_data:/alertmanager
56-
ports:
57-
- 9093:9093
58-
command:
59-
- '--config.file=/etc/alertmanager/config.yml'
60-
- '--storage.path=/alertmanager'
61-
6267
mailhog:
6368
image: mailhog/mailhog:v1.0.1
6469
restart: on-failure
@@ -73,6 +78,5 @@ services:
7378
image: redis
7479

7580
volumes:
76-
uptrace_data:
77-
ch_data:
78-
alertmanager_data:
81+
ch_data1:
82+
pg_data1:

example/otel/uptrace.yml

Lines changed: 51 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ ch:
2929
# Maximum query execution time.
3030
max_execution_time: 30s
3131

32+
##
33+
## PostgreSQL db that is used to store metadata such us metric names, dashboards, alerts,
34+
## and so on.
35+
##
36+
pg:
37+
addr: postgres:5432
38+
user: uptrace
39+
password: uptrace
40+
database: uptrace
41+
3242
##
3343
## A list of pre-configured projects. Each project is fully isolated.
3444
##
@@ -95,110 +105,42 @@ metrics_from_spans:
95105
where: span.is_event
96106

97107
##
98-
## Alerting rules for monitoring metrics.
99-
##
100-
## See https://uptrace.dev/get/alerting.html for details.
101-
##
102-
alerting:
103-
rules:
104-
- name: Network errors
105-
metrics:
106-
- system.network.errors as $net_errors
107-
query:
108-
- $net_errors > 0 group by host.name
109-
# for the last 5 minutes
110-
for: 5m
111-
annotations:
112-
summary: '{{ $labels.host_name }} has high number of net errors: {{ $values.net_errors }}'
113-
114-
- name: Filesystem usage >= 90%
115-
metrics:
116-
- system.filesystem.usage as $fs_usage
117-
query:
118-
- group by host.name
119-
- group by device
120-
- where device !~ "loop"
121-
- $fs_usage{state="used"} / $fs_usage >= 0.9
122-
for: 5m
123-
annotations:
124-
summary: '{{ $labels.host_name }} has high FS usage: {{ $values.fs_usage }}'
125-
126-
- name: Uptrace is dropping spans
127-
metrics:
128-
- uptrace.projects.spans as $spans
129-
query:
130-
- $spans{type=dropped} > 0
131-
for: 1m
132-
annotations:
133-
summary: 'Uptrace has dropped {{ $values.spans }} spans'
134-
135-
- name: Always firing (for fun and testing)
136-
metrics:
137-
- process.runtime.go.goroutines as $goroutines
138-
query:
139-
- $goroutines >= 0 group by host.name
140-
for: 1m
141-
annotations:
142-
summary: '{{ $labels.host_name }} has high number of goroutines: {{ $values.goroutines }}'
143-
144-
# Create alerts from error logs and span events.
145-
create_alerts_from_spans:
146-
enabled: true
147-
labels:
148-
alert_kind: error
149-
150-
##
151-
## AlertManager client configuration.
152-
## See https://uptrace.dev/get/alerting.html for details.
153-
##
154-
## Note that this is NOT an AlertManager config and you need to configure AlertManager separately.
155-
## See https://prometheus.io/docs/alerting/latest/configuration/ for details.
156-
##
157-
alertmanager_client:
158-
# AlertManager API endpoints that Uptrace uses to manage alerts.
159-
urls:
160-
- 'http://alertmanager:9093/api/v2/alerts'
161-
162-
##
163-
## To require authentication, uncomment the following section.
108+
## To require authentication, uncomment one of the following sections.
164109
##
165110
auth:
166-
# users:
167-
# - username: uptrace
168-
# password: uptrace
169-
# - username: admin
170-
# password: admin
171-
172-
# # Cloudflare user provider: uses Cloudflare Zero Trust Access (Identity)
173-
# # See https://developers.cloudflare.com/cloudflare-one/identity/ for more info.
111+
users:
112+
- name: Anonymous
113+
email: uptrace@localhost
114+
password: uptrace
115+
notify_by_email: true
116+
117+
# Cloudflare Zero Trust Access (Identity)
118+
# See https://developers.cloudflare.com/cloudflare-one/identity/ for more info.
174119
# cloudflare:
175120
# # The base URL of the Cloudflare Zero Trust team.
176121
# - team_url: https://myteam.cloudflareaccess.com
177122
# # The Application Audience (AUD) Tag for this application.
178123
# # You can retrieve this from the Cloudflare Zero Trust 'Access' Dashboard.
179124
# audience: bea6df23b944e4a0cd178609ba1bb64dc98dfe1f66ae7b918e563f6cf28b37e0
180125

181-
# # OpenID Connect (Single Sign-On)
182-
# oidc:
183-
# # The ID is used in API endpoints, for example, in redirect URL
184-
# # `http://<uptrace-host>/api/v1/sso/<oidc-id>/callback`.
185-
# - id: keycloak
186-
# # Display name for the button in the login form.
187-
# # Default to 'OpenID Connect'
188-
# display_name: Keycloak
189-
# # The base URL for the OIDC provider.
190-
# issuer_url: http://localhost:8080/realms/uptrace
191-
# # The OAuth 2.0 Client ID
192-
# client_id: uptrace
193-
# # The OAuth 2.0 Client Secret
194-
# client_secret: ogbhd8Q0X0e5AZFGSG3m9oirPvnetqkA
195-
# # Additional OAuth 2.0 scopes to request from the OIDC provider.
196-
# # Defaults to 'profile'. 'openid' is requested by default and need not be specified.
197-
# scopes:
198-
# - profile
199-
# # The OIDC UserInfo claim to use as the user's username.
200-
# # Defaults to 'preferred_username'.
201-
# claim: preferred_username
126+
# OpenID Connect (Single Sign-On)
127+
oidc:
128+
# # The ID is used in API endpoints, for example, in redirect URL
129+
# # `http://<uptrace-host>/api/v1/sso/<oidc-id>/callback`.
130+
# - id: keycloak
131+
# # Display name for the button in the login form.
132+
# # Default to 'OpenID Connect'
133+
# display_name: Keycloak
134+
# # The base URL for the OIDC provider.
135+
# issuer_url: http://localhost:8080/realms/uptrace
136+
# # The OAuth 2.0 Client ID
137+
# client_id: uptrace
138+
# # The OAuth 2.0 Client Secret
139+
# client_secret: ogbhd8Q0X0e5AZFGSG3m9oirPvnetqkA
140+
# # Additional OAuth 2.0 scopes to request from the OIDC provider.
141+
# # Defaults to 'profile'. 'openid' is requested by default and need not be specified.
142+
# scopes:
143+
# - profile
202144

203145
##
204146
## Various options to tweak ClickHouse schema.
@@ -248,6 +190,8 @@ listen:
248190
site:
249191
# Overrides public URL for Vue-powered UI in case you put Uptrace behind a proxy.
250192
#addr: 'https://uptrace.mydomain.com'
193+
# The base path for the Vue-powered UI in case you serve Uptrace UI behind a sub path.
194+
path: '/'
251195

252196
##
253197
## Spans processing options.
@@ -277,19 +221,6 @@ metrics:
277221
# The number of measures to insert in a single query.
278222
#batch_size: 10000
279223

280-
##
281-
## SQLite/PostgreSQL db that is used to store metadata such us metric names, dashboards, alerts,
282-
## and so on.
283-
##
284-
db:
285-
# Either sqlite or postgres.
286-
driver: sqlite
287-
# Database connection string.
288-
#
289-
# Uptrace automatically creates SQLite database file in the current working directory.
290-
# Make sure the directory is writable by Uptrace process.
291-
dsn: 'file:uptrace.sqlite3?_pragma=foreign_keys(1)&_pragma=busy_timeout(1000)'
292-
293224
##
294225
## uptrace-go client configuration.
295226
## Uptrace sends internal telemetry here. Defaults to listen.grpc.addr.
@@ -301,6 +232,18 @@ uptrace_go:
301232
# key_file: config/tls/uptrace.key
302233
# insecure_skip_verify: true
303234

235+
##
236+
## SMTP settings to send emails.
237+
## https://uptrace.dev/get/alerting.html
238+
##
239+
smtp_mailer:
240+
enabled: true
241+
host: mailhog
242+
port: 1025
243+
username: mailhog
244+
password: mailhog
245+
from: 'uptrace@localhost'
246+
304247
##
305248
## Logging configuration.
306249
##

0 commit comments

Comments
 (0)