feat(telemetry): add configurable OTEL exporter#36
Merged
doganarif merged 5 commits intodoganarif:mainfrom Feb 8, 2026
Merged
Conversation
…tion - BREAKING CHANGE (Internal): telemetry.InitTracer now takes a Config struct. - add stdout exporter for easier local development and debugging - add noop exporter for benchmarking and verification - fix(middleware): ensure proper trace context propagation to user handlers (Fixes doganarif#32) Benchmark Results (Apple M3): +----------------------+--------------+------------------+-----------------+ | Metric | Without OTEL | With OTEL (NoOp) | Overhead (Cost) | +----------------------+--------------+------------------+-----------------+ | Latency (ns/op) | 474.3 | 2955.0 | +2480.7 ns | | Memory (B/op) | 264 | 3784 | +3520 B | | Allocations (allocs) | 3 | 20 | +17 | +----------------------+--------------+------------------+-----------------+
Contributor
Author
|
@doganarif, thanks for the presentation at the meet up! |
- Add ExporterNoop constant for no-operation exporter - Implement noopExporter that satisfies SpanExporter interface - Add validation for unknown exporter types with clear error message - Useful for benchmarking tracing overhead without network I/O
- Replace deprecated grpc.DialContext with otlptracegrpc.New - Use otlptracegrpc options directly instead of manual gRPC connection - Remove unused direct grpc imports (now indirect dependencies) - Cleaner code with better connection management by OTEL SDK
- Test noop exporter initialization and shutdown - Test stdout exporter initialization and shutdown - Test unknown exporter type validation returns error - Test noopExporter interface implementation - Test exporter constant values
- Update WithOTelExporter doc comment with all valid values - Update example flag description to mention noop exporter
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.
Testing with Jaegar
Benchmark Results (Apple M3):