Comments (3)
Hi @1player,
As discussed over support, the way that the AppSignal model of spans and traces works means that it is not possible to do what you describe. Furthermore, the Elixir error backend is something that we would like to deprecate going forward, in favor of framework-specific instrumentations, due to, amongst other reasons, the issues you describe.
In AppSignal, an error belongs to a trace, which is defined by its root span, and that trace is not sent to AppSignal until it is closed. Spans are not something you "inherit" from, or where you set background information for future errors. Spans represent events that take place in your application, within a broader trace that represents a response/request cycle.
If you create a trace on init/1
for your current process, that trace will currently never be closed. The error backend uses its own traces.
If the error backend used the existing init/1
trace, then that error would never be sent, as that trace will never be closed.
If the error backend used the existing init/1
trace and closed it, then the context information that you added would only apply to the first span for which it is reported. Future usages of the error backend would find no active span in that process, as the trace has been closed, and report the information without context.
Unfortunately, what you suggest is not possible to achieve in the way you describe within the AppSignal data model.
from appsignal-elixir.
Sad to see this closed without chance of further discussion.
If traces are incompatible with this request, I do not think it is unthinkable to have a separate API that stores metadata in the process dictionary that can later be attached to the exception, without involving the current design of spans.
As I said in our email conversation, not being able to have some metadata when debugging GenServers make this library less useful than it has a right to be. I hoped we could find a middle ground rather than just shutting down entirely this very valid use-case but alas...
It honestly doesn't feel great having to keep using one of your competitors for error handling because I cannot attach metadata to a process to aid debugging.
from appsignal-elixir.
As you can see, there is a chance of further discussion -- you are engaging on it, comments are not closed. The issue is, however, closed, in the sense that we do not intend to implement this.
I took a look at the implementation for the error backend before closing this, and discussed its implementation with @jeffkreeftmeijer, who initially implemented it, to see if there was a possible quick win that would make your use case better. Long story short, the first issue we encounter is that the error backend is itself run as a separate process, so it is not privy to the context of the process in which the error took place.
There is an attempt to fetch that data anyway from the processes' tracer context (this is why we store it in an ETS instead of merely as process metadata!) and add it to the ongoing trace, but tragically, in practice, the trace is already closed, and therefore lost, by the time that the error backend executes.
We could consider some per-process background metadata that the error backend could fallback to if (as it almost always happens) it fails to attach the error to its original trace. But we'd rather invest our efforts, if possible, in providing a genuinely compelling GenServer instrumentation, rather than on adding opt-in patches to the catch-all, technically-better-than-nothing error reporting system that the error backend provides.
Furthermore, the error backend is an Elixir logger backend, and these are themselves deprecated in Elixir as a whole. Rather than investing our efforts in patching up a system that will be deprecated in the future, we'd rather expand proper instrumentation to more areas of our customers' applications.
from appsignal-elixir.
Related Issues (20)
- Provide logging feature through a logger handler HOT 1
- Collect Ecto stacktraces HOT 9
- Are calls to `add_distribution_value` synchronous or asynchronous? Can they raise errors? HOT 2
- Neon startup causes errors to be sent to AppSignal HOT 2
- (Mox) testing guidelines? HOT 3
- Oban "Insert job" should not be a root span HOT 1
- AppSignal causes Phoenix to seg fault when a request is received on MacOS 13.6 HOT 12
- Expose a way to clone the Tracer stack for a process HOT 2
- Allow for additional context to be added to Tesla calls
- Memory leak when running long, work intensive Oban background job HOT 10
- Jobs cancelled via Oban Web are not properly closed HOT 1
- `Logger.error` does not log AppSignal Error HOT 2
- Clickable stack traces to directly jump into the source HOT 1
- Consider sharing exception "blame" information to aid debugging HOT 1
- Alpine aarch64-unknown-linux-musl unknown architecture HOT 2
- Elixir parameter filtering does not match Phoenix's behavior
- Include last message from genserver shut down HOT 1
- LiveComponents shown in "background" namespace HOT 3
- Failed to download binary package when compile in docker. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appsignal-elixir.