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

Raygun should not depend on Mix.Project #3

Closed
barttenbrinke opened this issue Sep 15, 2015 · 8 comments
Closed

Raygun should not depend on Mix.Project #3

barttenbrinke opened this issue Sep 15, 2015 · 8 comments

Comments

@barttenbrinke
Copy link

raygun/lib/raygun/format.ex

Lines 116 to 129 in 1f0afe1

def details do
{:ok, hostname} = :inet.gethostname
hostname = hostname |> List.to_string
%{
machineName: hostname,
version: Mix.Project.config[:deps][:raygun],
client: %{
name: Mix.Project.config[:app],
version: Mix.Project.config[:version],
clientUrl: Mix.Project.config[:raygun][:url]
}
}
end

If you are running your application in production using i.e. erts, mix is not included in your production build, therefore Mix.Project does not exist. Please remove it, or add mix as a dependency for the production environment, which would probably be a bad idea.

@brweber2
Copy link
Member

Yes, this was a bit sloppy/lazy on my part. Ideally we’d keep the details section, but I will remove the code that pull values via Mix. I may be able to get away with :application.get_env here, we’ll see.

If you have any other suggestions please send them my way either via a comment or pull request. Thanks!

On Sep 15, 2015, at 8:41 AM, Bart ten Brinke notifications@github.com wrote:

raygun/lib/raygun/format.ex

Lines 116 to 129 in 1f0afe1

def details do
{:ok, hostname} = :inet.gethostname
hostname = hostname |> List.to_string
%{
machineName: hostname,
version: Mix.Project.config[:deps][:raygun],
client: %{
name: Mix.Project.config[:app],
version: Mix.Project.config[:version],
clientUrl: Mix.Project.config[:raygun][:url]
}
}
end

raygun/lib/raygun/format.ex

Lines 116 to 129 in 1f0afe1

def details do
{:ok, hostname} = :inet.gethostname
hostname = hostname |> List.to_string
%{
machineName: hostname,
version: Mix.Project.config[:deps][:raygun],
client: %{
name: Mix.Project.config[:app],
version: Mix.Project.config[:version],
clientUrl: Mix.Project.config[:raygun][:url]
}
}
end

If you are running your application in production using i.e. erts, mix is not included in your production build, therefor Mix.Project does not exist. Please remove it, or add mix as a dependency for the production environment, which would probably not be good idea.


Reply to this email directly or view it on GitHub #3.

@barttenbrinke
Copy link
Author

I understand, but these variables just are not there anymore after compile time, :application.get_env will not help you here.

@barttenbrinke
Copy link
Author

You could probably set these options as a class variable. That should save your original reference on compile time, so that you can use it after compile time.

@brweber2
Copy link
Member

Not these Mix values, but there are values that :application.get_key can use (such as :vsn). I hope to have a patch soon. :)

On Sep 15, 2015, at 9:04 AM, Bart ten Brinke notifications@github.com wrote:

I understand, but these variables just are not there anymore after compile time, :application.get_env will not help you here.


Reply to this email directly or view it on GitHub #3 (comment).

@brweber2
Copy link
Member

Ok, I've released version 0.1.1 which should work as a release. I have the disksup stuff commented out for the moment, but I think that the rest should be working.

@barttenbrinke
Copy link
Author

Mix values should be available at compile time, but as you are compiling to production, I'm not sure actually.

@brweber2
Copy link
Member

I tested with an exrm Phoenix release and it worked. Please let me know if you have any more issues with this. I will leave this open for a few days and then I'll close it if I don't hear back. Thanks.

@barttenbrinke
Copy link
Author

@smeevil Fixed this for Honeybadger like this: smeevil/honeybadger-elixir@63f6a1c Which should work fine for Raygun, @brweber2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants