Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observability tools #1563

Merged
merged 10 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
68 changes: 68 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,71 @@ services:
deploy:
replicas: 1
profiles: ["inference"]

prometheus:
image: prom/prometheus
container_name: prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
ports:
- 9090:9090
restart: unless-stopped
volumes:
- ${PWD}/docker/prometheus:/etc/prometheus
- prom_data:/prometheus
profiles: ["observability"]

grafana:
image: grafana/grafana
container_name: grafana
ports:
- 2000:2000
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
- GF_SERVER_HTTP_PORT=2000
volumes:
- ${PWD}/docker/grafana/datasources:/etc/grafana/provisioning/datasources
- ${PWD}/docker/grafana/dashboards/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml
- ${PWD}/docker/grafana/dashboards:/var/lib/grafana/dashboards
profiles: ["observability"]

netdata:
image: netdata/netdata
container_name: netdata
pid: host
hostname: oasst-netdata
ports:
- 19999:19999
restart: unless-stopped
cap_add:
- SYS_PTRACE
- SYS_ADMIN
security_opt:
- apparmor:unconfined
volumes:
- netdataconfig:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/docker/netdata/go.d/redis.conf:/etc/netdata/go.d/redis.conf
- ${PWD}/docker/netdata/go.d/postgres.conf:/etc/netdata/go.d/postgres.conf
- ${PWD}/docker/netdata/go.d/prometheus.conf:/etc/netdata/go.d/prometheus.conf
environment:
# useful if want to claim monitoring agents into https://www.netdata.cloud/
# else ignore or leave blank to just use local netdata dashboards as localhost:19999
- NETDATA_CLAIM_TOKEN=${NETDATA_CLAIM_TOKEN:-}
- NETDATA_CLAIM_URL=https://app.netdata.cloud
profiles: ["observability"]

volumes:
prom_data:
netdataconfig:
netdatalib:
netdatacache:
14 changes: 14 additions & 0 deletions docker/grafana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Grafana

[Grafana](https://github.com/grafana/grafana) is used to visualize custom
observabiltiy metrics and much more.

This folder contains various configuration files for Grafana.

- [`./dashboards/dashboard.yaml`](./dashboards/dashboard.yaml) - Used to tell
Grafana where some pre-configured dashboards live.
- [`./dashboards/fastapi-backend.json`](./dashboards/fastapi-backend.json) - A
json representation of a saved Grafana dashboard focusing on some high level
api endpoint metrics etc.
- [`./datasources/datasource.yml`](./datasources/datasource.yml) - A config file
to set up Grafana to read from the local Prometheus source.
12 changes: 12 additions & 0 deletions docker/grafana/dashboards/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: 1

providers:
- name: "Dashboard provider"
orgId: 1
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true