Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jul 8, 2025

Important

Added support for custom HTTP headers in Langfuse Python client, allowing users to specify additional headers for API and OTLP requests.

  • Behavior:
    • Added additional_headers parameter to LangfuseClient initialization in client.py.
    • Implemented header merging logic in resource_manager.py to ensure thread-safety.
    • Extended LangfuseSpanProcessor in span_processor.py to support custom headers in OTLP requests.
  • Tests:
    • Added test_additional_headers_simple.py to verify additional headers functionality, including scenarios with custom and default HTTP clients.

This description was created by Ellipsis for 3114f9e. You can customize this summary. It will automatically update as commits are pushed.


Greptile Summary

Disclaimer: Experimental PR review

Added support for custom HTTP headers in the Langfuse Python client, allowing users to specify additional headers for all API and OTLP requests.

  • Added additional_headers parameter to LangfuseClient initialization in langfuse/_client/client.py
  • Implemented header merging logic in langfuse/_client/resource_manager.py while maintaining thread-safety
  • Extended LangfuseSpanProcessor in langfuse/_client/span_processor.py to support custom headers in OTLP requests

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

3 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit 358fbd2 into main Jul 9, 2025
10 checks passed
@hassiebp hassiebp deleted the add-additional-headers branch July 9, 2025 07:45
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.

2 participants