Skip to content
Snippets Groups Projects
Verified Commit 74deefce authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Safely include Sentry settings in JavaScript

parent 3b51a47b
No related branches found
No related tags found
1 merge request!745Resolve "Integrate Sentry for performance and error tracing"
Pipeline #38090 failed
......@@ -37,11 +37,14 @@
{% if SENTRY_ENABLED %}
{% include_js "Sentry" %}
{{ SENTRY_SETTINGS|json_script:"sentry_settings" }}
<script type="text/javascript">
const sentry_settings = JSON.parse(document.getElementById('sentry_settings').textContent);
Sentry.init({
dsn: '{{ SENTRY_SETTINGS.dsn }}',
environment: '{{ SENTRY_SETTINGS.environment }}',
tracesSampleRate: {{ SENTRY_SETTINGS.traces_sample_rate }},
dsn: sentry_settings.dsn,
environment: sentry_settings.environment,
tracesSampleRate: sentry_settings.traces_sample_rate,
integrations: [new Sentry.Integrations.BrowserTracing()]
});
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment