Skip to content

Commit

Permalink
feat(onboarding): Add send_default_pii=True to Python onboarding sn…
Browse files Browse the repository at this point in the history
…ippets (#84220)

As part of getsentry/team-sdks#121 we want to
add `send_default_pii=True` to all relevant onboarding snippets for
better out-of-the-box debugability.
  • Loading branch information
sentrivana authored and c298lee committed Jan 29, 2025
1 parent 71fd73b commit 7d577e7
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 21 deletions.
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/aiohttp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ from aiohttp import web
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/asgi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
from myapp import asgi_app
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
3 changes: 3 additions & 0 deletions static/app/gettingStartedDocs/python/awslambda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
sentry_sdk.init(
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
integrations=[AwsLambdaIntegration()],${
params.isPerformanceSelected
? `
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/bottle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/celery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/chalice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ from sentry_sdk.integrations.chalice import ChaliceIntegration
sentry_sdk.init(
dsn="${params.dsn.public}",
integrations=[ChaliceIntegration()],${
integrations=[ChaliceIntegration()],
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/django.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/falcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import falcon
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/fastapi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ from fastapi import FastAPI
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/flask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import sentry_sdk
from flask import Flask
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/gcpfunctions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ from sentry_sdk.integrations.gcp import GcpIntegration
sentry_sdk.init(
dsn="${params.dsn.public}",
integrations=[GcpIntegration()],${
integrations=[GcpIntegration()],
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
3 changes: 3 additions & 0 deletions static/app/gettingStartedDocs/python/mongo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ sentry_sdk.init(
PyMongoIntegration(),
],
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
# We recommend adjusting this value in production,
Expand Down
3 changes: 3 additions & 0 deletions static/app/gettingStartedDocs/python/pyramid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
)
`;

Expand Down
7 changes: 5 additions & 2 deletions static/app/gettingStartedDocs/python/python.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down Expand Up @@ -192,7 +195,7 @@ import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",
enable_tracing=True,
traces_sample_rate=1.0,
)`,
additionalInfo: tct(
'Learn more about tracing [linkTracingOptions:options], how to use the [linkTracesSampler:traces_sampler] function, or how to [linkSampleTransactions:sample transactions].',
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/quart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ from quart import Quart
sentry_sdk.init(
dsn="${params.dsn.public}",
integrations=[QuartIntegration()],${
integrations=[QuartIntegration()],
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/rq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const getInstallSnippet = () => `pip install --upgrade 'sentry-sdk[rq]'`;

const getInitCallSnippet = (params: Params) => `
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
3 changes: 3 additions & 0 deletions static/app/gettingStartedDocs/python/sanic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
)
`;

Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/serverless.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import sentry_sdk
from sentry_sdk.integrations.serverless import serverless_function
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/starlette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ from starlette.applications import Starlette
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/tornado.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
7 changes: 4 additions & 3 deletions static/app/gettingStartedDocs/python/tryton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ from sentry_sdk.integrations.trytond import TrytondWSGIIntegration
sentry_sdk.init(
dsn="${params.dsn.public}",
integrations:[
sentry_sdk.integrations.trytond.TrytondWSGIIntegration(),
],${
integrations=[TrytondWSGIIntegration()],
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down
5 changes: 4 additions & 1 deletion static/app/gettingStartedDocs/python/wsgi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware
from my_wsgi_app import app
sentry_sdk.init(
dsn="${params.dsn.public}",${
dsn="${params.dsn.public}",
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,${
params.isPerformanceSelected
? `
# Set traces_sample_rate to 1.0 to capture 100%
Expand Down

0 comments on commit 7d577e7

Please sign in to comment.