Skip to content

Commit 32eb0f2

Browse files
committed
chore: configure Uptrace
1 parent 742594f commit 32eb0f2

File tree

3 files changed

+383
-0
lines changed

3 files changed

+383
-0
lines changed

docker-compose.yml

+72
Original file line numberDiff line numberDiff line change
@@ -874,3 +874,75 @@ services:
874874
retries: 60
875875
ports:
876876
- 5432
877+
878+
uptrace_clickhouse:
879+
image: clickhouse/clickhouse-server:22.10
880+
restart: on-failure
881+
environment:
882+
CLICKHOUSE_DB: uptrace
883+
healthcheck:
884+
test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"]
885+
interval: 1s
886+
timeout: 1s
887+
retries: 30
888+
volumes:
889+
- ch_data:/var/lib/clickhouse
890+
ports:
891+
- "8123:8123"
892+
- "9000:9000"
893+
894+
uptrace_postgres:
895+
image: postgres:15-alpine
896+
restart: on-failure
897+
environment:
898+
PGDATA: /var/lib/postgresql/data/pgdata
899+
POSTGRES_USER: uptrace
900+
POSTGRES_PASSWORD: uptrace
901+
POSTGRES_DB: uptrace
902+
healthcheck:
903+
test: ["CMD-SHELL", "pg_isready"]
904+
interval: 1s
905+
timeout: 1s
906+
retries: 30
907+
volumes:
908+
- "pg_data:/var/lib/postgresql/data/pgdata"
909+
ports:
910+
- "5432:5432"
911+
912+
uptrace:
913+
image: "uptrace/uptrace:1.7.1"
914+
#image: "uptrace/uptrace-dev:latest"
915+
restart: on-failure
916+
volumes:
917+
- uptrace_data:/var/lib/uptrace
918+
- ./src/uptrace/uptrace.yml:/etc/uptrace/uptrace.yml
919+
#environment:
920+
# - DEBUG=2
921+
ports:
922+
- "14317:14317"
923+
- "14318:14318"
924+
depends_on:
925+
uptrace_clickhouse:
926+
condition: service_healthy
927+
uptrace_postgres:
928+
condition: service_healthy
929+
930+
uptrace_mailpit:
931+
image: axllent/mailpit
932+
restart: always
933+
ports:
934+
- 1025:1025
935+
- 8025:8025
936+
environment:
937+
MP_MAX_MESSAGES: 5000
938+
MP_DATA_FILE: /data/mailpit.db
939+
MP_SMTP_AUTH_ACCEPT_ANY: 1
940+
MP_SMTP_AUTH_ALLOW_INSECURE: 1
941+
volumes:
942+
- mailpit_data:/data
943+
944+
volumes:
945+
uptrace_data:
946+
ch_data:
947+
pg_data:
948+
mailpit_data:

src/otelcollector/otelcol-config-extras.yml

+43
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,46 @@
1616
# pipelines:
1717
# traces:
1818
# exporters: [spanmetrics, otlphttp/example]
19+
20+
receivers:
21+
otlp:
22+
protocols:
23+
grpc:
24+
http:
25+
postgresql:
26+
endpoint: uptrace_postgres:5432
27+
transport: tcp
28+
username: uptrace
29+
password: uptrace
30+
databases:
31+
- uptrace
32+
tls:
33+
insecure: true
34+
35+
exporters:
36+
otlp/uptrace:
37+
endpoint: "uptrace:14317"
38+
#endpoint: "otlp.uptrace.dev:4317"
39+
tls:
40+
insecure: true
41+
headers:
42+
uptrace-dsn: "http://project2_secret_token@localhost:14317/2"
43+
logging:
44+
45+
processors:
46+
batch:
47+
48+
service:
49+
pipelines:
50+
traces:
51+
receivers: [otlp]
52+
processors: [batch]
53+
exporters: [logging, otlp/uptrace]
54+
metrics:
55+
receivers: [otlp, postgresql]
56+
processors: [batch]
57+
exporters: [logging, otlp/uptrace]
58+
logs:
59+
receivers: [otlp]
60+
processors: [batch]
61+
exporters: [logging, otlp/uptrace]

src/uptrace/uptrace.yml

