Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DJANGO - Sentry does not work in production, only in development environments #3065

Open
luisgs7 opened this issue May 11, 2024 · 2 comments

Comments

@luisgs7
Copy link

luisgs7 commented May 11, 2024

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.1.1

Steps to Reproduce

In the local development environment, using Docker, all data is tracked to sentry, however when the same project is run in a production environment, it does not work.

The current infrastructure consists of Linux servers, Ubuntu 22.04, and the entire application runs in a docker container. It consists of a Django API, using Django version 4.0.10.

With debug activated in production, these are the logs presented:
Captura de tela de 2024-05-10 21-12-50
Captura de tela de 2024-05-10 21-12-59

Expected Result

The production code is this:

sentry_sdk.init(
    dsn=os.environ.get("SENTRY_DNS"),
    integrations=[DjangoIntegration()],
    traces_sample_rate=1.0,
    send_default_pii=True,
)

And django debugging is disabled in production.

Actual Result

Thank you in advance for your help.

@szokeasaurusrex
Copy link
Member

@luisgs7 I will need you to provide more information about your exact setup in order to be able to help you.

What is different between your development and production environments? How can you tell that Sentry is working in production, but not in development?

The one thing I can see is that in your initialization code snippet, you are setting dsn=os.environ.get("SENTRY_DNS"). Perhaps, you mean to set dsn=os.environ.get("SENTRY_DSN")?

@getsantry
Copy link

getsantry bot commented Jun 4, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Development

No branches or pull requests

2 participants