Karan6124 commited on
Commit
06bb036
Β·
1 Parent(s): 7a3fa9f

docs: update observability section to reflect shift from local Grafana to Grafana Cloud

Browse files
Files changed (1) hide show
  1. README.md +19 -22
README.md CHANGED
@@ -75,7 +75,7 @@ Verifier Agent (hallucination and context drift scoring)
75
  |
76
  Prometheus Metrics Exporter (/metrics/ endpoint)
77
  |
78
- Local Grafana (scraping production HF Space over HTTPS)
79
  ```
80
 
81
  ---
@@ -192,9 +192,9 @@ The following custom metrics are tracked:
192
  | `agent_latency_seconds` | Histogram | End-to-end latency per agent type |
193
  | `agent_runs_total` | Counter | Total agent invocations by type and outcome |
194
 
195
- ### Grafana
196
 
197
- A local Grafana instance connects to the production backend over HTTPS. The Prometheus scrape target in `prometheus.yml` is configured as:
198
 
199
  ```yaml
200
  scrape_configs:
@@ -205,7 +205,9 @@ scrape_configs:
205
  - targets: ["karan6124-agentbond-api.hf.space"]
206
  ```
207
 
208
- Dashboards available in the `AgentBond Analytics` folder at `http://localhost:3000`:
 
 
209
 
210
  - **LLM Token Consumption Rate** β€” input and output token throughput over time (tokens/second)
211
  - **Average Agent Latency** β€” rolling average latency per agent type in seconds
@@ -285,7 +287,7 @@ AgentBond-AI/
285
  | OAuth Library | Authlib (Starlette integration) |
286
  | Authentication | JWT (python-jose) + bcrypt |
287
  | Metrics | Prometheus Client (multi-process mode) |
288
- | Dashboards | Grafana |
289
  | Container Runtime | Docker |
290
  | Process Manager | Supervisord |
291
  | Backend Hosting | Hugging Face Spaces (Docker SDK) |
@@ -434,29 +436,20 @@ The API will be available at `http://localhost:8000`. Interactive API documentat
434
 
435
  The frontend will be available at `http://localhost:5173`.
436
 
437
- ### Observability (Local)
438
 
439
- Once Docker Desktop is running and the backend is serving traffic:
440
 
441
- - **Prometheus:** `http://localhost:9090` β€” scrapes metrics from `host.docker.internal:8000`
442
- - **Grafana:** `http://localhost:3000` β€” default credentials are `admin / admin`
443
 
444
- To view production metrics from the live Hugging Face Space, update `prometheus.yml` to use the production target:
445
 
446
- ```yaml
447
- scrape_configs:
448
- - job_name: "agent-engine-api"
449
- metrics_path: "/metrics/"
450
- scheme: "https"
451
- static_configs:
452
- - targets: ["karan6124-agentbond-api.hf.space"]
453
- ```
454
 
455
- Then restart the Prometheus container:
456
 
457
- ```bash
458
- docker compose restart prometheus
459
- ```
460
 
461
  ---
462
 
@@ -506,6 +499,10 @@ Hugging Face Spaces provides free persistent Docker container hosting with a pub
506
 
507
  A local Redis container cannot run alongside the application on Hugging Face Spaces without significantly increasing container complexity. Upstash provides a managed, serverless Redis instance with TLS support (`rediss://`) and a free tier sufficient for the throughput of this application. The connection is shared between the FastAPI process and the Celery worker without any additional configuration.
508
 
 
 
 
 
509
  ---
510
 
511
  ## License
 
75
  |
76
  Prometheus Metrics Exporter (/metrics/ endpoint)
77
  |
78
+ Grafana Cloud (remote scraping of production HF Space over HTTPS)
79
  ```
80
 
81
  ---
 
192
  | `agent_latency_seconds` | Histogram | End-to-end latency per agent type |
193
  | `agent_runs_total` | Counter | Total agent invocations by type and outcome |
194
 
195
+ ### Grafana Cloud
196
 
197
+ Metrics are visualised on **Grafana Cloud** β€” a fully managed, hosted Grafana instance. A Grafana Cloud-managed Prometheus scrape job pulls directly from the production backend over HTTPS using a configured scrape target:
198
 
199
  ```yaml
200
  scrape_configs:
 
205
  - targets: ["karan6124-agentbond-api.hf.space"]
206
  ```
207
 
208
+ This scrape job is configured inside the Grafana Cloud UI under **Connections β†’ Add new connection β†’ Prometheus**. No local Prometheus or Grafana process is required.
209
+
210
+ Dashboards are published inside the **AgentBond Analytics** folder on Grafana Cloud:
211
 
212
  - **LLM Token Consumption Rate** β€” input and output token throughput over time (tokens/second)
213
  - **Average Agent Latency** β€” rolling average latency per agent type in seconds
 
287
  | OAuth Library | Authlib (Starlette integration) |
288
  | Authentication | JWT (python-jose) + bcrypt |
289
  | Metrics | Prometheus Client (multi-process mode) |
290
+ | Dashboards | Grafana Cloud (hosted) |
291
  | Container Runtime | Docker |
292
  | Process Manager | Supervisord |
293
  | Backend Hosting | Hugging Face Spaces (Docker SDK) |
 
436
 
437
  The frontend will be available at `http://localhost:5173`.
438
 
439
+ ### Observability (Production β€” Grafana Cloud)
440
 
441
+ Production metrics are visualised on Grafana Cloud. The hosted Grafana Cloud Prometheus agent is configured to scrape the live Hugging Face Space directly:
442
 
443
+ - **Grafana Cloud Dashboard:** [grafana.com/orgs/your-org](https://grafana.com) β€” log in to view the **AgentBond Analytics** folder.
444
+ - No local Prometheus or Grafana process is needed to view production metrics.
445
 
446
+ ### Observability (Local)
447
 
448
+ For local development, Docker Desktop spins up a lightweight Prometheus sidecar that scrapes the local backend:
 
 
 
 
 
 
 
449
 
450
+ - **Prometheus:** `http://localhost:9090` β€” scrapes metrics from `host.docker.internal:8000`
451
 
452
+ To view local metrics in Grafana Cloud, you can temporarily point your Grafana Cloud scrape configuration at your local backend (requires a public tunnel such as `ngrok`) or use the Grafana Agent in push mode.
 
 
453
 
454
  ---
455
 
 
499
 
500
  A local Redis container cannot run alongside the application on Hugging Face Spaces without significantly increasing container complexity. Upstash provides a managed, serverless Redis instance with TLS support (`rediss://`) and a free tier sufficient for the throughput of this application. The connection is shared between the FastAPI process and the Celery worker without any additional configuration.
501
 
502
+ **Why Grafana Cloud instead of a local Grafana instance?**
503
+
504
+ The production backend runs on Hugging Face Spaces, which is a remote host. A local Grafana instance can scrape the production `/metrics/` endpoint over HTTPS, but this approach requires keeping a local machine permanently on and connected to the internet. Grafana Cloud eliminates this dependency entirely: the hosted scrape agent runs 24/7 from Grafana's infrastructure and persists metric history across sessions. Dashboards are accessible from any browser without needing a local Docker environment, which is the appropriate setup for a production observability stack.
505
+
506
  ---
507
 
508
  ## License