🐛 Bug Report: httpx and other instrumentations are not playing well with langchain instrumentation

Đang mở
#3,214 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
observability

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện một lần gọi LLM với instrumentation của cả httpx và Langchain được bật, sau đó kiểm tra cấu trúc lồng nhau của các span tạo ra. Kiểm tra các entry point của instrumentation Langchain và callback tùy chỉnh được đề cập trong báo cáo. Được xem là hoàn tất khi các span httpx và các span được tạo trong callback xuất hiện dưới dạng con của các span Langchain liên quan.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Which component is this bug for?

Langchain Instrumentation

📜 Description

For example, if you also instrument httpx (which can be useful for knowing how long each actual API call took and what was the actual response from the model, such as 529 from anthropic recently), the httpx spans will appear outside of langchain spans and after them. The same problem appears if you try to create a span or interact with the current span within a custom callback -- I would expect to be within langchain span but I am not yet in any callback.

Are there any ways to reproduce that?

👟 Reproduction steps
  • Take any OTEL-supporting platform (i.e. free honeycomb, free pydantic logfire, or self-hosted lgtm)
  • Instrument httpx and langchain
  • try invoking LLM
  • See how the POST request span appears outside of langchain span
👍 Expected behavior

Any spans created within the langchain spans should be their children.

👎 Actual Behavior with Screenshots
Image
🤖 Python Version

3.12

📃 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

Ngôn ngữ chính
Python
Star
7.5k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của traceloop/openllmetry

Tất cả issue của traceloop/openllmetry

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.