Skip to content

fix(telemetry): added latest semantic conventions as span attributes for langfuse#1768

Open
poshinchen wants to merge 1 commit intostrands-agents:mainfrom
poshinchen:fix/langfuse-semantic-conventions-mapping
Open

fix(telemetry): added latest semantic conventions as span attributes for langfuse#1768
poshinchen wants to merge 1 commit intostrands-agents:mainfrom
poshinchen:fix/langfuse-semantic-conventions-mapping

Conversation

@poshinchen
Copy link
Contributor

@poshinchen poshinchen commented Feb 25, 2026

Description

Currently Langfuse do not read some of the latest semantic conventions via event attributes, instead they read from the span attributes. Therefore we have to add those event attributes into span attributes when users are using langfuse.

Related Issues

N/A

Documentation PR

N/A

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link

Assessment: Request Changes

Good approach to handling Langfuse's span attribute requirements. The implementation correctly adds event attributes to span attributes when using Langfuse as the OTLP endpoint.

Review Summary
  • Code Duplication: One instance of duplicated Langfuse detection logic should use the new self.is_langfuse instance variable for consistency
  • Refactoring: The removal of the _set_attributes wrapper method in favor of direct span.set_attributes() calls is a nice simplification
  • Testing: Good test coverage for both Langfuse and non-Langfuse scenarios

Once the duplicated check is replaced with self.is_langfuse, this is ready to merge.

@poshinchen poshinchen force-pushed the fix/langfuse-semantic-conventions-mapping branch from fee77b9 to d6086d3 Compare February 26, 2026 18:35
@github-actions github-actions bot added size/m and removed size/m labels Feb 26, 2026
@poshinchen poshinchen force-pushed the fix/langfuse-semantic-conventions-mapping branch from d6086d3 to 1cc145d Compare February 26, 2026 20:09
@github-actions github-actions bot added size/m and removed size/m labels Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants