mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add sentry_client_traces_sample_rate for client-side performance tracing
Separate from the server-side sentry_traces_sample_rate so admins can independently control browser performance trace sampling. Defaults to 0 (no client performance traces).
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import type { Integration } from "@sentry/core";
|
||||
import * as Sentry from "@sentry/vue";
|
||||
import Vue from "vue";
|
||||
import type VueRouter from "vue-router";
|
||||
|
||||
interface GalaxyConfig {
|
||||
sentry_dsn_public?: string;
|
||||
sentry_client_traces_sample_rate?: number;
|
||||
version_major: string;
|
||||
version_minor?: string;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ export function initSentry(Galaxy: GalaxyInstance, router: VueRouter): void {
|
||||
}
|
||||
|
||||
const replayEnabled = isReplayEnabled(Galaxy.user);
|
||||
const integrations: Integration[] = [Sentry.browserTracingIntegration({ router })];
|
||||
const integrations = [Sentry.browserTracingIntegration({ router })];
|
||||
if (replayEnabled) {
|
||||
integrations.push(
|
||||
Sentry.replayIntegration({
|
||||
@@ -65,6 +65,7 @@ export function initSentry(Galaxy: GalaxyInstance, router: VueRouter): void {
|
||||
dsn: config.sentry_dsn_public,
|
||||
integrations,
|
||||
release,
|
||||
tracesSampleRate: config.sentry_client_traces_sample_rate ?? 0,
|
||||
replaysSessionSampleRate: 0,
|
||||
replaysOnErrorSampleRate: replayEnabled ? 1.0 : 0,
|
||||
beforeSend(event, hint) {
|
||||
|
||||
@@ -3300,6 +3300,19 @@
|
||||
:Type: float
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
``sentry_client_traces_sample_rate``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
:Description:
|
||||
Sample rate for client-side (browser) performance tracing, between
|
||||
0 and 1. Controls what fraction of page loads and navigations
|
||||
generate performance traces sent to Sentry. Independent of
|
||||
sentry_traces_sample_rate, which controls server-side tracing.
|
||||
:Default: ``0.0``
|
||||
:Type: float
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
``sentry_ca_certs``
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1911,6 +1911,12 @@ galaxy:
|
||||
# to Sentry. A value higher than 0 is required to analyze performance.
|
||||
#sentry_traces_sample_rate: 0.0
|
||||
|
||||
# Sample rate for client-side (browser) performance tracing, between 0
|
||||
# and 1. Controls what fraction of page loads and navigations generate
|
||||
# performance traces sent to Sentry. Independent of
|
||||
# sentry_traces_sample_rate, which controls server-side tracing.
|
||||
#sentry_client_traces_sample_rate: 0.0
|
||||
|
||||
# Use this option to provide the path to location of the CA
|
||||
# (Certificate Authority) certificate file if the sentry server uses a
|
||||
# self-signed certificate.
|
||||
|
||||
@@ -2431,6 +2431,16 @@ mapping:
|
||||
will have that percentage chance of being sent to Sentry. A value higher than 0
|
||||
is required to analyze performance.
|
||||
|
||||
sentry_client_traces_sample_rate:
|
||||
type: float
|
||||
default: 0.0
|
||||
required: false
|
||||
desc: |
|
||||
Sample rate for client-side (browser) performance tracing, between 0
|
||||
and 1. Controls what fraction of page loads and navigations generate
|
||||
performance traces sent to Sentry. Independent of
|
||||
sentry_traces_sample_rate, which controls server-side tracing.
|
||||
|
||||
sentry_ca_certs:
|
||||
type: str
|
||||
required: False
|
||||
|
||||
@@ -245,6 +245,7 @@ class ConfigSerializer(base.ModelSerializer):
|
||||
"install_resolver_dependencies": _use_config,
|
||||
"enable_tool_generated_tours": _use_config,
|
||||
"sentry_dsn_public": lambda item, key, **context: item.sentry_dsn_public,
|
||||
"sentry_client_traces_sample_rate": _use_config,
|
||||
"enable_webhooks": lambda item, key, **context: hasattr(self.app, "webhooks_registry")
|
||||
and bool(self.app.webhooks_registry.webhooks),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user