English | 中文
goner/otel is a comprehensive OpenTelemetry integration solution that provides full support for Traces, Metrics, and Logs. This component integrates various export protocols and formats, allowing you to flexibly choose the observability solution that best suits your needs.
- Complete OpenTelemetry protocol support
- Flexible exporter options (HTTP/gRPC)
- Integration with mainstream observability platforms (such as Jaeger, Zipkin, Prometheus)
- Unified configuration management
- Automated context propagation
- goner/otel - Core Component
- Responsible for setting up Propagator
- Provides unified service configuration management
- Supports automated context propagation
-
goner/otel/tracer - Basic Tracing Component
- Integrates with OpenTelemetry Tracer
- Provides stdout-based Exporter
- Supports custom sampling strategies [In Progress...]
-
- Integrates OpenTelemetry OLTP/HTTP protocol
- Supports exporting trace data to OpenTelemetry Collector
-
- Integrates OpenTelemetry OLTP/GRPC protocol
- Provides high-performance gRPC export support
-
- Supports Zipkin format export
- Compatible with existing Zipkin deployments
-
goner/otel/meter - Basic Metrics Component
- Integrates with OpenTelemetry Meter
- Provides stdout-based Exporter
- Supports various metric types (counters, gauges, histograms, etc.)
-
- Integrates OpenTelemetry OLTP/HTTP protocol
- Supports exporting metrics data to OpenTelemetry Collector
-
- Supports OpenTelemetry OLTP/GRPC protocol
- Provides high-performance metrics data transmission
-
- Supports OpenTelemetry Prometheus
metric.Reader - Provides Prometheus format metrics export
- Supports OpenTelemetry Prometheus
-
goner/otel/meter/prometheus/gin
- Gin middleware based on goner/gin Controller
- Provides HTTP endpoint for Prometheus metrics scraping
-
goner/otel/log - Basic Logging Component
- Integrates with OpenTelemetry Log
- Supports structured logging
-
- Integrates OpenTelemetry OLTP/HTTP protocol
- Supports exporting logs to OpenTelemetry Collector
-
- Integrates OpenTelemetry OLTP/GRPC protocol
- Provides high-performance log transmission
The following example demonstrates how to send OpenTelemetry data to Jaeger service using OLTP/HTTP protocol. Complete example code is available at: quick-start
Create a sample application using gonectl:
gonectl create -t otel/tracer/quick-start quick-start
cd quick-start
go mod tidyStart Jaeger All-in-One service using Docker:
docker run -d --name jaeger \
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 14250:14250 \
-p 14268:14268 \
-p 14269:14269 \
-p 9411:9411 \
jaegertracing/all-in-one:1.55Choose either of the following methods to run the application:
Using gonectl:
gonectl run ./cmdOr using standard Go commands:
go generate ./...
go run ./cmdAfter startup, access the Jaeger UI:
- Open browser and visit: http://localhost:16686
- Select service and view trace data
Each component supports customization through configuration files. For detailed configuration instructions, please refer to the documentation of each submodule.
- Recommended to use OpenTelemetry Collector in production environments
- Choose appropriate sampling strategies based on actual needs
- Configure export intervals and batch sizes reasonably
- Be mindful of performance overhead, avoid over-collection
