mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
Add sentry rq integration
This commit is contained in:
parent
b9bd1d4e14
commit
c80b240497
3 changed files with 14 additions and 2 deletions
|
@ -15,6 +15,7 @@ from sqlalchemy.orm import sessionmaker
|
|||
from flask import Flask, render_template, request, redirect, session, abort, url_for
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
from sentry_sdk.integrations.rq import RqIntegration
|
||||
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
||||
from proxstar.db import (Base, datetime, get_pool_cache, renew_vm_expire, set_user_usage_limits, get_template,
|
||||
get_templates, get_allowed_users, add_ignored_pool, delete_ignored_pool, add_allowed_user,
|
||||
|
@ -42,11 +43,13 @@ else:
|
|||
app.config.from_pyfile(config)
|
||||
app.config['GIT_REVISION'] = subprocess.check_output(
|
||||
['git', 'rev-parse', '--short', 'HEAD']).decode('utf-8').rstrip()
|
||||
|
||||
# Sentry setup
|
||||
sentry_sdk.init(
|
||||
dsn=app.config['SENTRY_DSN'],
|
||||
integrations=[FlaskIntegration(), SqlalchemyIntegration()]
|
||||
integrations=[FlaskIntegration(), RqIntegration(), SqlalchemyIntegration()]
|
||||
)
|
||||
|
||||
with open('proxmox_ssh_key', 'w') as ssh_key_file:
|
||||
ssh_key_file.write(app.config['PROXMOX_SSH_KEY'])
|
||||
|
||||
|
|
9
rqsettings.py
Normal file
9
rqsettings.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import os
|
||||
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.rq import RqIntegration
|
||||
|
||||
sentry_sdk.init(
|
||||
os.environ.get('PROXSTAR_SENTRY_DSN'),
|
||||
integrations=[RqIntegration()]
|
||||
)
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
/opt/app-root/bin/rq worker -u "$PROXSTAR_REDIS_URL" --sentry-dsn "$PROXSTAR_SENTRY_DSN"
|
||||
/opt/app-root/bin/rq worker -u "$PROXSTAR_REDIS_URL" --sentry-dsn "" -c rqsettings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue