Skip to content

Commit

Permalink
Add metric.py, prometheus configs, and modify pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonsyh committed Oct 18, 2024
1 parent 7d0ed1e commit 9bf5ce9
Show file tree
Hide file tree
Showing 4 changed files with 471 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docker/prometheus/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.7'
services:
prometheus:
image: prom/prometheus
volumes:
- ".prometheus.yml:/etc/prometheus/prometheus.yml"
networks:
- localprom
ports:
- 9090:9090
node-exporter:
image: prom/node-exporter
networks:
- localprom
ports:
- 9100:9100
pushgateway:
image: prom/pushgateway
networks:
- localprom
ports:
- 9091:9091
networks:
localprom:
driver: bridge

14 changes: 14 additions & 0 deletions docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
global:
scrape_interval: 15s

scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'pushgateway'
static_configs:
- targets: ['zeus-pushgateway-1:9091']
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ migration = ["alembic", "sqlalchemy", "pydantic<2", "python-dotenv"]
lint = ["ruff", "black==22.6.0", "pyright", "pandas-stubs", "transformers"]
test = ["fastapi[all]", "sqlalchemy", "pydantic<2", "pytest==7.3.2", "pytest-mock==3.10.0", "pytest-xdist==3.3.1", "anyio==3.7.1", "aiosqlite==0.20.0", "numpy<2"]
docs = ["mkdocs-material[imaging]==9.5.19", "mkdocstrings[python]==0.25.0", "mkdocs-gen-files==0.5.0", "mkdocs-literate-nav==0.6.1", "mkdocs-section-index==0.3.9", "mkdocs-redirects==1.2.1", "urllib3<2", "black"]
prometheus = ["prometheus-client"]
# greenlet is for supporting apple mac silicon for sqlalchemy(https://docs.sqlalchemy.org/en/20/faq/installation.html)
dev = ["zeus-ml[pfo-server,bso,bso-server,migration,lint,test]", "greenlet"]
dev = ["zeus-ml[pfo-server,bso,bso-server,migration,prometheus,lint,test]", "greenlet"]

[tool.setuptools.packages.find]
where = ["."]
Expand Down
Loading

0 comments on commit 9bf5ce9

Please sign in to comment.