Comments (13)
@torbenw Iām publishing now
from openllmetry.
I think there's a solution! š¤
from openllmetry.
Thanks @torbenw seems like an easy one liner fix!
We'll definitely do that, just need to make sure it's indeed working.
from openllmetry.
@nirga thanks for this update. Any eta to publish a new version so we can use it for auto instrumentation with opentelemetry-instrument?
from openllmetry.
This does not seem to work for me. Maybe there's more that has to be changed? I'm new to Python, so I don't really know how things work with installing packages.
For "opentelemetry-instrumentation-httpx" I have a file "entry_points.txt" in .../venv/Lib/site-packages/opentelemetry_instrumentation_httpx-0.44b0.dist-info:
[opentelemetry_instrumentor]
httpx = opentelemetry.instrumentation.httpx:HTTPXClientInstrumentor
In .../venv/Lib/site-packages/opentelemetry_instrumentation_langchain-0.14.1.dist-info there is no such file.
from openllmetry.
@torbenw I'll try to ask around in the community in circle back.
from openllmetry.
@torbenw great, seems that poetry doesn't support PEP-621 :/
Looks like they've been discussing it there for a while, and there's a recent open PR that tries to solve it. I'll try to help and make it get merged there so it will be resolved for us as well. But until then, there isn't an easy solution for us here unfortunately :/
from openllmetry.
I think there's more to do even if we can get the instrumentations into the entry_points.txt.
I've manually added those files to the langchain and openai instrumentation to check if it would work if they exist, but those instrumentations aren't used in the traces and there are errors:
Instrumenting of langchain failed
Traceback (most recent call last):
File "...\venv\lib\site-packages\pkg_resources\__init__.py", line 2827, in requires
deps.extend(dm[safe_extra(ext)])
KeyError: 'instruments'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "...\venv\lib\site-packages\opentelemetry\instrumentation\auto_instrumentation\_load.py", line 77, in _load_instrumentors
conflict = get_dist_dependency_conflicts(entry_point.dist)
File "...\venv\lib\site-packages\opentelemetry\instrumentation\dependencies.py", line 32, in get_dist_dependency_conflicts
for dep in dist.requires(("instruments",)):
File "...\venv\lib\site-packages\pkg_resources\__init__.py", line 2829, in requires
raise UnknownExtra(
pkg_resources.UnknownExtra: opentelemetry-instrumentation-langchain 0.14.1 has no such extra feature 'instruments'
Failed to auto initialize opentelemetry
Traceback (most recent call last):
File "...\venv\lib\site-packages\pkg_resources\__init__.py", line 2827, in requires
deps.extend(dm[safe_extra(ext)])
KeyError: 'instruments'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "...\venv\lib\site-packages\opentelemetry\instrumentation\auto_instrumentation\sitecustomize.py", line 39, in initialize
_load_instrumentors(distro)
File "...\venv\lib\site-packages\opentelemetry\instrumentation\auto_instrumentation\_load.py", line 91, in _load_instrumentors
raise exc
File "...\venv\lib\site-packages\opentelemetry\instrumentation\auto_instrumentation\_load.py", line 77, in _load_instrumentors
conflict = get_dist_dependency_conflicts(entry_point.dist)
File "...\venv\lib\site-packages\opentelemetry\instrumentation\dependencies.py", line 32, in get_dist_dependency_conflicts
for dep in dist.requires(("instruments",)):
File "...\venv\lib\site-packages\pkg_resources\__init__.py", line 2829, in requires
raise UnknownExtra(
pkg_resources.UnknownExtra: opentelemetry-instrumentation-langchain 0.14.1 has no such extra feature 'instruments'
from openllmetry.
@torbenw Hmm, that still seems to be related to the entry point. Looks like it can't find the method that instruments (although its there).
from openllmetry.
I think this is missing, too?
Example:
[project.optional-dependencies]
instruments = [
"fastapi ~= 0.58",
]
pkg_resources.UnknownExtra: opentelemetry-instrumentation-langchain 0.14.1 has no such extra feature 'instruments'
I might be misunderstanding this, I'm a Java developer with almost no Python experience. ;)
from openllmetry.
Hmm you're right I see that in other instrumentations. But it still won't work since we use Poetry and this attribute won't get bundled (if I understood correctly). So until Poetry supports PEP-621, or we switch to another build system (which will have its own issues since we have a monorepo here) we won't be able to support it :/
from openllmetry.
how does it works?
from openllmetry.
@npuichigo just install any of the instrumentations and then initialize the auto instrumentation:
pip install opentelemetry-instrumentation-openai
pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install
opentelemetry-instrument python myapp.py
from openllmetry.
Related Issues (20)
- š Bug Report: Number of tokens not reported when streaming OpenAI/AOAI HOT 2
- š Feature: Support Haystack v2 HOT 9
- š Bug Report: exceptions on instrumentation errors HOT 3
- š Bug Report: Sentry.io integration breaks HOT 1
- š Bug Report: Init failed when installing opentelemetry-instrumentation-openai HOT 1
- š Bug Report: Prompts and responses are only captured for OpenAI models HOT 5
- š Feature: Log prompts while preserving user PII with Presidio HOT 3
- š Bug Report: Error getting model name when using langchain BedrockChat HOT 3
- š Bug Report: LLamaCPP is not found by the CustomLLMInstrumentor llamaindex class HOT 3
- š Feature: Support runpod.ai HOT 2
- š Bug Report: Auto Instrumentation support for Watsonx HOT 2
- š Bug Report: AttributeError: 'NoneType' object has no attribute 'get' HOT 5
- š Feature: log content filter results in proper attributes (Azure OpenAI) HOT 7
- š Feature: Support Anthropic's Tools HOT 6
- š Feature: Update semantic convention based on latest GenAI Semantion Convention HOT 3
- š Feature: Add support for new pinecone versions HOT 1
- AttributeError: 'coroutine' object has no attribute 'get'
- TypeError: Object of type coroutine is not JSON serializable HOT 1
- š Bug Report: LLM response tracing not working for the latest version of LangChain-OpenAI HOT 1
- š Bug Report: Pinecone query asserts wrong type for filter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openllmetry.