Add OpenTelemetry OTLP exporter with full SDK support#218
Open
Add OpenTelemetry OTLP exporter with full SDK support#218
Conversation
bad79e6 to
e6d05d8
Compare
sccoache
previously approved these changes
Feb 6, 2026
724f5f7 to
a82c5e2
Compare
Implement production-ready OpenTelemetry Protocol (OTLP) exporter using the official OpenTelemetry SDK with support for both gRPC and HTTP transports. Features: - gRPC and HTTP/Protobuf protocol support - Full OTEL_* environment variable integration - Automatic resource detection (AWS, GCP, Azure, K8s) - Counter, Gauge, and Histogram metric types - Tag to attribute conversion - Thread-safe instrument caching - Proper gauge semantics via delta calculation Implementation: - Uses UpDownCounter for gauges with delta tracking to maintain absolute value semantics (workaround until stable SDK adds Gauge) - Background context for recording to avoid cancellation issues - Lock-free reads for instrument lookup in hot path - Comprehensive tests and benchmarks Documentation: - Complete README with configuration examples - Cloud resource detector usage guides - Implementation notes explaining design decisions - Example code for common use cases Bumps version to 5.9.0 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
a82c5e2 to
82249fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds production-ready OpenTelemetry Protocol (OTLP) exporter using the official OpenTelemetry SDK with comprehensive support for both gRPC and HTTP/Protobuf transports.
Features
✅ Dual Transport Support: gRPC and HTTP/Protobuf protocols
✅ Environment Variables: Full
OTEL_*environment variable support✅ Resource Detection: AWS (EC2, ECS, EKS, Lambda), GCP, Azure, K8s, host, process
✅ All Metric Types: Counter, Gauge, Histogram with proper semantics
✅ Tag Conversion: Automatic stats tags → OpenTelemetry attributes
✅ Production Ready: Thread-safe, tested, documented
Usage
Implementation Highlights
UpDownCounterwith delta calculation to maintain absolute value semantics (workaround until stable OTel SDK adds Gauge)Documentation
Testing
Changes
otlp/sdk_handler.go- Main OpenTelemetry SDK integrationotlp/sdk_handler_test.go- Comprehensive testsotlp/example_test.go- Usage examplesotlp/README.md- Complete documentationotlp/IMPLEMENTATION_NOTES.md- Design decisionsREADME.md- Added OpenTelemetry backend overviewHISTORY.md- Added v5.9.0 release notesversion/version.go- Bumped to 5.9.0otlp/go.mod- Added OpenTelemetry SDK dependenciesBackward Compatibility
✅ Fully backward compatible - This is a new feature addition that doesn't change existing APIs. The legacy
otlp.Handlerremains available for existing users.🤖 Generated with Claude Code