Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Error while trying CrewAI instrumentation example #979

Open
abhijitherekar opened this issue Aug 27, 2024 · 0 comments
Open

[bug] Error while trying CrewAI instrumentation example #979

abhijitherekar opened this issue Aug 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working instrumentation: crewai instrumentation Adding instrumentations to open source packages language: python Related to Python integration

Comments

@abhijitherekar
Copy link

abhijitherekar commented Aug 27, 2024

Describe the bug
Seeing circular dependency error while instrumenting crew-ai.

    from crewai import Task
ImportError: cannot import name 'Task' from partially initialized module 'crewai' (most likely due to a circular import) (/Users/abhijit/work/tracing-ai-agents/crew-ai/crewai.py)

To Reproduce
Follow the crewai instrumentation steps: https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-crewai

Expected behavior
There should be no error while instrumenting crewAI.

Screenshots

Traceback (most recent call last):
  File "/Users/abhijit/work/tracing-ai-agents/crew-ai/crewai.py", line 16, in <module>
    CrewAIInstrumentor().instrument(tracer_provider=trace_provider)
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/opentelemetry/instrumentation/instrumentor.py", line 114, in instrument
    result = self._instrument(  # pylint: disable=assignment-from-no-return
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/openinference/instrumentation/crewai/__init__.py", line 47, in _instrument
    self._wrap_functions()
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/openinference/instrumentation/crewai/__init__.py", line 80, in _wrap_functions
    wrap_execute_core()
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/openinference/instrumentation/crewai/__init__.py", line 51, in wrap_execute_core
    from crewai import Task
  File "/Users/abhijit/work/tracing-ai-agents/crew-ai/crewai.py", line 16, in <module>
    CrewAIInstrumentor().instrument(tracer_provider=trace_provider)
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/opentelemetry/instrumentation/instrumentor.py", line 114, in instrument
    result = self._instrument(  # pylint: disable=assignment-from-no-return
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/openinference/instrumentation/crewai/__init__.py", line 47, in _instrument
    self._wrap_functions()
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/openinference/instrumentation/crewai/__init__.py", line 80, in _wrap_functions
    wrap_execute_core()
  File "/opt/homebrew/anaconda3/envs/crew-ai-tracing/lib/python3.12/site-packages/openinference/instrumentation/crewai/__init__.py", line 51, in wrap_execute_core
    from crewai import Task
ImportError: cannot import name 'Task' from partially initialized module 'crewai' (most likely due to a circular import) (/Users/abhijit/work/tracing-ai-agents/crew-ai/crewai.py)

Desktop (please complete the following information):

  • MacOS

Additional context
https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-crewai

@abhijitherekar abhijitherekar added bug Something isn't working triage Issues that require triage labels Aug 27, 2024
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Aug 27, 2024
@abhijitherekar abhijitherekar changed the title [bug] CrewAI instrumentation [bug] Error while trying CrewAI instrumentation example Aug 27, 2024
@dosubot dosubot bot added the language: python Related to Python integration label Aug 27, 2024
@mikeldking mikeldking added instrumentation: crewai and removed triage Issues that require triage labels Aug 27, 2024
@harrisonchu harrisonchu added the instrumentation Adding instrumentations to open source packages label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working instrumentation: crewai instrumentation Adding instrumentations to open source packages language: python Related to Python integration
Projects
Status: 👨‍💻 In progress
Development

No branches or pull requests

3 participants