-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Observability plugin system #203
Description
👋 Hey, all!
I work at Stripe, and we'd like to experiment with opening up goose for internal usage. As part of that, we'd like a telemetry plugin system, so that we can write a plugin to emit events and metrics into our infrastructure. We noticed that Langfuse support is being worked on right now, and that's the right kind of shape for what we'd want to see, but we don't use Langfuse, and it'd be great if there were a more general system for metrics that both Langfuse and our future telemetry could plug into via a standardized interface.
Happy to implement this myself! But I'd first of all appreciate guidance on whether this plan seems like a reasonable interface to have to that system:
- A
src/goose/telemetry/base.pyfile defining anObservabilityPluginABC, with one required method (named something likehandle_event) - A general
observe_wrapperdecorator which is defined in goose code (i.e. reusing the decorator pattern that the current Langfuse integration has, but it's imported from goose rather than fromexchange) - That more general decorator farms out each calling event to the
handle_eventmethods of all registeredObservabilityPlugins, where plugins are registered using the same machinery as toolkit plugins currently use
Would really appreciate if anyone could let me know if this makes sense as a reasonable plan to implement this feature!
One might also consider a more abstracted way to implement this functionality -- something like git hooks where various kinds of events occurring can trigger arbitrary functionality. Not sure whether that higher level of abstraction would be a better overall approach -- please let me know what you think!