sergio
January 10, 2023, 4:33pm
1
With Appsignal, you can use deploy markers to flag when a bug happened in the git timeline.
In my appsignal.exs
file I have:
use Mix.Config
config :appsignal, :config,
otp_app: :my_app,
name: "my_app",
push_api_key: "my_key",
env: Mix.env(),
revision: System.get_env("RENDER_GIT_COMMIT")
However I don’t think it’s pulling the right value during compilation using mix release.
Does anyone have experience with this?
I’m using that setting on a project of mine and it works fine – though not using render for that one.
sergio
January 10, 2023, 5:04pm
3
Interesting, do you mind pasting your appsignal.exs file here to compare? I also tried changing to import Config
at the top of the file and it doesn’t seem to grab the revision flag.
It looks the same as the code you posted besides a different system env variable name.
sergio
January 10, 2023, 6:04pm
5
Very weird… I wonder if the ENV var is just not there.
sergio
January 10, 2023, 6:34pm
6
This worked fine:
import Config
config :appsignal, :config,
otp_app: :my_app,
name: "my_app",
push_api_key: "my_key",
env: Mix.env(),
revision: "jan-10-2023-test"
I wonder why the ENV value isn’t being loaded in properly…
sergio
January 10, 2023, 7:04pm
7
I got it to work.
For posterity, I delete the appsignal.exs
file that Appsignal recommends.
Instead I put the appsignal
configuration in runtime.exs
where I know System.get_env works fine.
if config_env() == :prod do
config :appsignal, :config,
otp_app: :my_app,
name: "my_app",
push_api_key: "my_key",
env: :prod,
revision: System.get_env("RENDER_GIT_COMMIT")
And now I can see the deploy marker.
1 Like