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 Report: Init failed when installing opentelemetry-instrumentation-openai #687

Closed
1 task done
datlife opened this issue Mar 25, 2024 · 1 comment · Fixed by #707
Closed
1 task done

🐛 Bug Report: Init failed when installing opentelemetry-instrumentation-openai #687

datlife opened this issue Mar 25, 2024 · 1 comment · Fixed by #707

Comments

@datlife
Copy link

datlife commented Mar 25, 2024

Which component is this bug for?

OpenAI Instrumentation

📜 Description

I'd like to install a standalone opentelemetry-instrumentation-openai module. Followed the README file. After installing the module, It'd throw an exception

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dnguyen/mambaforge/envs/zgap-chatbot/lib/python3.9/site-packages/opentelemetry/instrumentation/openai/__init__.py", line 3, in <module>
    from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
  File "/Users/dnguyen/mambaforge/envs/zgap-chatbot/lib/python3.9/site-packages/opentelemetry/instrumentation/instrumentor.py", line 24, in <module>
    from opentelemetry.instrumentation._semconv import (
  File "/Users/dnguyen/mambaforge/envs/zgap-chatbot/lib/python3.9/site-packages/opentelemetry/instrumentation/_semconv.py", line 19, in <module>
    from opentelemetry.semconv.trace import SpanAttributes
ModuleNotFoundError: No module named 'opentelemetry.semconv.trace'

👟 Reproduction steps

Step 1: Install opentelemetry-instrumentation-openai

$ poetry add opentelemetry-instrumentation-openai 

Step 2: Run an example code

from opentelemetry.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument()

👍 Expected behavior

No error should be reported during init step

👎 Actual Behavior with Screenshots

Exception error

image

🤖 Python Version

3.9.16

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

None

@nirga
Copy link
Member

nirga commented Mar 25, 2024

Hey @datlife thanks for flagging this! Can you try to run poetry add opentelemetry-semantic-conventions and see if it resolves this? We might have some dependency missing in our pyproject.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants