{% from 'message_box.html' import message_box %} {# Defined before `render_status`, which calls it. #} {% macro render_frontend_status(frontend) %}
{% trans %}Browser errors{% endtrans %}
{% if not frontend.requested %} {% call message_box('info') %} {% trans -%} Browser errors are not being reported. Turn on "Report browser errors" above and give it a Sentry DSN of its own to load the JavaScript SDK on every page. {%- endtrans %} {% endcall %} {% elif not frontend.enabled %} {% call message_box('warning') %} {% trans %}Browser error reporting is on but has no DSN, so nothing is being loaded.{% endtrans %} {% endcall %} {% else %} {% call message_box('success') %} {% trans -%} The Sentry JavaScript SDK is being loaded on every page. This applies immediately - no restart needed. {%- endtrans %} {% endcall %} {% endif %}
{% trans %}Sentry host{% endtrans %} {%- if frontend.dsn_host -%} {{ frontend.dsn_host }} {%- else -%} {% trans %}not configured{% endtrans %} {%- endif -%}
{% trans %}Environment{% endtrans %} {{ frontend.environment or '-' }}
{% trans %}Release{% endtrans %} {{ frontend.release or '-' }}
{% trans %}SDK bundle{% endtrans %} {{ frontend.sdk_url }} {%- if not frontend.sdk_version %} ({% trans %}custom URL{% endtrans %}) {%- endif %}
{% trans %}Tracing / replay{% endtrans %} {% trans rate=frontend.traces_sample_rate %}traces {{ rate }}{% endtrans %}, {%- if frontend.replay %} {% trans %}replay on{% endtrans %} {%- else %} {% trans %}replay off{% endtrans %} {%- endif %}
{% if frontend.enabled %}

{% trans -%} If this instance runs with CSP_ENABLED, the plugin adds the SDK host to script-src by itself. Sending the events is a cross-origin request, so a connect-src in CSP_DIRECTIVES (and worker-src blob: for session replay) has to allow the Sentry host as well: {%- endtrans %} connect-src 'self' {{ frontend.csp_connect_src }}

{% endif %}
{% endmacro %} {% macro render_status(status, active, sdk_version, pending, frontend, test_url, reload_url) %}
{% trans %}Status of this worker{% endtrans %}
{% if status.error %} {% call message_box('error') %} {% trans error=status.error %}Sentry could not be initialised: {{ error }}{% endtrans %} {% endcall %} {% elif not active %} {% call message_box('warning') %} {% trans -%} Sentry is loaded but inactive because no DSN is configured. Set one above (or as SENTRY_DSN in indico.conf) and restart Indico. {%- endtrans %} {% endcall %} {% else %} {% call message_box('success') %} {% trans %}Sentry is active and events are being sent.{% endtrans %} {% endcall %} {% endif %} {% if pending %} {% call message_box('warning') %} {% trans settings=pending|join(', ') -%} These settings were saved but are not applied in this worker yet: {{ settings }}. Restart Indico (and the Celery workers) to apply them everywhere. {%- endtrans %} {% endcall %} {% endif %}
{% trans %}Sentry host{% endtrans %} {%- if status.dsn_host -%} {{ status.dsn_host }} ({% trans source=status.dsn_source %}from {{ source }}{% endtrans %}) {%- else -%} {% trans %}not configured{% endtrans %} {%- endif -%}
{% trans %}Environment{% endtrans %} {{ status.environment or '-' }}
{% trans %}Release{% endtrans %} {{ status.release or '-' }}
{% trans %}Integrations{% endtrans %} {{ status.integrations|join(', ') or '-' }}
{% trans %}Versions{% endtrans %} {% trans %}plugin{% endtrans %} {{ status.plugin_version }}, sentry-sdk {{ sdk_version }}

{% trans -%} Sentry is configured once per worker process. Settings marked "requires a restart" only take effect after Indico is restarted; "Reload in this worker" applies them to the single process serving this page, which is useful for testing a new DSN. {%- endtrans %}

{% if frontend %} {{ render_frontend_status(frontend) }} {% endif %}
{% endmacro %}