Total Observability Ecosystem
Metrics, Datadog streaming, and OpenTelemetry distributed tracing pre-configured natively inside your microservice architecture.
1. OpenTelemetry Distributed Tracing (OTel)
With multiple applications talking to each other, debugging an API timeout inside a black-box environment is devastating. GO-DUCK generated apps utilize full-stack OpenTelemetry.
Note: Traces cover the entire round trip. They begin at the otelgin Router level, propagate securely via ctx context through your Controllers and Services, and are eventually finalized by the highly optimized gorm.io/plugin/opentelemetry/tracing hook at the Database execution level.
Where to view traces?
The Go application pushes these otlptracegrpc trace chunks asynchronously out to an otel-collector container over port 4317.
# The pre-packaged docker-compose spins up a Jaeger UI node
# Point your browser to:
http://localhost:16686
2. Datadog Integration (Log Consolidation)
If deployed to the cloud, GO-DUCK apps are compatible with Datadog's Agent endpoints immediately. Inside the application-prod.yml, flip the enabled: true config marker and supply an API key.
# Inside application.yml
go-duck:
logging:
datadog:
enabled: true
api-key: "YOUR_NATIVE_DD_AGENT_API_KEY_HERE"
site: "datadoghq.com"
service: "inventory-microservice"
3. System Infrastructure Metrics (Statsd)
The logger package has a sidecar implementation for Datadog's statsd. A developer can quickly drop custom logger.Count("api.hit") or logger.Histogram("db.latency") functions into their services to populate dashboard charts.
4. Prometheus & Kubernetes Autoscaling (HPA)
For Kubernetes environments, the generated microservices automatically expose a standard GET /metrics Prometheus scraping endpoint powered by github.com/prometheus/client_golang. This allows the Kubernetes Metrics Server or Prometheus Adapter to constantly poll your API and scale up your Pod Replicas horizontally when traffic increases.
5. Real-Time System Streams (SSE)
Need to see exactly how much your server is "holding up" in real time without refreshing a dashboard? GO-DUCK injects a Server-Sent Events (SSE) streaming endpoint at GET /api/system/stream.
Powered by github.com/shirou/gopsutil, this endpoint streams live JSON payloads directly to your browser containing CPU utilization, Memory consumption, and an aggregated Load Percentage metric at a configurable interval (defaults to 1 second).
{
"timestamp": "2026-05-28T19:30:01Z",
"cpu_percent": 45.2,
"mem_percent": 68.4,
"mem_used_mb": 1024,
"mem_total_mb": 4096,
"load_percentage": 56.8
}
6. Full JHipster-Style System Metrics JSON
For developers who prefer a deep dive into the JVM-style metrics (Go equivalents), a massive, rich telemetry JSON payload is natively exposed at GET /api/system/metrics.
This endpoint acts identically to the classic JHipster /management/jhimetrics endpoint, and will output:
- System/Go Stats: Process Uptime, GC Pauses, Goroutine counts, Heap allocations, and Open Files.
- HTTP Tracking Middleware: Live request counts, mean execution times, and max execution times grouped by both HTTP Status Codes and specific API Endpoints.
{
"system": {
"uptime": "10 days 4 hours 7 minutes 35 seconds",
"process_cpu_usage": 1.76,
"system_cpu_usage": 1.76,
"process_files_open": 359,
"heap_alloc_mb": 104,
"heap_sys_mb": 629,
"num_gc": 12,
"gc_pause_total_ms": 45,
"goroutines": 52
},
"endpoints": {
"GET /api/account": {
"count": 1733,
"mean_time_ms": 338.208,
"max_time_ms": 1050.2
}
},
"status_codes": {
"200": { "count": 546626, "mean_time_ms": 487.64, "max_time_ms": 3.45 }
},
"failed_calls": 284
}