You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rails' ActiveSupport::Notifications will allow users to set up the publication of and subscription to custom event topics. See Creating custom events.
We should investigate if there is a good way to ask an app for a list of custom events it has on the go and then subscribe to those. Alternatively, we could offer an allow list of topic names to subscribe to in the agent configuration.
Tasks
Determine if a Rails app can be asked for a list of custom topics
Determine the best way to instruct the agent to subscribe to custom topics
All custom topics?
Allowlist of topics?
Blocklist of topics?
Should we expose our subscriptions API in a manner similar to our tracer API and allow the customer to have complete control over the monitoring of custom notifications? Perhaps a user could specify a datastore segment or use a generic span.
hannahramadan
changed the title
Rails notifications: subscribe to custom event topics
Rails notifications: investigate subscribe to custom event topics
Oct 17, 2022
Determine if a Rails app can be asked for a list of custom topics
The public API for events seems to want the caller to already be aware of the name of an event.
We can get at the list of string events with ActiveSupport::Notifications.notifier.instance_variable_get(:@string_subscribers).keys
The other type of events besides "string" events is "other" events, which are stored in @other_subscribers
The list of events will be mix of default Rails events AND custom events.
There does not appear to be way to differentiate the default ones from the custom ones.
We could potentially keep a predefined list of all known Rails events and suspect all others to be custom
This approach would only work if the instrumented Rails app was at or below the latest version known to the agent. Otherwise, we couldn't rule out new default events having been added by a newer Rails version.
Determine the best way to instruct the agent to subscribe to custom topics
All custom topics?
Allowlist of topics?
Blocklist of topics?
Given that the list can not be separated into custom and non-custom events, the event list is not exposed via a public API, and any automated determination cannot be easily futureproofed, I'm currently leaning to requiring an allowlist of custom events to monitor in the config.
Rails'
ActiveSupport::Notifications
will allow users to set up the publication of and subscription to custom event topics. See Creating custom events.We should investigate if there is a good way to ask an app for a list of custom events it has on the go and then subscribe to those. Alternatively, we could offer an allow list of topic names to subscribe to in the agent configuration.
Tasks
Some example custom events as described here:
The text was updated successfully, but these errors were encountered: