Add sentry to horizon
Change-Id: I90036238a8a30ebcd068ececb8a5fc662eb9965f
This commit is contained in:
parent
e8559e01c4
commit
0e16e9d019
@ -30,6 +30,7 @@ RUN python manage.py compilemessages && \
|
|||||||
chown 1001 -R local/ ../static
|
chown 1001 -R local/ ../static
|
||||||
COPY *.svg ../static/dashboard/img/
|
COPY *.svg ../static/dashboard/img/
|
||||||
COPY *.ico ../static/dashboard/img/
|
COPY *.ico ../static/dashboard/img/
|
||||||
|
COPY wsgi.py /usr/local/lib/python3.7/site-packages/openstack_dashboard/wsgi.py
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
ENV UWSGI_HTTP_SOCKET=:8000 \
|
ENV UWSGI_HTTP_SOCKET=:8000 \
|
||||||
UWSGI_WSGI_FILE=/usr/local/lib/python3.7/site-packages/openstack_dashboard/wsgi.py \
|
UWSGI_WSGI_FILE=/usr/local/lib/python3.7/site-packages/openstack_dashboard/wsgi.py \
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
uWSGI
|
uWSGI
|
||||||
python-memcached
|
python-memcached
|
||||||
|
sentry-sdk
|
||||||
git+https://opendev.org/openstack/horizon@stable/ussuri
|
git+https://opendev.org/openstack/horizon@stable/ussuri
|
||||||
git+https://opendev.org/openstack/heat-dashboard@stable/ussuri
|
git+https://opendev.org/openstack/heat-dashboard@stable/ussuri
|
||||||
git+https://opendev.org/openstack/designate-dashboard@stable/ussuri
|
git+https://opendev.org/openstack/designate-dashboard@stable/ussuri
|
||||||
|
44
images/horizon/wsgi.py
Normal file
44
images/horizon/wsgi.py
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/local/bin/python
|
||||||
|
# Copyright (c) 2020 VEXXHOST, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
# implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
"""
|
||||||
|
WSGI config for openstack_dashboard project.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import pkg_resources
|
||||||
|
import sentry_sdk
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
from sentry_sdk.integrations import wsgi
|
||||||
|
|
||||||
|
VERSION = pkg_resources.get_distribution("horizon").version
|
||||||
|
|
||||||
|
sentry_sdk.init(
|
||||||
|
release="horizon@%s" % VERSION,
|
||||||
|
traces_sample_rate=0.1
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add this file path to sys.path in order to import settings
|
||||||
|
sys.path.insert(0, os.path.normpath(os.path.join(
|
||||||
|
os.path.dirname(os.path.realpath(__file__)), '..')))
|
||||||
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
|
||||||
|
sys.stdout = sys.stderr
|
||||||
|
|
||||||
|
application = get_wsgi_application()
|
||||||
|
application = wsgi.SentryWsgiMiddleware(application)
|
@ -41,6 +41,10 @@ spec:
|
|||||||
image: vexxhost/horizon:latest
|
image: vexxhost/horizon:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
env:
|
env:
|
||||||
|
{% if 'sentryDSN' in spec %}
|
||||||
|
- name: SENTRY_DSN
|
||||||
|
value: {{ spec.sentryDSN }}
|
||||||
|
{% endif %}
|
||||||
{% for v in env %}
|
{% for v in env %}
|
||||||
- name: "{{ v.name }}"
|
- name: "{{ v.name }}"
|
||||||
value: "{{ v.value }}"
|
value: "{{ v.value }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user