Skip to content

Commit

Permalink
Add ddog logger.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Jun 18, 2024
1 parent 187e481 commit 6692577
Show file tree
Hide file tree
Showing 8 changed files with 437 additions and 55 deletions.
5 changes: 4 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ class Config:
"""Global configuration variables."""

# General Config
FLASK_APP = environ.get("FLASK_APP")
APP_NAME = "pythonmyadmin"
ENVIRONMENT = environ.get("ENVIRONMENT")

# Flask Config
FLASK_APP = environ.get("FLASK_APP")
SECRET_KEY = environ.get("SECRET_KEY")
FLASK_DEBUG = environ.get("FLASK_DEBUG")

Expand Down
9 changes: 5 additions & 4 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
reload = True
workers = 1
threads = 1
bind = ["127.0.0.1:3307"]
bind = ["127.0.0.1:8000"]
elif ENVIRONMENT == "production":
access_log_format = "%(h)s %(l)s %(u)s %(t)s %(r)s %(s)s %(b)s %(f)s %(a)s"
daemon = True
accesslog = "/var/log/pythonmyadmin/access.log"
errorlog = "/var/log/pythonmyadmin/error.log"
accesslog = "/var/log/pythonmyadmin/access.json"
errorlog = "/var/log/pythonmyadmin/error.json"
loglevel = "trace"
dogstatsd_tags = "env:prod,service:pythonmyadmin,language:python"
dogstatsd_tags = "env:production,service:pythonmyadmin,language:python"
else:
raise ValueError(f"Unknown environment provided: `{ENVIRONMENT}`. Must be `development` or `production`.")
449 changes: 404 additions & 45 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ flake8 = "*"
cryptography = "*"
gunicorn = "*"
poetry-plugin-export = "*"
ddtrace = "^2.9.1"
loguru = "^0.7.2"

