https://github.com/euiyounghwang/db-interface-export
Python DB Interface with Prometheus-Export
https://github.com/euiyounghwang/db-interface-export
fastapi oracle prometheus-exporter
Last synced: 7 months ago
JSON representation
Python DB Interface with Prometheus-Export
- Host: GitHub
- URL: https://github.com/euiyounghwang/db-interface-export
- Owner: euiyounghwang
- Created: 2024-05-24T14:06:37.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-30T20:38:01.000Z (10 months ago)
- Last Synced: 2025-01-17T19:55:23.965Z (9 months ago)
- Topics: fastapi, oracle, prometheus-exporter
- Language: Python
- Homepage:
- Size: 3.56 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DB-Interface-Export
Python DB Interface with Prometheus-ExportFastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python.
This is a repository that provides to deliver the records to the Prometheus-Export application.### Install Poerty
```
https://python-poetry.org/docs/?ref=dylancastillo.co#installing-with-the-official-installer
```### Using Python Virtual Environment
```bash
python -m venv .venv
source .venv/bin/activate
```### Using Poetry: Create the virtual environment in the same directory as the project and install the dependencies:
```bash
poetry config virtualenvs.in-project true
poetry init
poetry add fastapi
poetry add uvicorn
poetry add pytz
poetry add httpx
poetry add pytest
poetry add pytest-cov
poetry add requests
poetry add python-dotenv
poetry add JPype1
poetry add psycopg2-binary
poetry add jaydebeapi
```
or you can run this shell script `./create_virtual_env.sh` to make an environment. then go to virtual enviroment using `source .venv/bin/activate`### Register Service
- sudo service db_es_api status/stop/start/restart
```bash
#-- /etc/systemd/system/db_es_api.service
[Unit]
Description=DB ES Service[Service]
User=devuser
Group=devuser
Type=simple
ExecStart=/bin/bash /home/devuser/db_interface_api/service-start.sh
ExecStop= /usr/bin/killall db_es_service[Install]
WantedBy=default.target# Service command
sudo systemctl daemon-reload
sudo systemctl enable db_es_api.service
sudo systemctl start db_es_api.service
sudo systemctl status db_es_api.service
sudo systemctl stop db_es_api.servicesudo service db_es_api status/stop/start
```### Service
- Run this command `./start-start.sh` or python -m uvicorn main:app --reload --host=0.0.0.0 --port=8002 --workers 4
- Service : http://localhost:8002/docs