Make Tower.Event support a service name #119
Replies: 2 comments 2 replies
-
Hi @msutkowski , Thanks for starting this discussion, and detailing with clarity the motivation.
At first glance, I think this sounds like a fair request. In fact this is something that if supported natively in
It's interesting how the term "current application" is a bit tricky to define in BEAM land, given that in reality BEAM is starting multiple parallel applications when booting, your mix project app, any So even the term Will give some more thought to this... |
Beta Was this translation helpful? Give feedback.
-
Related: https://elixirforum.com/t/how-to-get-application-name-at-compile-time/59168. |
Beta Was this translation helpful? Give feedback.
-
This is a small proposal that would ultimately build on the use case mentioned in #118. Currently, Tower always assumes that the error it is processing is from the current application. While this is going to be correct the majority of the time, we could make this slightly more flexible by introducing a
service
key to the struct that defaults to the current:otp_app
(while allowing for an override). The idea here is that this is pretty minimal effort to support, but opens the door for someone to configure Tower as a centralized hub for errors from N services.The other option is we could find a way to leverage the existing
metadata
for this purpose and just not consider this at all, but I believe we'd have to deal with this comment:Some possible options for making this work to start a discussion:
config :tower, service: :my_great_service
logger_metadata
env behavior (I don't really see this one working out at all, but it's possible)Just to be clear, the goal is ultimately to find the best mechanism to say "I am an error being reported by app/service X". It's possible that this might just be a terrible idea, and that's okay! This is all still possible in user land code, but requires a bit of effort to achieve the same thing.
If this idea moves forward, I can open a similar discussion in ErrorTracker for how we make slight changes to support service aggregation.
Thanks for your time!
References:
tags
like this, but you can see howservice
is used)Beta Was this translation helpful? Give feedback.
All reactions