You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(otel): implement comprehensive HTTP client instrumentation with otelhttp
Added automatic OpenTelemetry HTTP instrumentation to ALL API clients across all modules:
## 🌐 HTTP Instrumentation Added:
✅ **admin/api_client_impl.go** - Atlassian Admin API
✅ **assets/api_client_impl.go** - Jira Assets API
✅ **bitbucket/api_client_impl.go** - Bitbucket Cloud API
✅ **confluence/api_client_impl.go** - Confluence API
✅ **confluence/v2/api_client_impl.go** - Confluence v2 API
✅ **jira/agile/api_client_impl.go** - Jira Agile API
✅ **jira/sm/api_client_impl.go** - Jira Service Management API
✅ **jira/v2/api_client_impl.go** - Jira v2 API
✅ **jira/v3/api_client_impl.go** - Jira v3 API
## 🚀 Implementation Details:
- **Automatic HTTP Spans**: Every HTTP request now generates OpenTelemetry spans
- **Rich Attributes**: HTTP method, URL, status code, request/response sizes automatically captured
- **Error Tracking**: HTTP errors automatically recorded with full context
- **Zero Code Changes**: Existing code continues to work without modification
- **Safe Transport Handling**: Properly handles nil transports and preserves existing settings
## 📊 Observability Benefits:
- **HTTP Performance Monitoring**: Detailed timing for all API calls
- **Error Detection**: Automatic capture of HTTP failures with status codes
- **Request Correlation**: Full distributed tracing across HTTP boundaries
- **API Usage Analytics**: Comprehensive data on API endpoint usage patterns
## 🔧 Technical Implementation:
```go
// Wrap HTTP client with OpenTelemetry instrumentation
var transport http.RoundTripper
if httpClient.(*http.Client).Transport \!= nil {
transport = httpClient.(*http.Client).Transport
} else {
transport = http.DefaultTransport
}
instrumentedClient := &http.Client{
Transport: otelhttp.NewTransport(transport),
Timeout: httpClient.(*http.Client).Timeout,
}
```
This completes the transformation from basic span timing to full production-grade observability with automatic HTTP instrumentation, error recording, and comprehensive attributes across all Atlassian Cloud service interactions.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments