Skip to content

Commit 3b4ef1f

Browse files
authored
Add otel-collector, connect to Loki, Tempo, Prometheus to receive Beholder metrics (#1737)
Beholder metrics, otel-collector, debug tests
1 parent dd68a64 commit 3b4ef1f

File tree

11 files changed

+550
-36
lines changed

11 files changed

+550
-36
lines changed

framework/.changeset/v0.6.3.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Add otel-collector and connect it with Loki, Tempo and Prometheus
2+
- Tune Tempo, verify we can store traces for hours
3+
- Add basic tests to debug metrics, logs and traces endpoints

framework/cmd/observability/compose/conf/prometheus.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ global:
22
scrape_interval: 10s
33

44
scrape_configs:
5+
- job_name: 'otel-collector'
6+
scrape_interval: 10s
7+
static_configs:
8+
- targets: [ 'otel-collector:8889' ]
59
- job_name: 'ctf'
610
metrics_path: /metrics
711
docker_sd_configs:

framework/cmd/observability/compose/conf/provisioning/datasources/loki.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
apiVersion: 1
22

33
datasources:
4+
- name: Tempo
5+
type: tempo
6+
access: proxy
7+
url: http://tempo:3200
8+
isDefault: false
49
- name: Loki
510
type: loki
611
isDefault: true

framework/cmd/observability/compose/docker-compose.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
services:
2+
tempo:
3+
image: grafana/tempo:2.3.1
4+
command: [ "-config.file=/etc/tempo.yaml" ]
5+
volumes:
6+
- ./tempo.yaml:/etc/tempo.yaml
7+
- tempo_data:/tmp/tempo
8+
ports:
9+
- "3200:3200" # tempo
10+
# - "5317:4317" # otlp grpc
11+
# - "5318:4318" # otlp http
12+
- "9411:9411" # zipkin
13+
- "14268:14268" # jaeger ingest
14+
- "14250:14250" # jaeger grpc
15+
- "55680:55680" # otlp http legacy
16+
otel-collector:
17+
image: otel/opentelemetry-collector:latest
18+
volumes:
19+
- ./otel.yaml:/etc/otel/config.yaml
20+
command:
21+
- '--config=/etc/otel/config.yaml'
22+
ports:
23+
- "4317:4317" # grpc
24+
- "4318:4318" # http
25+
- "8889:8889" # Prometheus scrape target
26+
depends_on:
27+
- loki
228
cadvisor:
329
image: gcr.io/cadvisor/cadvisor:v0.51.0
430
container_name: cadvisor
@@ -23,7 +49,7 @@ services:
2349
- '9099:9090'
2450

2551
loki:
26-
image: grafana/loki:2.5.0
52+
image: grafana/loki:3.4.1
2753
volumes:
2854
- ./loki-config.yaml:/etc/loki/mounted-config.yaml
2955
- ./conf/provisioning/rules/rules.yml:/etc/loki/rules/fake/rules.yml
@@ -47,6 +73,10 @@ services:
4773
- ./conf/provisioning/dashboards/cadvisor/cadvisor.json:/var/lib/grafana/dashboards/cadvisor/cadvisor.json
4874
ports:
4975
- '3000:3000'
76+
depends_on:
77+
- prometheus
78+
- loki
79+
- tempo
5080

5181
pyroscope:
5282
image: 'pyroscope/pyroscope:latest'
@@ -106,3 +136,4 @@ volumes:
106136
grafana_home:
107137
grafana_logs:
108138
grafana_plugins:
139+
tempo_data:
Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,40 @@
1+
2+
# This is a complete configuration to deploy Loki backed by the filesystem.
3+
# The index will be shipped to the storage via tsdb-shipper.
4+
15
auth_enabled: false
26

7+
limits_config:
8+
allow_structured_metadata: true
9+
volume_enabled: true
10+
311
server:
412
http_listen_port: 3100
5-
grpc_listen_port: 9096
6-
7-
limits_config:
8-
unordered_writes: true
913

10-
ingester:
11-
max_chunk_age: 1000h
1214
common:
13-
path_prefix: /tmp/loki
14-
storage:
15-
filesystem:
16-
chunks_directory: /tmp/loki/chunks
17-
rules_directory: /tmp/loki/rules
18-
replication_factor: 1
1915
ring:
20-
instance_addr: 127.0.0.1
16+
instance_addr: 0.0.0.0
2117
kvstore:
2218
store: inmemory
19+
replication_factor: 1
20+
path_prefix: /tmp/loki
2321

2422
schema_config:
2523
configs:
26-
- from: 2020-10-24
27-
store: boltdb-shipper
24+
- from: 2020-05-15
25+
store: tsdb
2826
object_store: filesystem
29-
schema: v11
27+
schema: v13
3028
index:
3129
prefix: index_
3230
period: 24h
3331

34-
ruler:
35-
alertmanager_url: http://localhost:9093
36-
# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
37-
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
38-
#
39-
# Statistics help us better understand how Loki is used, and they show us performance
40-
# levels for most users. This helps us prioritize features and documentation.
41-
# For more information on what's sent, look at
42-
# https://github.com/grafana/loki/blob/main/pkg/usagestats/stats.go
43-
# Refer to the buildReport method to see what goes into a report.
44-
#
45-
# If you would like to disable reporting, uncomment the following lines:
46-
analytics:
47-
reporting_enabled: false
32+
storage_config:
33+
tsdb_shipper:
34+
active_index_directory: /tmp/loki/index
35+
cache_location: /tmp/loki/index_cache
36+
filesystem:
37+
directory: /tmp/loki/chunks
38+
39+
pattern_ingester:
40+
enabled: true
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
receivers:
2+
otlp:
3+
protocols:
4+
grpc:
5+
endpoint: 0.0.0.0:4317
6+
http:
7+
endpoint: 0.0.0.0:4318
8+
9+
processors:
10+
batch:
11+
12+
exporters:
13+
debug:
14+
verbosity: detailed
15+
sampling_initial: 5
16+
sampling_thereafter: 200
17+
otlphttp/logs:
18+
endpoint: "http://loki:3100/otlp"
19+
tls:
20+
insecure: true
21+
otlp:
22+
endpoint: "http://tempo:4317"
23+
tls:
24+
insecure: true
25+
prometheus:
26+
endpoint: "0.0.0.0:8889"
27+
28+
service:
29+
pipelines:
30+
traces:
31+
receivers: [otlp]
32+
processors: [batch]
33+
exporters: [debug, otlp]
34+
logs:
35+
receivers: [otlp]
36+
processors: [batch]
37+
exporters: [debug, otlphttp/logs]
38+
metrics:
39+
receivers: [otlp]
40+
processors: [batch]
41+
exporters: [debug, prometheus]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
server:
2+
http_listen_port: 3200
3+
4+
distributor:
5+
receivers:
6+
otlp:
7+
protocols:
8+
grpc:
9+
http:
10+
11+
overrides:
12+
max_traces_per_user: 50000
13+
14+
storage:
15+
trace:
16+
backend: local
17+
local:
18+
path: /tmp/tempo/blocks
19+
wal:
20+
path: /tmp/tempo/wal
21+
22+
compactor:
23+
compaction:
24+
max_block_bytes: 1073741824 # 1GB max block size
25+
max_compaction_objects: 1000000

0 commit comments

Comments
 (0)