Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

📝 docs: added docs for deploying production level Grafana stack (#9072)

Neko9089e2683e84
diff --git a/docs/self-hosting/advanced/observability/grafana.mdx b/docs/self-hosting/advanced/observability/grafana.mdx
new file mode 100644
index 00000000000..06447e5b507
--- /dev/null
+++ b/docs/self-hosting/advanced/observability/grafana.mdx
@@ -0,0 +1,71 @@
+---
+title: Observability with Grafana, Prometheus, and Tempo
+description: >-
+ Monitor and analyze your LobeChat instance using Grafana dashboards, Prometheus metrics, and Tempo traces. This guide covers setup, configuration for self-hosted deployments.
+tags:
+ - Observability
+ - Grafana
+ - Prometheus
+ - Tempo
+---
+
+# Observability with [Grafana](https://grafana.com/), [Prometheus](https://prometheus.io/), and [Tempo](https://grafana.com/docs/tempo/latest/)
+
+LobeChat supports advanced observability for self-hosted deployments using open-source tools:
+
+- **Grafana** for dashboards and visualization
+- **Prometheus** for metrics collection
+- **Tempo** for distributed tracing
+- **otel-collector** ingesting other OpenTelemetry supported data
+
+We provided Docker Compose (`docker-compose`) file presets to bootstrap the observability stack with advanced self-hosting features.
+This guide will help you set up and use these tools to monitor your LobeChat instance.
+
+## Prerequisites
+
+- `docker` CLI
+- OrbStack (macOS), or Docker Desktop Windows
+- `docker-compose` plugin enabled (check through `docker compose version`)
+
+## 1. Deploy
+
+```bash
+curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/grafana/docker-compose.yml
+curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/grafana/.env.example
+mv .env.example .env
+```
+
+1. Update the password & secrets in the `.env` file as needed.
+2. Start the stack with the correct profile:
+
+ ```sh
+ docker compose up -d
+ ```
+
+ This will launch Grafana, Prometheus, Tempo, and the otel-collector alongside LobeChat with Casdoor, Minio, and other advanced services.
+
+## 2. Access Grafana Dashboards
+
+- Open Grafana in your browser at [http://localhost:3000](http://localhost:3000) (or your server's IP).
+- Default login (if required):
+ - **Username:** admin
+ - **Password:** (see your environment or Docker Compose file)
+
+## 3. Explore traces & metrics
+
+Click on "Explore" in the left sidebar to access the query editor to run ad-hoc queries against your Prometheus and Tempo data sources.
+
+## 4. Troubleshooting
+
+- Ensure all containers are running: `docker compose ps`
+- Check logs for any service: `docker compose logs <service-name>`
+- Verify Prometheus and Tempo are scraping and receiving data from LobeChat and otel-collector.
+
+## See Also
+
+- [Langfuse Observability](https://lobehub.com/docs/self-hosting/advanced/observability/langfuse)
+- [Self-Hosting Overview](https://lobehub.com/docs/self-hosting/start)
+
+---
+
+For questions or feedback, open an issue on GitHub or join our community discussions.
diff --git a/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx b/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx
new file mode 100644
index 00000000000..7ff0d705308
--- /dev/null
+++ b/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx
@@ -0,0 +1,70 @@
+---
+title: 使用 Grafana、Prometheus 和 Tempo 进行可观测性监控
+description: >-
+ 使用 Grafana、Prometheus 指标和 Tempo 链路追踪,监控和分析你的 LobeChat 实例。本指南涵盖自托管部署的搭建、配置和示例仪表盘。
+tags:
+ - 可观测性
+ - Grafana
+ - Prometheus
+ - Tempo
+---
+
+# 使用 [Grafana](https://grafana.com/)、[Prometheus](https://prometheus.io/) 和 [Tempo](https://grafana.com/docs/tempo/latest/) 进行可观测性监控
+
+LobeChat 支持通过开源工具实现自托管部署的高级可观测性:
+
+- **Grafana**:仪表盘与可视化
+- **Prometheus**:指标采集
+- **Tempo**:分布式链路追踪
+- **otel-collector**:采集 OpenTelemetry 支持的数据
+
+我们提供了 Docker Compose (`docker-compose`) 预设文件,帮助你一键启动包含高级可观测性功能的自托管栈。
+
+## 前置条件
+
+- 已安装 `docker` 命令行工具
+- OrbStack(macOS)或 Docker Desktop(Windows)
+- 启用 `docker-compose` 插件(可通过 `docker compose version` 检查)
+
+## 1. 部署
+
+```bash
+curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/grafana/docker-compose.yml
+curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/grafana/.env.example
+mv .env.example .env
+```
+
+1. 根据需要修改 `.env` 文件中的密码和密钥。
+2. 使用如下命令启动服务:
+
+ ```sh
+ docker compose up -d
+ ```
+
+ 这将会启动 Grafana、Prometheus、Tempo、otel-collector 以及 LobeChat、Casdoor、Minio 等高级服务。
+
+## 2. 访问 Grafana 仪表盘
+
+- 在浏览器中打开 [http://localhost:3000](http://localhost:3000)(或你的服务器 IP)。
+- 默认登录信息(如需):
+ - **用户名:** admin
+ - **密码:** 见你的环境变量或 Docker Compose 文件
+
+## 3. 探索链路追踪与指标
+
+点击左侧边栏的 “Explore” 进入查询编辑器,可对 Prometheus 和 Tempo 数据源进行即席查询。
+
+## 4. 故障排查
+
+- 确认所有容器已运行:`docker compose ps`
+- 查看服务日志:`docker compose logs <服务名>`
+- 检查 Prometheus 和 Tempo 是否正常采集 LobeChat 及 otel-collector 的数据。
+
+## 相关链接
+
+- [Langfuse 可观测性](https://lobehub.com/zh/docs/self-hosting/advanced/observability/langfuse)
+- [自托管总览](https://lobehub.com/zh/docs/self-hosting/start)
+
+---
+
+如有问题或建议,欢迎在 GitHub 提 Issue 或加入社区讨论。