Skip to content

Commit

Permalink
ref(profiling): add profiles to admin and web (#5234)
Browse files Browse the repository at this point in the history
* ref(profiling): add profiles to admin and web

* use envar

* admin to 1.0
  • Loading branch information
MeredithAnya committed Dec 20, 2023
1 parent 67f0371 commit 7841111
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions snuba/admin/static/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ client.getSettings().then((settings) => {
],
// Performance Monitoring
tracesSampleRate: settings.tracesSampleRate,
// Profiles
profilesSampleRate: settings.profilesSampleRate,
// Session Replay
replaysSessionSampleRate: settings.replaysSessionSampleRate,
replaysOnErrorSampleRate: settings.replaysOnErrorSampleRate,
Expand Down
1 change: 1 addition & 0 deletions snuba/admin/static/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type AllowedTools = {
type Settings = {
dsn: string;
tracesSampleRate: number;
profilesSampleRate: number;
replaysSessionSampleRate: number;
replaysOnErrorSampleRate: number;
userEmail: string;
Expand Down
1 change: 1 addition & 0 deletions snuba/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def settings_endpoint() -> Response:
{
"dsn": settings.ADMIN_FRONTEND_DSN,
"tracesSampleRate": settings.ADMIN_TRACE_SAMPLE_RATE,
"profilesSampleRate": settings.ADMIN_PROFILES_SAMPLE_RATE,
"replaysSessionSampleRate": settings.ADMIN_REPLAYS_SAMPLE_RATE,
"replaysOnErrorSampleRate": settings.ADMIN_REPLAYS_SAMPLE_RATE_ON_ERROR,
"userEmail": g.user.email,
Expand Down
1 change: 1 addition & 0 deletions snuba/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def setup_sentry() -> None:
],
release=os.getenv("SNUBA_RELEASE"),
traces_sample_rate=settings.SENTRY_TRACE_SAMPLE_RATE,
profiles_sample_rate=settings.SNUBA_PROFILES_SAMPLE_RATE,
)


Expand Down
3 changes: 2 additions & 1 deletion snuba/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

ADMIN_FRONTEND_DSN = os.environ.get("ADMIN_FRONTEND_DSN", "")
ADMIN_TRACE_SAMPLE_RATE = float(os.environ.get("ADMIN_TRACE_SAMPLE_RATE", 1.0))
ADMIN_PROFILES_SAMPLE_RATE = float(os.environ.get("ADMIN_PROFILES_SAMPLE_RATE", 1.0))
ADMIN_REPLAYS_SAMPLE_RATE = float(os.environ.get("ADMIN_REPLAYS_SAMPLE_RATE", 0.1))
ADMIN_REPLAYS_SAMPLE_RATE_ON_ERROR = float(
os.environ.get("ADMIN_REPLAYS_SAMPLE_RATE_ON_ERROR", 1.0)
Expand Down Expand Up @@ -196,7 +197,7 @@ class RedisClusters(TypedDict):
STARFISH_SLACK_CHANNEL_ID = os.environ.get("STARFISH_SLACK_CHANNEL_ID")

# Snuba Options

SNUBA_PROFILES_SAMPLE_RATE = float(os.environ.get("SNUBA_PROFILES_SAMPLE_RATE", 0.0))
SNAPSHOT_LOAD_PRODUCT = "snuba"

BULK_CLICKHOUSE_BUFFER = 10000
Expand Down

0 comments on commit 7841111

Please sign in to comment.