NetGeX OTLP Local Telemetry Example
This example demonstrates how to use the NetGeX telemetry system with modern OpenTelemetry backends:
- OpenTelemetry Collector for data collection and routing
- Tempo for distributed tracing
- Prometheus for metrics
- Pyroscope for continuous profiling
- Grafana for visualization
Running the Example
1. Start the Infrastructure
First, start the required infrastructure using Docker Compose:
docker compose up -d
This will start:
2. Run the Example App
Run the example app directly:
go run app.go
The app will:
- Generate traces and send them to Tempo via OTLP
- Expose metrics for Prometheus to scrape
- Send continuous profiling data to Pyroscope
Endpoints
The app uses non-standard ports to avoid conflicts:
Exploring the Data
Traces in Grafana Tempo
- Open Grafana at http://localhost:3000
- Go to Explore and select the Tempo data source
- Click "Search" to find traces
Metrics in Prometheus
- Open Prometheus at http://localhost:9090
- Go to Graph and query metrics like
go_goroutines
Metrics in Grafana
- Open Grafana at http://localhost:3000
- Go to Explore and select the Prometheus data source
- Query metrics like
go_goroutines
Profiles in Pyroscope
- Open Pyroscope at http://localhost:4040
- The service should appear in the application dropdown
- Select different profile types (CPU, Heap, etc.)
OpenTelemetry Collector
The OpenTelemetry Collector is configured to:
- Receive data via OTLP (HTTP)
- Export traces to Tempo
- Export metrics to Prometheus
Check the configs/otel-collector-config.yaml
file for details.
Configuration
The example app uses the NetGeX configuration system. You can override settings using environment variables:
TRACING_ENDPOINT=localhost:4318 PROFILING_ENDPOINT=http://localhost:4040 go run app.go
See app.go
for the default configuration and available settings.