Skip to content

Commit c413b3e

Browse files
joonasconnorsmith256
authored andcommitted
feat(examples): Add standalone docker compose setup for OTEL
Signed-off-by: Joonas Bergius <joonas@cosmonic.com>
1 parent ced0103 commit c413b3e

6 files changed

+200
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: 1
2+
3+
datasources:
4+
- name: Loki
5+
type: loki
6+
access: proxy
7+
orgId: 1
8+
url: http://loki:3100
9+
basicAuth: false
10+
version: 1
11+
editable: false
12+
- name: Prometheus
13+
type: prometheus
14+
url: http://prometheus:9090
15+
access: proxy
16+
editable: true
17+
- name: Tempo
18+
type: tempo
19+
access: proxy
20+
url: http://tempo:7999
21+
version: 1
22+
editable: false
23+
uid: tempo

examples/docker/config/loki.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
auth_enabled: false
2+
3+
server:
4+
http_listen_port: 3100
5+
6+
common:
7+
path_prefix: /loki
8+
storage:
9+
filesystem:
10+
chunks_directory: /loki/chunks
11+
rules_directory: /loki/rules
12+
replication_factor: 1
13+
ring:
14+
kvstore:
15+
store: inmemory
16+
17+
schema_config:
18+
configs:
19+
- from: 2020-10-24
20+
store: boltdb-shipper
21+
object_store: filesystem
22+
schema: v11
23+
index:
24+
prefix: index_
25+
period: 24h
26+
27+
ruler:
28+
alertmanager_url: http://localhost:9093
29+
30+
# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
31+
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
32+
#
33+
# If you would like to enable reporting, comment out the following lines:
34+
analytics:
35+
reporting_enabled: false
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
12+
processors:
13+
batch:
14+
15+
exporters:
16+
debug:
17+
loki:
18+
endpoint: http://loki:3100/loki/api/v1/push
19+
default_labels_enabled:
20+
exporter: false
21+
job: true
22+
prometheusremotewrite:
23+
endpoint: http://prometheus:9090/api/v1/write
24+
tls:
25+
insecure: true
26+
otlphttp/tempo:
27+
endpoint: http://tempo:4318
28+
29+
service:
30+
pipelines:
31+
traces:
32+
receivers: [otlp]
33+
processors: [batch]
34+
exporters: [otlphttp/tempo, debug]
35+
36+
metrics:
37+
receivers: [otlp]
38+
processors: [batch]
39+
exporters: [prometheusremotewrite, debug]
40+
41+
logs:
42+
receivers: [otlp]
43+
processors: [batch]
44+
exporters: [loki, debug]
45+
46+
extensions: [health_check]
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
global:
2+
scrape_interval: 15s
3+
scrape_timeout: 10s
4+
evaluation_interval: 15s
5+
scrape_configs:

examples/docker/config/tempo.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
server:
2+
http_listen_port: 7999
3+
4+
distributor:
5+
log_received_spans:
6+
enabled: true
7+
receivers:
8+
otlp:
9+
protocols:
10+
http:
11+
endpoint: "0.0.0.0:4318"
12+
13+
storage:
14+
trace:
15+
backend: local
16+
block:
17+
v2_encoding: zstd
18+
wal:
19+
path: /tmp/tempo/wal
20+
v2_encoding: none
21+
local:
22+
path: /tmp/tempo/blocks
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# This docker-compose file starts the entire wasmCloud observability ecosystem, including:
2+
# grafana for dashboards
3+
# otel-collector for ingesting the OTLP signals from wasmcloud host
4+
# . prometheus for metrics
5+
# . tempo for traces
6+
# . loki for logs
7+
8+
version: "3"
9+
services:
10+
grafana:
11+
image: grafana/grafana:10.0.10
12+
ports:
13+
- 5050:3000
14+
environment:
15+
- GF_AUTH_ANONYMOUS_ENABLED=true
16+
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
17+
- GF_AUTH_DISABLE_LOGIN_FORM=true
18+
volumes:
19+
- ./config/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
20+
depends_on:
21+
- loki
22+
- prometheus
23+
- tempo
24+
25+
otelcol:
26+
image: otel/opentelemetry-collector-contrib:0.93.0
27+
command:
28+
- '--config=/etc/otelcol/config.yaml'
29+
volumes:
30+
- ./config/otel-collector.yaml:/etc/otelcol/config.yaml
31+
ports:
32+
- 4317:4317
33+
- 4318:4318
34+
depends_on:
35+
- loki
36+
- prometheus
37+
- tempo
38+
39+
loki:
40+
image: grafana/loki:2.9.4
41+
command:
42+
- '-config.file=/etc/loki/config.yaml'
43+
volumes:
44+
- ./config/loki.yaml:/etc/loki/config.yaml
45+
ports:
46+
- 3100:3100
47+
restart: unless-stopped
48+
49+
prometheus:
50+
image: prom/prometheus:v2.49.1
51+
command:
52+
- '--config.file=/etc/prometheus/config.yaml'
53+
- '--web.enable-remote-write-receiver'
54+
- '--enable-feature=native-histograms'
55+
volumes:
56+
- ./config/prometheus.yaml:/etc/prometheus/config.yaml
57+
ports:
58+
- 9090:9090
59+
restart: unless-stopped
60+
61+
tempo:
62+
image: grafana/tempo:2.3.1
63+
command:
64+
- '-config.file=/etc/tempo/config.yaml'
65+
volumes:
66+
- ./config/tempo.yaml:/etc/tempo/config.yaml
67+
ports:
68+
- 4318 # This port is used for sending traces from otel-collector to tempo
69+
- 7999:7999 # tempo

0 commit comments

Comments
 (0)