Skip to content

Langfuse (and other tracing providers): trace name is hardcoded to "workflow" / "message" instead of the app name #47341

Backlog

Description

@RubenCata

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When Langfuse tracing is enabled on a Workflow app (e.g. an app named "My Classifier"), every trace shows up in Langfuse with name = "workflow", regardless of the app's name. The trace list doesn't tell you which app produced each trace. With several apps sending to the same Langfuse project, every Workflow trace is called workflow and every Chatflow/Chatbot trace is called message.

Langfuse uses the trace name for filtering, dashboards, evaluations and dataset runs, so a constant value makes it useless there.

The root span names are hardcoded in api/services/tracing/canonical.py (introduced in #44673):

  • _workflow() → name="workflow"
  • _message() / chatflow root → name="message"

The Langfuse provider then maps the root span name straight to langfuse.trace.name (api/providers/trace/trace-langfuse/src/dify_trace_langfuse/provider.py, _trace_attributes).

Workarounds today all have drawbacks:

Proposal

  1. Use the app name as the root trace name by default (e.g. My Classifier), and keep the entity type in metadata (trace_entity_type is already there).
  2. Optionally, add a "Trace name" field to the per-app tracing config so it can be overridden.
  3. Also add app_name to the trace metadata.

If changing the default is a breaking change for people filtering by workflow/message, a per-app or per-provider toggle ("use app name as trace name") would also work.

2. Additional context or comments

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions