This example is intended as a “360°” Graphium demo:
- A real HTTP API (Axum + Postgres)
- Graphium graphs powering request handlers
- OpenTelemetry telemetry (metrics, logs, traces)
- Graphium UI dashboard to visualize graphs and inspect telemetry
- API server:
graphium-examples --bin ecommerce(default127.0.0.1:3000) - Admin/UI server:
graphium-examples --bin ecommerce_ui(default127.0.0.1:4000) - Telemetry stack via docker compose:
- Prometheus (metrics query) on
127.0.0.1:9090 - Loki (logs query) on
127.0.0.1:3100 - Tempo (traces query) on
127.0.0.1:3200 - Grafana (optional UI) on
127.0.0.1:3002(admin/admin)
- Prometheus (metrics query) on
From the repo root:
docker compose -f .docker/ecommerce/docker-compose.yml up -d --buildOpen:
- API:
http://127.0.0.1:3000 - Graphium UI:
http://127.0.0.1:4000/dashboard - Grafana:
http://127.0.0.1:3002
curl -sS -X POST http://127.0.0.1:3000/product/create \
-F 'name=Banana' \
-F 'price=1.23'Price parsing:
- Accepts integer cents (
"123") - Accepts decimal strings (
"1.23"or"1,23")
curl -sS 'http://127.0.0.1:3000/product?limit=50&offset=0'curl -sS 'http://127.0.0.1:3000/product/1'curl -sS -X PUT 'http://127.0.0.1:3000/product/1' \
-H 'content-type: application/json' \
-d '{"name":"New name","price":999}'curl -sS -X DELETE 'http://127.0.0.1:3000/product/1'After making a few API calls:
- Open
http://127.0.0.1:4000/dashboard - Select
CreateProductGraph(or another graph) - You should see:
- Prometheus metrics cards (count/success, p50/p95 after some traffic)
- Loki logs
- Tempo traces, with links to the trace API
The UI filters logs and traces by OpenTelemetry service name. In the docker setup:
- The API service exports with
GRAPHIUM_SERVICE_NAME=ecommerce-prod - The UI uses
GRAPHIUM_SERVICE_NAME=ecommerce-prodto query Loki/Tempo
If you run things manually, make sure these match (or your logs/traces won’t show up).