Skip to content

Commit 295f931

Browse files
authored
feat: DEVOPS-1887 opentelemetry metrics sample dashboard (#2470)
1 parent ad8c7fa commit 295f931

6 files changed

Lines changed: 391 additions & 11 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ otlp_collector_endpoint = "http://otel-collector:4317"
121121
There is a docker-compose project that includes the OpenTelemetry configuration and tech stack that can be run in local environment for testing purposes:
122122

123123
```bash
124-
cd infra/opentelemetry
125-
docker-compose up
124+
docker-compose -f infra/opentelemetry/compose.yaml up -d
126125
```
127126

127+
After the services are running, a sample dashboard could be obtained from the (Grafana)[http://localhost:9010] local service.
128+
128129
## `rustfmt`
129130

130131
We use a couple of nightly-only rustfmt features. The easiest way to get these is:
Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
# docker-compsoe file for testing networking with static IPs
2-
version: "3"
31
services:
42
node0_with_otel:
5-
depends_on:
6-
- node3_with_otel
73
environment:
84
RUST_BACKTRACE: 1
95
RUST_LOG: zilliqa=info,opentelemetry=trace
6+
OTEL_RESOURCE_ATTRIBUTES: service.name=node0,deployment.environment=local
107
image: zq2-node0
118
build:
12-
context: .
13-
dockerfile: Dockerfile
9+
context: ${PWD}
10+
dockerfile: ${PWD}/Dockerfile
1411
container_name: zilliqanode0_with_otel
1512
volumes:
1613
- "./config_docker.toml:/config.toml"
@@ -24,12 +21,16 @@ services:
2421

2522
node1_with_otel:
2623
depends_on:
27-
- node3_with_otel
24+
- node0_with_otel
2825
environment:
2926
RUST_BACKTRACE: 1
3027
RUST_LOG: zilliqa=info,opentelemetry=trace
28+
OTEL_RESOURCE_ATTRIBUTES: service.name=node1,deployment.environment=local
3129
container_name: zilliqanode1_with_otel
3230
image: zq2-node0
31+
build:
32+
context: ${PWD}
33+
dockerfile: ${PWD}/Dockerfile
3334
volumes:
3435
- "./config_docker.toml:/config.toml"
3536
command:
@@ -40,12 +41,16 @@ services:
4041

4142
node2_with_otel:
4243
depends_on:
43-
- node3_with_otel
44+
- node0_with_otel
4445
environment:
4546
RUST_BACKTRACE: 1
4647
RUST_LOG: zilliqa=info,opentelemetry=trace
48+
OTEL_RESOURCE_ATTRIBUTES: service.name=node2,deployment.environment=local
4749
container_name: zilliqanode2_with_otel
4850
image: zq2-node0
51+
build:
52+
context: ${PWD}
53+
dockerfile: ${PWD}/Dockerfile
4954
volumes:
5055
- "./config_docker.toml:/config.toml"
5156
command:
@@ -55,11 +60,17 @@ services:
5560
ipv4_address: 198.53.100.102
5661

5762
node3_with_otel:
63+
depends_on:
64+
- node0_with_otel
5865
environment:
5966
RUST_BACKTRACE: 1
6067
RUST_LOG: zilliqa=info,opentelemetry=trace
68+
OTEL_RESOURCE_ATTRIBUTES: service.name=node3,deployment.environment=local
6169
container_name: zilliqanode3_with_otel
6270
image: zq2-node0
71+
build:
72+
context: ${PWD}
73+
dockerfile: ${PWD}/Dockerfile
6374
volumes:
6475
- "./config_docker.toml:/config.toml"
6576
command:
@@ -130,6 +141,10 @@ services:
130141
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
131142
ports:
132143
- "9010:3000"
144+
volumes:
145+
- ./grafana-datasources.yaml:/etc/grafana/provisioning/datasources/provisioning-datasources.yaml:ro
146+
- ./grafana-dashboards.yaml:/etc/grafana/provisioning/dashboards/provisioning-dashboards.yaml:ro
147+
- ./zq2-opentelemetry-dashboard.json:/var/lib/grafana/dashboards/zq2-opentelemetry-dashboard.json:ro
133148
networks:
134149
- localnet_with_otel
135150

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: 1
2+
3+
providers:
4+
- name: "dashboards"
5+
type: file
6+
updateIntervalSeconds: 60
7+
allowUiUpdates: false
8+
options:
9+
path: /var/lib/grafana/dashboards
10+
foldersFromFilesStructure: true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: 1
2+
3+
datasources:
4+
- name: Prometheus
5+
type: prometheus
6+
access: proxy
7+
url: http://mimir:9009/prometheus

infra/opentelemetry/otel-collector-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ exporters:
1010

1111
processors:
1212
batch:
13+
resourcedetection/docker:
14+
detectors: [env, docker]
15+
timeout: 2s
16+
override: true
1317

1418
service:
1519
pipelines:
1620
metrics:
1721
receivers: [otlp]
18-
processors: []
22+
processors: [resourcedetection/docker, batch]
1923
exporters: [prometheusremotewrite]

0 commit comments

Comments
 (0)