liefery-it-legacy / bugsnex Goto Github PK
View Code? Open in Web Editor NEWAPI client and logger for Bugsnag
License: MIT License
API client and logger for Bugsnag
License: MIT License
IT would be helpful to report the hostname to Bugsnag by default like the Bugsnag ruby gem does
:'(
tobi@comfy ~/github/bugsnex $ asdf local erlang 19.0
tobi@comfy ~/github/bugsnex $ mix test
** (ArgumentError) argument error
(stdlib) erl_anno.erl:318: :erl_anno.set(:file, 'nofile', -1)
(stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
(stdlib) erl_parse.yrl:1635: :erl_parse.modify_anno1/3
(stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
(stdlib) erl_parse.yrl:1659: :erl_parse.modify_anno1/3
(stdlib) erl_parse.yrl:1632: :erl_parse.modify_anno1/3
(stdlib) erl_parse.yrl:1517: :erl_parse.map_anno/2
(stdlib) erl_lint.erl:703: :erl_lint."-set_file/2-lc$^0/1-0-"/2
(stdlib) erl_lint.erl:448: :erl_lint.exprs_opt/3
(stdlib) erl_eval.erl:173: :erl_eval.check_command/2
/home/tobi/github/bugsnex/test/bugsnex/plug_test.exs:5: Phoenix.Router.__before_compile__/1
(elixir) lib/code.ex:363: Code.require_file/2
(elixir) lib/kernel/parallel_require.ex:57: anonymous fn/2 in Kernel.ParallelRequire.spawn_requires/5
๐ I am currently looking into adding this to a side project of mine and saw that bugsnex still depends on an old version of httpoison
. Is this on purpose? Or can I create a little PR that changes this?
After upgrade to plug_cowboy 2, 404 responses started to appear as errors in Bugsnag:
Erlang error: {{%Phoenix.Router.NoRouteError{conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{}, before_send: [#Function<1.1812729/1 in Plug.Logger.call/2>], body_params: %{}, cookies: %Plug.Conn.Unfetched{aspect: :cookies}, halted: false, host: "fulfillment-staging.liefery.com", method: "GET", owner: #PID<0.2309.0>, params: %{}, path_info: ["css", "vendor.css"], path_params: %{}, port: 80, private: %{Fulfillment.Router => {[], %{}}, :phoenix_endpoint => Fulfillment.Endpoint, :phoenix_router => Fulfillment.Router, :plug_session_fetch => #Function<1.58261320/1 in Plug.Session.fetch_session/1>}, query_params: %{}, query_string: "", remote_ip: {10, 10, 1, 5}, req_cookies: %Plug.Conn.Unfetched{aspect: :cookies}, req_headers: [{"accept", "text/css,*/*;q=0.1"}, {"accept-encoding", "gzip, deflate, br"}, {"accept-language", "en-US,en;q=0.9,de;q=0.8"}
[redacted]
This didn't happen when using plug_cowboy 1.
It looks like multiple other libraries for error tracking services experienced the similar problem:
I found the content in appsignal/appsignal-elixir#417 particularly informative. Here is the explanation and here is a suggestion to switch from listening to Erlang's error_logger(which we do here) to listening to Elixir's Logger.
We should investigate if the suggestion fixes the problem.
you know what to do Tobi
whitespace (especially in https://github.com/liefery/bugsnex/blob/88337578f7b158e620e53ff21387db9c3c0c0c29/test%2Fsupport%2Ftest_api.ex) is wonky sometimes
This would be useful for development.
Allowing the macro handle_errors
at compile time to be defined (configured to essentially act) like
defmacro handle_errors(metadata \\ quote(do: %{}), do: block) do
quote do
unquote(block)
end
end
instead of
defmacro handle_errors(metadata \\ quote(do: %{}), do: block) do
quote do
try do
unquote(block)
rescue
e ->
Bugsnex.notify(e, System.stacktrace, unquote(metadata))
raise e
end
end
end
thus avoiding to wrap the body with a try/rescue
, leads to stacktraces pointing to the real location of the exception.
Short question: the Bugsnex.Plug
collects the conn.params
and sends them to bugsnag. I don't see any form of cleaning in there. Does this mean that passwords are sent to bugsnag right now?
There are special kinds of metadata (see: https://github.com/liefery/bugsnex/blob/88337578f7b158e620e53ff21387db9c3c0c0c29/lib/bugsnex/notice.ex#L48). document their usage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.