Skip to content

Observability plugin system #203

@ajgray-stripe

Description

@ajgray-stripe

👋 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.py file defining an ObservabilityPlugin ABC, with one required method (named something like handle_event)
  • A general observe_wrapper decorator 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 from exchange)
  • That more general decorator farms out each calling event to the handle_event methods of all registered ObservabilityPlugins, 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions