fix(client): HTTP headers concatenated by dashes instead of snakecase #1404
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
Change HTTP headers from snake_case to dash-case in
span_processor.py,request.py, and update tests accordingly.span_processor.pyandrequest.py.x_langfuse_sdk_nametox-langfuse-sdk-name,x_langfuse_sdk_versiontox-langfuse-sdk-version.test_additional_headers_simple.pyto check for dash-case headers instead of snake_case.This description was created by
for 47967b9. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Updated On: 2025-10-16 15:53:24 UTC
Summary
This PR fixes HTTP header naming to follow the standard convention of using dashes instead of underscores. The changes update two SDK metadata headers (
x-langfuse-sdk-nameandx-langfuse-sdk-version) from snake_case to kebab-case in two core files and their corresponding tests.Key Changes:
x_langfuse_sdk_name→x-langfuse-sdk-nameinspan_processor.pyandrequest.pyx_langfuse_sdk_version→x-langfuse-sdk-versionin the same filesIssue Found:
The PR is incomplete - the third custom header
x_langfuse_public_keywas not updated to use dashes. This creates an inconsistent state where two headers follow HTTP standards (dashes) but one still uses underscores. All three headers should be updated together for consistency.Confidence Score: 2/5
x_langfuse_public_key) with underscores, creating an inconsistent state. This incomplete fix means the codebase will have mixed header naming conventions, which violates HTTP standards and could cause confusion. All three headers must be updated together for consistency.langfuse/_client/span_processor.py(line 88),langfuse/_utils/request.py(line 46), andtests/test_additional_headers_simple.py(lines 160, 183) need thex_langfuse_public_keyheader updated tox-langfuse-public-keyImportant Files Changed
File Analysis
x-langfuse-sdk-name,x-langfuse-sdk-version), but inconsistently leftx_langfuse_public_keywith underscores on line 88x-langfuse-sdk-name,x-langfuse-sdk-version), but inconsistently leftx_langfuse_public_keywith underscores on line 46x-langfuse-sdk-name), but inconsistently leftx_langfuse_public_keywith underscores on lines 160 and 183Sequence Diagram
sequenceDiagram participant Client as Langfuse Client participant RM as ResourceManager participant SP as LangfuseSpanProcessor participant LC as LangfuseClient participant API as Langfuse API Note over Client,API: HTTP Header Flow Client->>RM: Initialize with credentials RM->>RM: Create Fern API Client<br/>with x-langfuse-* headers Client->>SP: Create SpanProcessor<br/>with additional_headers SP->>SP: Build default_headers dict<br/>x-langfuse-sdk-name (fixed)<br/>x-langfuse-sdk-version (fixed)<br/>x_langfuse_public_key (inconsistent) SP->>SP: Merge with additional_headers SP->>API: Export spans via OTLP<br/>with merged headers Client->>LC: Create LangfuseClient<br/>for batch requests LC->>LC: generate_headers()<br/>x-langfuse-sdk-name (fixed)<br/>x-langfuse-sdk-version (fixed)<br/>x_langfuse_public_key (inconsistent) LC->>API: POST to /api/public/ingestion<br/>with generated headers Note over SP,LC: Inconsistency: x_langfuse_public_key<br/>should use dashes like other headers