[tool.poetry.scripts]
run = "main:app"
Expand Down
2 changes: 1 addition & 1 deletion pythonmyadmin/static/dist/css/style.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pythonmyadmin/static/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ html {
padding: 0;
background: @background-color !important;
font-family: @body-font;
max-width: 100%;
overflow: hidden;
@media(max-width: @mobile-breakpoint) {
margin: 0;
}
Expand Down
4 changes: 3 additions & 1 deletion pythonmyadmin/static/less/nav.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
header {
position: relative;
width: 100%;
margin-bottom: 50px;
margin-bottom: 2vw;
padding: 40px 0 !important;
background: white !important;
box-shadow: 0 0 5px #bec6cf;
font-family: 'Lato', sans-serif;
max-width: 100%;
overflow: hidden;
@media(max-width: 800px) {
margin: 0 auto;
box-shadow: 0 0 2px #707985;
Expand Down
19 changes: 16 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
async-timeout==4.0.3 ; python_version >= "3.10" and python_full_version < "3.11.3"
attrs==23.2.0 ; python_version >= "3.10" and python_version < "4.0"
black==23.12.1 ; python_version >= "3.10" and python_version < "4.0"
blinker==1.8.2 ; python_version >= "3.10" and python_version < "4.0"
build==1.2.1 ; python_version >= "3.10" and python_version < "4.0"
bytecode==0.15.1 ; python_version >= "3.10" and python_version < "4.0"
cachecontrol[filecache]==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
cattrs==23.2.3 ; python_version >= "3.10" and python_version < "4.0"
certifi==2024.6.2 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.16.0 ; python_version >= "3.10" and python_version < "4.0" and (platform_python_implementation != "PyPy" or sys_platform == "darwin")
charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -17,8 +20,12 @@ dash-html-components==2.0.0 ; python_version >= "3.10" and python_version < "4.0
dash-renderer==1.9.1 ; python_version >= "3.10" and python_version < "4.0"
dash-table==5.0.0 ; python_version >= "3.10" and python_version < "4.0"
dash==2.17.1 ; python_version >= "3.10" and python_version < "4.0"
ddsketch==3.0.1 ; python_version >= "3.10" and python_version < "4.0"
ddtrace==2.9.1 ; python_version >= "3.10" and python_version < "4.0"
deprecated==1.2.14 ; python_version >= "3.10" and python_version < "4.0"
distlib==0.3.8 ; python_version >= "3.10" and python_version < "4.0"
dulwich==0.21.7 ; python_version >= "3.10" and python_version < "4.0"
envier==0.5.1 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.1 ; python_version >= "3.10" and python_version < "3.11"
fastjsonschema==2.20.0 ; python_version >= "3.10" and python_version < "4.0"
filelock==3.15.1 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -40,13 +47,15 @@ jinja2==3.1.4 ; python_version >= "3.10" and python_version < "4.0"
jsmin==3.0.1 ; python_version >= "3.10" and python_version < "4.0"
keyring==24.3.1 ; python_version >= "3.10" and python_version < "4.0"
lesscpy==0.15.1 ; python_version >= "3.10" and python_version < "4.0"
loguru==0.7.2 ; python_version >= "3.10" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.10" and python_version < "4.0"
mccabe==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
more-itertools==10.3.0 ; python_version >= "3.10" and python_version < "4.0"
msgpack==1.0.8 ; python_version >= "3.10" and python_version < "4.0"
mypy-extensions==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
nest-asyncio==1.6.0 ; python_version >= "3.10" and python_version < "4.0"
numpy==1.26.4 ; python_version >= "3.10" and python_version <= "3.11" or python_version >= "3.12" and python_version < "4.0"
numpy==2.0.0 ; python_version >= "3.10" and python_version <= "3.11" or python_version >= "3.12" and python_version < "4.0"
opentelemetry-api==1.25.0 ; python_version >= "3.10" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.10" and python_version < "4.0"
pandas==2.2.2 ; python_version >= "3.10" and python_version < "4.0"
pathspec==0.12.1 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -59,6 +68,7 @@ ply==3.11 ; python_version >= "3.10" and python_version < "4.0"
poetry-core==1.9.0 ; python_version >= "3.10" and python_version < "4.0"
poetry-plugin-export==1.8.0 ; python_version >= "3.10" and python_version < "4.0"
poetry==1.8.3 ; python_version >= "3.10" and python_version < "4.0"
protobuf==5.27.1 ; python_version >= "3.10" and python_version < "4.0"
ptyprocess==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
pycodestyle==2.12.0 ; python_version >= "3.10" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.10" and python_version < "4.0" and (platform_python_implementation != "PyPy" or sys_platform == "darwin")
Expand All @@ -80,16 +90,19 @@ setuptools==70.0.0 ; python_version >= "3.10" and python_version < "4.0"
shellingham==1.5.4 ; python_version >= "3.10" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy==2.0.30 ; python_version >= "3.10" and python_version < "4.0"
tenacity==8.3.0 ; python_version >= "3.10" and python_version < "4.0"
tenacity==8.4.1 ; python_version >= "3.10" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.10" and python_version < "3.11"
tomlkit==0.12.5 ; python_version >= "3.10" and python_version < "4.0"
trove-classifiers==2024.5.22 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "4.0"
tzdata==2024.1 ; python_version >= "3.10" and python_version < "4.0"
urllib3==2.2.1 ; python_version >= "3.10" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.10" and python_version < "4.0"
virtualenv==20.26.2 ; python_version >= "3.10" and python_version < "4.0"
webassets==2.0 ; python_version >= "3.10" and python_version < "4.0"
werkzeug==3.0.3 ; python_version >= "3.10" and python_version < "4.0"
win32-setctime==1.1.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
wrapt==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
wtforms==3.1.2 ; python_version >= "3.10" and python_version < "4.0"
xattr==1.1.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "darwin"
xmltodict==0.13.0 ; python_version >= "3.10" and python_version < "4.0"
zipp==3.19.2 ; python_version >= "3.10" and python_version < "4.0"

0 comments on commit 6692577

Please sign in to comment.