-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add prometheus and grafana support (#523)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Add Prometheus and Grafana support with FastAPI metrics and Docker Compose configurations. > > - **Metrics Integration**: > - Add `prometheus-fastapi-instrumentator` to `web.py` for FastAPI metrics. > - Update `pyproject.toml` to include `prometheus-fastapi-instrumentator` dependency. > - **Docker Compose**: > - Add `prometheus/docker-compose.yml` for Prometheus configuration. > - Add `grafana/docker-compose.yml` for Grafana configuration. > - Update root `docker-compose.yml` to include Prometheus and Grafana services. > - **Traefik Configuration**: > - Update `traefik.yml.template` to route `/grafana` to Grafana service. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=julep-ai%2Fjulep&utm_source=github&utm_medium=referral)<sup> for 124ecc7. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN --> --------- Co-authored-by: Diwank Singh Tomer <[email protected]>
- Loading branch information
1 parent
1f340e7
commit 5ba7f44
Showing
8 changed files
with
880 additions
and
637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: grafana | ||
|
||
services: | ||
grafana: | ||
image: grafana/grafana | ||
environment: | ||
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD} | ||
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER} | ||
container_name: grafana | ||
ports: | ||
- 3000:3000 | ||
volumes: | ||
- grafana_data:/var/lib/grafana | ||
- ./provisioning:/etc/grafana/provisioning | ||
profiles: | ||
- multi-tenant | ||
|
||
volumes: | ||
grafana_data: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
datasources: | ||
- access: 'proxy' | ||
editable: true | ||
is_default: true | ||
name: 'agents-api' | ||
org_id: 1 | ||
type: 'prometheus' | ||
url: 'http://prometheus:9090' | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
global: | ||
scrape_interval: 15s | ||
scrape_timeout: 10s | ||
evaluation_interval: 15s | ||
alerting: | ||
alertmanagers: | ||
- follow_redirects: true | ||
enable_http2: true | ||
scheme: http | ||
timeout: 10s | ||
api_version: v2 | ||
static_configs: | ||
- targets: [] | ||
scrape_configs: | ||
- job_name: agents-api | ||
honor_timestamps: true | ||
scrape_interval: 15s | ||
scrape_timeout: 10s | ||
metrics_path: /metrics | ||
scheme: http | ||
follow_redirects: true | ||
static_configs: | ||
- targets: | ||
- agents-api-multi-tenant:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: prometheus | ||
|
||
services: | ||
prometheus: | ||
image: prom/prometheus | ||
container_name: prometheus | ||
profiles: | ||
- multi-tenant | ||
|
||
volumes: | ||
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml | ||
- prometheus_data:/prometheus | ||
|
||
depends_on: | ||
agents-api-multi-tenant: | ||
condition: service_started | ||
|
||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
|
||
volumes: | ||
prometheus_data: | ||
external: true |