Skip to content

feat: LLM connection types#1234

Merged
adityathebe merged 1 commit into
mainfrom
feat/llm-connection-types
Dec 26, 2024
Merged

feat: LLM connection types#1234
adityathebe merged 1 commit into
mainfrom
feat/llm-connection-types

Conversation

@adityathebe
Copy link
Copy Markdown
Member

No description provided.

@adityathebe adityathebe enabled auto-merge (rebase) December 26, 2024 10:33
@adityathebe adityathebe merged commit 95d1b55 into main Dec 26, 2024
@adityathebe adityathebe deleted the feat/llm-connection-types branch December 26, 2024 10:35
yashmehrotra pushed a commit that referenced this pull request May 6, 2026
…ty middleware into reusable functions

Extract HTTP observability logic (HAR collection, HTTP logging) from individual connection types into shared middleware functions in connection/common.go. This eliminates code duplication across AWS, GCS, GKE, OpenSearch, and other connection implementations.

New observability functions:
- applyHTTPObservability: applies HAR and HTTP logging to a RoundTripper
- httpObservabilityMiddleware: returns a middleware for WrapTransport
- applyHTTPClientObservability: applies observability to commons HTTP clients
- harCollectorMiddleware: HAR-specific middleware with level-aware behavior
- httpLoggerWithContent: HTTP request/response logging with configurable detail
- metadataHARMiddleware: HAR metadata-only capture for debug-level logging

Add context methods for observability configuration:
- EffectiveHARLevel, EffectiveLogLevel: resolve per-feature log levels
- EffectiveHARCollector: select HAR collector with feature-aware config
- HTTPLoggingContent: determine header/body logging for a feature
- HARConfig: build feature-specific HAR configuration

Update connection implementations to use shared functions, reducing per-connection boilerplate. Add git HTTP transport observability support via configureGitHTTPTransport.

Add comprehensive tests for HAR and HTTP logging coexistence, ensuring body restoration across middleware layers.

Refs #1234
moshloop added a commit that referenced this pull request May 7, 2026
…ty middleware into reusable functions

Extract HTTP observability logic (HAR collection, HTTP logging) from individual connection types into shared middleware functions in connection/common.go. This eliminates code duplication across AWS, GCS, GKE, OpenSearch, and other connection implementations.

New observability functions:
- applyHTTPObservability: applies HAR and HTTP logging to a RoundTripper
- httpObservabilityMiddleware: returns a middleware for WrapTransport
- applyHTTPClientObservability: applies observability to commons HTTP clients
- harCollectorMiddleware: HAR-specific middleware with level-aware behavior
- httpLoggerWithContent: HTTP request/response logging with configurable detail
- metadataHARMiddleware: HAR metadata-only capture for debug-level logging

Add context methods for observability configuration:
- EffectiveHARLevel, EffectiveLogLevel: resolve per-feature log levels
- EffectiveHARCollector: select HAR collector with feature-aware config
- HTTPLoggingContent: determine header/body logging for a feature
- HARConfig: build feature-specific HAR configuration

Update connection implementations to use shared functions, reducing per-connection boilerplate. Add git HTTP transport observability support via configureGitHTTPTransport.

Add comprehensive tests for HAR and HTTP logging coexistence, ensuring body restoration across middleware layers.

Refs #1234
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