8000 GITC-105: Sentry update by octavioamu · Pull Request #9224 · gitcoinco/web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

GITC-105: Sentry update #9224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def callback(request):
SENTRY_DSN = env.str('SENTRY_DSN', default='')
SENTRY_JS_DSN = env.str('SENTRY_JS_DSN', default=SENTRY_DSN)
RELEASE = raven.fetch_git_sha(os.path.abspath(os.pardir)) if ENV == 'prod' else ''
RAVEN_JS_VERSION = env.str('RAVEN_JS_VERSION', default='3.26.4')
RAVEN_JS_VERSION = env.str('RAVEN_JS_VERSION', default='6.8.0')
if SENTRY_DSN:
sentry_sdk.init(
SENTRY_DSN,
Expand Down
32 changes: 21 additions & 11 deletions app/app/templates/shared/sentry.html
10000
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}
{% if raven_js_dsn %}
<script src="https://cdn.ravenjs.com/{{ raven_js_version|default_if_none:'3.26.4' }}/raven.min.js" ></script>
<script
src="https://browser.sentry-cdn.com/{{ raven_js_version }}/bundle.min.js"
integrity="sha384-a1zd+NHj/GIqnlXIHuEKFontqYxBdK9Zwslrvnhr1KfU9tBDzKbM55gQFXlHYDiD"
crossorigin="anonymous"
></script>

<script>
var ravenOptions = {
release: '{{ release }}',

Sentry.init({
dsn: "{{ raven_js_dsn }}",
// this assumes your build process sets "npm_package_version" in the env
release: "gitcoin-web@{{ release }}",
environment: '{{ env }}',
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
Expand All @@ -43,7 +54,7 @@
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
'conduitPage'
],
ignoreUrls: [
denyUrls: [
// Facebook flakiness
/graph\.facebook\.com/i,
// Facebook blocked
Expand All @@ -59,14 +70,13 @@
/webappstoolbarba\.texthelp\.com\//i,
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i
]
};
Raven.config('{{ raven_js_dsn }}', ravenOptions).install()
{% if github_handle %}
Raven.setUserContext({
id: '{{ user.id|default_if_none:"0" }}',
handle: '{{ github_handle }}',
profile_id: '{{ profile_id|default_if_none:"0" }}'
});
{% if github_handle %}
Sentry.setUser({
username: '{{ github_handle }}',
id: {{ user.id|default_if_none:"0" }}
});
Sentry.setTag("profile_id", {{ profile_id|default_if_none:"0" }});
{% endif %}
</script>
{% endif %}
12 changes: 0 additions & 12 deletions app/retail/templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,4 @@ <h1>{% blocktrans %}Error {{code}}.{% endblocktrans %}</h1>
{% endblocktrans %}</p>
<img class="mt-4" style="max-width: 22rem;" src="{% static "v2/images/shrug_bot.png" %}">
{% endif %}
{% comment %}
{% if code == 500 and request.sentry.id %}
{% load raven %}
<script src="https://cdn.ravenjs.com/{{ raven_js_version }}/raven.min.js"></script>
<script>
Raven.showReportDialog({
eventId: '{{ request.sentry.id }}',
dsn: '{% sentry_public_dsn "https" %}'
});
</script>
{% endif %}
{% endcomment %}
{% endblock %}
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ redis-semaphore
watchtower==0.5.4
Wand==0.4.4
raven==6.9.0
sentry-sdk==0.19.5
sentry-sdk==1.1.0
websocket-client
bleach
python-magic
Expand Down
0