+268
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
##
2+
## Uptrace configuration file.
3+
## See https://uptrace.dev/get/config.html for details.
4+
##
5+
## You can use environment variables anywhere in this file, for example:
6+
##
7+
## foo: $FOO
8+
## bar: ${BAR}
9+
## baz: ${BAZ:default}
10+
##
11+
## To escape `$`, use `$$`, for example:
12+
##
13+
## foo: $$FOO_BAR
14+
##
15+
16+
##
17+
## ClickHouse database credentials.
18+
##
19+
ch:
20+
addr: uptrace_clickhouse:9000
21+
user: default
22+
password:
23+
database: uptrace
24+
25+
# TLS configuration. Uncomment to enable.
26+
# tls:
27+
# insecure_skip_verify: true # only for self-signed certificates
28+
29+
# Maximum query execution time.
30+
max_execution_time: 30s
31+
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: uptrace_postgres:5432
38+
user: uptrace
39+
password: uptrace
40+
database: uptrace
41+
42+
# TLS configuration. Uncomment to enable.
43+
# tls:
44+
# insecure_skip_verify: true # only for self-signed certificates
45+
46+
##
47+
## A list of pre-configured projects. Each project is fully isolated.
48+
##
49+
projects:
50+
# Conventionally, the first project is used to monitor Uptrace itself.
51+
- id: 1
52+
name: Uptrace
53+
# Token grants write access to the project. Keep a secret.
54+
token: project1_secret_token
55+
pinned_attrs:
56+
- service_name
57+
- host_name
58+
- deployment_environment
59+
# Group spans by deployment.environment attribute.
60+
group_by_env: false
61+
# Group funcs spans by service.name attribute.
62+
group_funcs_by_service: false
63+
# Enable prom_compat if you want to use the project as a Prometheus datasource in Grafana.
64+
prom_compat: true
65+
# Force using the original span name as a `display.name` for these instrumentation libraries.
66+
# See https://uptrace.dev/get/grouping.html#display-name
67+
force_span_name: ["my_instrumentation_library"]
68+
69+
# Other projects can be used to monitor your applications.
70+
# To monitor micro-services or multiple related services, use a single project.
71+
- id: 2
72+
name: My project
73+
token: project2_secret_token
74+
pinned_attrs:
75+
- service_name
76+
- host_name
77+
- deployment_environment
78+
prom_compat: true
79+
80+
auth:
81+
users:
82+
- name: John Doe
83+
email: uptrace@localhost
84+
password: uptrace
85+
notify_by_email: true
86+
# Auth token required to use JSON API.
87+
# https://uptrace.dev/get/json-api.html
88+
#auth_token: secret_token
89+
90+
# Cloudflare Zero Trust Access (Identity)
91+
# See https://developers.cloudflare.com/cloudflare-one/identity/ for more info.
92+
# cloudflare:
93+
# # The base URL of the Cloudflare Zero Trust team.
94+
# - team_url: https://myteam.cloudflareaccess.com
95+
# # The Application Audience (AUD) Tag for this application.
96+
# # You can retrieve this from the Cloudflare Zero Trust 'Access' Dashboard.
97+
# audience: bea6df23b944e4a0cd178609ba1bb64dc98dfe1f66ae7b918e563f6cf28b37e0
98+
99+
# OpenID Connect (Single Sign-On)
100+
# oidc:
101+
# # The ID is used in API endpoints, for example, in redirect URL
102+
# # `http://<uptrace-host>/api/v1/sso/<oidc-id>/callback`.
103+
# - id: keycloak
104+
# # Display name for the button in the login form.
105+
# # Default to 'OpenID Connect'
106+
# display_name: Keycloak
107+
# # The base URL for the OIDC provider.
108+
# issuer_url: http://localhost:8080/realms/uptrace
109+
# # The OAuth 2.0 Client ID
110+
# client_id: uptrace
111+
# # The OAuth 2.0 Client Secret
112+
# client_secret: ogbhd8Q0X0e5AZFGSG3m9oirPvnetqkA
113+
# # Additional OAuth 2.0 scopes to request from the OIDC provider.
114+
# # Defaults to 'profile'. 'openid' is requested by default and need not be specified.
115+
# scopes:
116+
# - profile
117+
118+
##
119+
## Various options to tweak ClickHouse schema.
120+
## For changes to take effect, you need reset the ClickHouse database with `ch reset`.
121+
##
122+
ch_schema:
123+
# Compression codec, for example, LZ4, ZSTD(3), or Default.
124+
compression: ZSTD(1)
125+
126+
# Cluster name for Distributed tables and ON CLUSTER clause.
127+
#cluster: uptrace1
128+
129+
# Whether to use ClickHouse replication.
130+
# Cluster name is required when replication is enabled.
131+
#replicated: true
132+
133+
spans:
134+
# Delete spans data after 7 days.
135+
ttl_delete: 7 DAY
136+
storage_policy: "default"
137+
138+
metrics:
139+
# Delete metrics data after 30 days.
140+
ttl_delete: 30 DAY
141+
storage_policy: "default"
142+
143+
##
144+
## Addresses on which Uptrace receives gRPC and HTTP requests.
145+
##
146+
listen:
147+
# OTLP/gRPC API.
148+
grpc:
149+
addr: ":14317"
150+
151+
# OTLP/HTTP API and Uptrace API with Vue UI.
152+
http:
153+
addr: ":14318"
154+
155+
# tls:
156+
# cert_file: config/tls/uptrace.crt
157+
# key_file: config/tls/uptrace.key
158+
159+
##
160+
## Various options for Uptrace UI.
161+
##
162+
site:
163+
# Overrides public URL for Vue-powered UI.
164+
#addr: 'https://uptrace.mydomain.com/prefix'
165+
166+
##
167+
## Spans processing options.
168+
##
169+
spans:
170+
# The size of the Go chan used to buffer incoming spans.
171+
# If the buffer is full, Uptrace starts to drop spans.
172+
#buffer_size: 100000
173+
174+
# The number of spans to insert in a single query.
175+
#batch_size: 10000
176+
177+
##
178+
## Metrics processing options.
179+
##
180+
metrics:
181+
# List of attributes to drop for being noisy.
182+
drop_attrs:
183+
- telemetry_sdk_language
184+
- telemetry_sdk_name
185+
- telemetry_sdk_version
186+
187+
# The size of the Go chan used to buffer incoming measures.
188+
# If the buffer is full, Uptrace starts to drop measures.
189+
#buffer_size: 100000
190+
191+
# The number of measures to insert in a single query.
192+
#batch_size: 10000
193+
194+
# The size of the buffer for converting cumulative metrics to delta.
195+
#cum_to_delta_size: 100000
196+
197+
###
198+
### Service graph processing options.
199+
###
200+
service_graph:
201+
# Uncomment to disable.
202+
#disabled: true
203+
store:
204+
# Number of incomplete edges to store.
205+
# If the store is full, the edge is dropped.
206+
size: 1000000
207+
# For how long the incomplete edges are stored.
208+
ttl: 5s
209+
210+
##
211+
## SMTP settings to send emails.
212+
## https://uptrace.dev/get/alerting.html
213+
##
214+
smtp_mailer:
215+
# Whether to use this mailer for sending emails.
216+
enabled: true
217+
# SMTP server host.
218+
host: uptrace_mailpit
219+
# SMTP server port.
220+
port: 1025
221+
# Username for authentication.
222+
username: mailhog
223+
# Password for authentication.
224+
password: mailhog
225+
# Uncomment to disable opportunistic TLS.
226+
#tls: { disabled: true }
227+
# Emails will be send from this address.
228+
from: "uptrace@localhost"
229+
230+
##
231+
## uptrace-go client configuration.
232+
## Uptrace sends internal telemetry here. Defaults to listen.grpc.addr.
233+
##
234+
uptrace_go:
235+
# Enabled by default.
236+
#disabled: true
237+
238+
# Defaults to the first project.
239+
# dsn: http://project1_secret_token@localhost:14317/1
240+
241+
# tls:
242+
# cert_file: config/tls/uptrace.crt
243+
# key_file: config/tls/uptrace.key
244+
# insecure_skip_verify: true
245+
246+
##
247+
## Token for the Telegram bot that will be sending notifications to Telegram channels.
248+
## Required if you are planning to use Telegram for notifications.
249+
##
250+
## To create a new bot, follow this guide:
251+
## https://sendpulse.com/knowledge-base/chatbot/telegram/create-telegram-chatbot
252+
##
253+
telegram:
254+
bot_token: ""
255+
256+
##
257+
## Logging configuration.
258+
##
259+
logging:
260+
# Zap minimal logging level.
261+
# Valid values: DEBUG, INFO, WARN, ERROR, DPANIC, PANIC, FATAL.
262+
level: INFO
263+
264+
# Secret key that is used to sign JWT tokens etc.
265+
secret_key: 102c1a557c314fc28198acd017960843
266+
267+
# Enable to log HTTP requests and database queries.
268+
debug: false

0 commit comments

Comments
 (0)