Skip to content

Commit

Permalink
Create constants.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Sep 7, 2024
1 parent 3488cdf commit fe2403f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions utils/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
Constants used throughout the application
"""

# HTTP status codes
HTTP_OK = 200
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_FORBIDDEN = 403
HTTP_NOT_FOUND = 404
HTTP_INTERNAL_SERVER_ERROR = 500

# Prometheus constants
PROMETHEUS_DEFAULT_PORT = 9090
PROMETHEUS_DEFAULT_SCRAPE_INTERVAL = 10 # seconds

# Grafana constants
GRAFANA_DEFAULT_PORT = 3000
GRAFANA_DEFAULT_DASHBOARD_WIDTH = 12
GRAFANA_DEFAULT_DASHBOARD_HEIGHT = 6

# Logging constants
LOG_LEVEL_DEBUG = 'DEBUG'
LOG_LEVEL_INFO = 'INFO'
LOG_LEVEL_WARNING = 'WARNING'
LOG_LEVEL_ERROR = 'ERROR'
LOG_LEVEL_CRITICAL = 'CRITICAL'

# Other constants
DEFAULT_TIMEOUT = 30 # seconds
MAX_RETRIES = 3

0 comments on commit fe2403f

Please sign in to comment.