Coder Social home page Coder Social logo

Comments (13)

nirga avatar nirga commented on June 12, 2024 1

@torbenw Iā€™m publishing now

from openllmetry.

nirga avatar nirga commented on June 12, 2024 1

I think there's a solution! šŸ¤”

from openllmetry.

nirga avatar nirga commented on June 12, 2024

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.

npuichigo avatar npuichigo commented on June 12, 2024

@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.

torbenw avatar torbenw commented on June 12, 2024

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.

nirga avatar nirga commented on June 12, 2024

@torbenw I'll try to ask around in the community in circle back.

from openllmetry.

nirga avatar nirga commented on June 12, 2024

@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.

torbenw avatar torbenw commented on June 12, 2024

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.

nirga avatar nirga commented on June 12, 2024

@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.

torbenw avatar torbenw commented on June 12, 2024

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.

nirga avatar nirga commented on June 12, 2024

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.

npuichigo avatar npuichigo commented on June 12, 2024

how does it works?

from openllmetry.

nirga avatar nirga commented on June 12, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.