Celery not sending the traces to Langsmith #5913

Closed
opened 2026-02-21 18:13:11 -05:00 by yindo · 2 comments
Owner

Originally created by @saurabhy27-outcomes on GitHub (Oct 4, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.8.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Set up Celery with Dify version 0.8.2 using Docker.
  2. Create an app in Dify and configure it to send traces to Langsmith.
  3. Run the app and verify whether traces are logged in Langsmith.

Resume After Dify Restart

I configured Langsmith on 24th September 2024, and the traces were successfully logged in Langsmith for 24th and 25th September. However, after the 25th, traces stopped being sent to Langsmith. When I restarted Dify on 1st October, traces began logging again, including the older logs from 25th September to 1st October.

✔️ Expected Behavior

Celery should send the trace callbacks to Langsmith.

Actual Behavior

Celery is not sending the traces to Langsmith.

Originally created by @saurabhy27-outcomes on GitHub (Oct 4, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.8.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Set up Celery with Dify version 0.8.2 using Docker. 2. Create an app in Dify and configure it to send traces to Langsmith. 3. Run the app and verify whether traces are logged in Langsmith. ### Resume After Dify Restart I configured Langsmith on 24th September 2024, and the traces were successfully logged in Langsmith for 24th and 25th September. However, after the 25th, traces stopped being sent to Langsmith. When I restarted Dify on 1st October, traces began logging again, including the older logs from 25th September to 1st October. ### ✔️ Expected Behavior Celery should send the trace callbacks to Langsmith. ### ❌ Actual Behavior Celery is not sending the traces to Langsmith.
yindo added the 🐞 bug label 2026-02-21 18:13:11 -05:00
yindo closed this issue 2026-02-21 18:13:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 4, 2024):

Hey @saurabhy27-outcomes! 👋 I'm here to help you with bugs, questions, or becoming a contributor. Let's squash those bugs together!

I found a similar unsolved discussion that might be related to your issue: Started with Local Source Code, made sure langSmith is connected properly, but log traces not printing upon adding to langsmith_trace.py, which was last updated on August 21, 2024 [1].

Regarding your issue, it seems like there might be a problem with the configuration or a potential bug in Dify version 0.8.2 related to Celery and trace logging. Since the traces resumed after restarting Dify, it could be related to a temporary connectivity issue or a problem with the persistence of trace data. You might want to check the configurations related to Celery and Langsmith integration to ensure they are correct. Additionally, reviewing any logs or error messages generated during the period when traces were not being sent could provide more insights into the issue.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 4, 2024): <!-- Greeting --> Hey @saurabhy27-outcomes! 👋 I'm here to help you with bugs, questions, or becoming a contributor. Let's squash those bugs together! <!-- Answer --> I found a similar unsolved discussion that might be related to your issue: [Started with Local Source Code, made sure langSmith is connected properly, but log traces not printing upon adding to langsmith_trace.py](https://github.com/langgenius/dify/discussions/7462), which was last updated on August 21, 2024 <sup>[[1]](https://github.com/langgenius/dify/discussions/7462)</sup>. Regarding your issue, it seems like there might be a problem with the configuration or a potential bug in Dify version 0.8.2 related to Celery and trace logging. Since the traces resumed after restarting Dify, it could be related to a temporary connectivity issue or a problem with the persistence of trace data. You might want to check the configurations related to Celery and Langsmith integration to ensure they are correct. Additionally, reviewing any logs or error messages generated during the period when traces were not being sent could provide more insights into the issue. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@dosubot[bot] commented on GitHub (Oct 4, 2024):

Hey @saurabhy27-outcomes! 👋 I'm here to help you with bugs, questions, or becoming a contributor. Let's squash those bugs together!

I found a similar unsolved discussion that might be related to your issue: Started with Local Source Code, made sure langSmith is connected properly, but log traces not printing upon adding to langsmith_trace.py, which was last updated on August 21, 2024 [1].

Regarding your issue, it seems like there might be a problem with the trace logging mechanism in Dify version 0.8.2, especially after a restart. Dify handles trace logging and forwarding to Langsmith through the LangSmithDataTrace class, which uses a Client from the langsmith package to interact with Langsmith's API. If there are any errors during the creation or updating of a run, a ValueError is raised with a message indicating the failure [2].

You might want to check the logs for any error messages related to the add_run or update_run methods in the langsmith_trace.py file to see if there are any indications of what might be going wrong. Additionally, ensure that your network connectivity between Celery and Langsmith is stable, as connectivity issues could also affect trace logging.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 4, 2024): <!-- Greeting --> Hey @saurabhy27-outcomes! 👋 I'm here to help you with bugs, questions, or becoming a contributor. Let's squash those bugs together! <!-- Answer --> I found a similar unsolved discussion that might be related to your issue: [Started with Local Source Code, made sure langSmith is connected properly, but log traces not printing upon adding to langsmith_trace.py](https://github.com/langgenius/dify/discussions/7462), which was last updated on August 21, 2024 <sup>[[1]](https://github.com/langgenius/dify/discussions/7462)</sup>. Regarding your issue, it seems like there might be a problem with the trace logging mechanism in Dify version 0.8.2, especially after a restart. Dify handles trace logging and forwarding to Langsmith through the `LangSmithDataTrace` class, which uses a `Client` from the `langsmith` package to interact with Langsmith's API. If there are any errors during the creation or updating of a run, a `ValueError` is raised with a message indicating the failure <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/ops/langsmith_trace/langsmith_trace.py)</sup>. You might want to check the logs for any error messages related to the `add_run` or `update_run` methods in the `langsmith_trace.py` file to see if there are any indications of what might be going wrong. Additionally, ensure that your network connectivity between Celery and Langsmith is stable, as connectivity issues could also affect trace logging. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5913