Add sentry to magnum
Change-Id: I8555fd7a98bf77b73c89d5ca01ee80cd19f78ce6
This commit is contained in:
parent
e8559e01c4
commit
c7e64a04ae
@ -16,6 +16,7 @@
|
|||||||
FROM vexxhost/python-builder AS builder
|
FROM vexxhost/python-builder AS builder
|
||||||
|
|
||||||
FROM vexxhost/python-base AS magnum-api
|
FROM vexxhost/python-base AS magnum-api
|
||||||
|
COPY magnum-api-wsgi /usr/local/bin/magnum-api-wsgi
|
||||||
EXPOSE 9511
|
EXPOSE 9511
|
||||||
ENV UWSGI_HTTP_SOCKET=:9511 UWSGI_WSGI_FILE=/usr/local/bin/magnum-api-wsgi
|
ENV UWSGI_HTTP_SOCKET=:9511 UWSGI_WSGI_FILE=/usr/local/bin/magnum-api-wsgi
|
||||||
CMD ["/usr/local/bin/uwsgi","--ini","/etc/uwsgi/uwsgi.ini"]
|
CMD ["/usr/local/bin/uwsgi","--ini","/etc/uwsgi/uwsgi.ini"]
|
||||||
|
33
images/magnum/magnum-api-wsgi
Executable file
33
images/magnum/magnum-api-wsgi
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/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.
|
||||||
|
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
|
import sentry_sdk
|
||||||
|
|
||||||
|
from magnum.api.app import build_wsgi_app
|
||||||
|
from sentry_sdk.integrations import wsgi
|
||||||
|
|
||||||
|
|
||||||
|
VERSION = pkg_resources.get_distribution("magnum").version
|
||||||
|
|
||||||
|
sentry_sdk.init(
|
||||||
|
release="magnum@%s" % VERSION,
|
||||||
|
traces_sample_rate=0.1
|
||||||
|
)
|
||||||
|
|
||||||
|
application = build_wsgi_app()
|
||||||
|
application = wsgi.SentryWsgiMiddleware(application)
|
@ -1,4 +1,5 @@
|
|||||||
uWSGI
|
uWSGI
|
||||||
python-memcached
|
python-memcached
|
||||||
PyMySQL
|
PyMySQL
|
||||||
|
sentry-sdk
|
||||||
git+https://opendev.org/openstack/magnum@stable/ussuri
|
git+https://opendev.org/openstack/magnum@stable/ussuri
|
@ -54,6 +54,10 @@ spec:
|
|||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
{% if env is defined and env|length %}
|
{% if env is defined and env|length %}
|
||||||
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