hokie81

hokie81

How to get Sentry 7.5.2 disabled in :dev mode?

Hello,

Fairly new to Elixir here so please be gentle :wink: Our codebase is using Sentry 7.5.2. (I know that is old but I’d prefer to worry about updating it to something newer at a later time.) I am running in :dev mode but it seems like Sentry is running along with me and I think intercepting things that I’d like to see.

I am in :dev mode:

iex(113)> Mix.env()
:dev

Here are the Sentry-related environment vars as seen from inside the app:

iex(107)> System.get_env("SENTRY_DSN")
""
iex(110)> System.get_env("SENTRY_ENVIRONMENT_NAME")
""
iex(111)> System.get_env("SENTRY_INCLUDED_ENVIRONMENTS")
""
iex(115)> System.get_env("SENTRY_RELEASE")
nil

But then I see this sort of log message indicating that Sentry is trying to do something:

{
  "app": "sentry",
  "gl": "#PID<0.909.0>",
  "level": "warn",
  "message": "Failed to send Sentry event.Cannot send Sentry event because of invalid DSN",
  "metadata": {
    "domain": [
      "elixir"
    ],
    "request_id": "F5wrctA25-Dau_cAADkB",
    "time": 1701282531378937
  },
  "module": "Elixir.Sentry.Client",
  "pid": "#PID<0.30278.0>",
  "timestamp": "2023-11-29T18:28:51.000378"
}

Here are ref’s to sentry in config files:

% grep -ir sentry config
config/config.exs:  backends: [:console, Sentry.LoggerBackend],
config/config.exs:config :logger, Sentry.LoggerBackend, include_logger_metadata: true
config/config.exs:config :sentry, included_environments: []
config/releases.exs:config :sentry,
config/releases.exs:  dsn: System.get_env("SENTRY_DSN"),
config/releases.exs:  environment_name: System.get_env("SENTRY_ENVIRONMENT_NAME"),
config/releases.exs:  included_environments: System.get_env("SENTRY_ENVIRONMENT_NAME"),
config/releases.exs:  release: System.get_env("SENTRY_RELEASE")

Short of updating Sentry, how can I get Sentry to not run while in :dev mode?

Thanks humbly in advance… Chris

First Post!

hykw

hykw

What do you think about moving the Sentry settings from config/releases.exs to config/prod.secret.exs and not writing any Sentry settings in config/dev.exs?

Where Next?

Popular in Questions Top

SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement