Skip to content

Commit 3114f9e

Browse files
committed
push
1 parent 39e7de9 commit 3114f9e

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

langfuse/_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class Langfuse:
105105
sample_rate (Optional[float]): Sampling rate for traces (0.0 to 1.0). Defaults to 1.0 (100% of traces are sampled). Can also be set via LANGFUSE_SAMPLE_RATE environment variable.
106106
mask (Optional[MaskFunction]): Function to mask sensitive data in traces before sending to the API.
107107
blocked_instrumentation_scopes (Optional[List[str]]): List of instrumentation scope names to block from being exported to Langfuse. Spans from these scopes will be filtered out before being sent to the API. Useful for filtering out spans from specific libraries or frameworks. For exported spans, you can see the instrumentation scope name in the span metadata in Langfuse (`metadata.scope.name`)
108-
additional_headers (Optional[Dict[str, str]]): Additional headers to include in all API requests and OTLPSpanExporter requests. These headers will be merged with default headers. Note: If httpx_client is provided, additional_headers will be ignored and a warning will be logged. Configure headers directly on your custom httpx_client instead.
108+
additional_headers (Optional[Dict[str, str]]): Additional headers to include in all API requests and OTLPSpanExporter requests. These headers will be merged with default headers. Note: If httpx_client is provided, additional_headers must be set directly on your custom httpx_client as well.
109109
110110
Example:
111111
```python

langfuse/_client/resource_manager.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,12 @@ def _initialize_instance(
184184
## could exhaust the OS's maximum number of available TCP sockets (file descriptors),
185185
## leading to connection errors.
186186
if httpx_client is not None:
187-
# If additional_headers are provided with a custom httpx_client, log warning and ignore additional_headers
188-
if additional_headers:
189-
langfuse_logger.warning(
190-
"Configuration warning: Both httpx_client and additional_headers were provided. "
191-
"additional_headers will be ignored when using a custom httpx_client. "
192-
"To use additional_headers, either omit httpx_client or configure headers directly on your custom httpx_client."
193-
)
194187
self.httpx_client = httpx_client
195188
else:
196189
# Create a new httpx client with additional_headers if provided
197190
client_headers = additional_headers if additional_headers else {}
198191
self.httpx_client = httpx.Client(timeout=timeout, headers=client_headers)
192+
199193
self.api = FernLangfuse(
200194
base_url=host,
201195
username=self.public_key,

0 commit comments

Comments
 (0)