Skip to content

feat: Add Langfuse governance trace exporter - #17

Merged
nagasatish007 merged 2 commits into
mainfrom
feat/langfuse-governance-export
Jul 16, 2026
Merged

feat: Add Langfuse governance trace exporter#17
nagasatish007 merged 2 commits into
mainfrom
feat/langfuse-governance-export

Conversation

@nagasatish007

Copy link
Copy Markdown
Contributor

Adds tealtiger.integrations.langfuse module that exports governance decisions as Langfuse spans with appropriate levels (ERROR/WARNING/DEFAULT).

  • LangfuseGovernanceExporter class with trace() callback
  • Maps GovernanceDecision → Langfuse span with metadata
  • DENY → ERROR level, MONITOR → WARNING, ALLOW → DEFAULT
  • Includes tests and example
  • Session-based trace reuse (same session = same parent trace)

Closes #321

Pull Request

Description

Provide a clear and concise description of what this PR does.

Fixes #(issue number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Test improvements

Changes Made

Testing

Describe the tests you ran to verify your changes:

  • Unit tests pass (pytest)
  • Type checking passes (mypy src)
  • Linting passes (ruff check src tests)
  • Manual testing performed
  • Added new tests for new functionality

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Breaking Changes

If this PR introduces breaking changes, describe them here and provide migration instructions.

Screenshots (if applicable)

Add screenshots to help explain your changes.

Additional Notes

Add any other context about the PR here.

Adds tealtiger.integrations.langfuse module that exports governance
decisions as Langfuse spans with appropriate levels (ERROR/WARNING/DEFAULT).

- LangfuseGovernanceExporter class with trace() callback
- Maps GovernanceDecision → Langfuse span with metadata
- DENY → ERROR level, MONITOR → WARNING, ALLOW → DEFAULT
- Includes tests and example
- Session-based trace reuse (same session = same parent trace)

Closes #321

@nagasatish007 nagasatish007 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

Comment thread examples/langfuse_governance_traces.py Fixed
Comment thread src/tealtiger/integrations/langfuse.py Fixed
Comment thread src/tealtiger/integrations/langfuse.py Fixed
Comment thread tests/test_langfuse_integration.py Fixed
Comment thread src/tealtiger/integrations/langfuse.py Fixed
Comment thread src/tealtiger/integrations/langfuse.py Fixed
@nagasatish007
nagasatish007 merged commit 0c68f1a into main Jul 16, 2026
9 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant