Opik integration

Hi CrewAI community!

I’m working on implementing OPIK tracing for our CrewAI agents and tasks, but I’m running into some challenges. Here’s what I’m trying to achieve:

Current Setup

  • Using CrewAI for agent/task orchestration
  • Implementing OPIK tracing to monitor execution flow
  • Want to capture individual task executions and their results

Challenges

  1. Can’t seem to hook into individual task executions - we only get the final result
  2. Need to capture when each task starts/ends for proper tracing
  3. Looking for best practices on integrating external tracing tools with CrewAI

Questions

  1. Is there a recommended way to capture individual task executions?
  2. Are there any hooks/callbacks we can use to monitor task lifecycle?
  3. Any examples of integrating external tracing tools with CrewAI?

Any guidance would be greatly appreciated! Thanks in advance.

#tracing #monitoring #implementation

Hi @dev1x ! I’m Alex, Opik SDK Lead.
We’ve added an integration with crewAI recently - check out our docs! :slight_smile:

We’d love to hear your feedback!
If there is something else you’d like Opik to have for your needs, I strongly recommend sharing it in our Github Issues, we address quite a lot of community feature requests (feel free to open your PRs as well if you want :slight_smile:

P.S. yeah, having a convenient callback system that would allow us to monitor the execution flow with all the details would definetely help. We also had some challenges on that front and, in the end, just decided to go with the patching+decorators approach.
Btw it looked like the token usage logging via the litellm callback had some race condition in it (litellm captures it in a separate background thread which is not joined), our integration doesn’t have this issue :slight_smile:

1 Like