Skip to content

Support fully qualified type path in component trace output #9583

Open
@vblagoje

Description

@vblagoje

Is your feature request related to a problem? Please describe.
In Haystack’s tracing system, each component emits metadata such as haystack.component.name, type, and input/output specs. However, haystack.component.type currently only includes the bare class name (e.g. "OpenAIChatGenerator"), without the fully qualified module path.

This creates friction for tools or devs that want to dynamically resolve or load a component by type — they’re forced to scan the codebase or maintain a manual mapping of known modules. This is especially problematic in modular or plugin-heavy environments.

Describe the solution you'd like
Add a new trace field:

"haystack.component.type_fqn": "haystack.components.generators.chat.openai.OpenAIChatGenerator"

This gives the full dotted path to the class, enabling dynamic loading and better tooling. It also aligns with how all other trace metadata already uses fully qualified paths (e.g. in input_spec types).

Describe alternatives you've considered

  • Manually resolving the class by searching across all known modules
  • Overloading type field to include module path (not backward compatible)

Additional context
Example for consistency:

"haystack.component.type": "OpenAIChatGenerator",
"haystack.component.type_fqn": "haystack.components.generators.chat.openai.OpenAIChatGenerator"

All other type fields already expose fully qualified paths (e.g. typing.List[haystack.dataclasses.chat_message.ChatMessage]), so this would bring the type field in line and remove ambiguity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority, add to the next sprint if no P1 available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions