OpenTelemetry
OTel Collector gRPC:http://109.199.120.120:4317
OTel Collector HTTP: http://109.199.120.120:4318
Config: /opt/coderz/configs/otel-collector/config.yml
Kibana Traces Index: coderz-otel-traces*
Kibana Logs Index: coderz-otel-logs*
OpenTelemetry is the observability standard the Coderz Stack uses to collect traces, metrics, and structured logs from the .NET API in a vendor-neutral way. Instead of each service sending data directly to Grafana or Elasticsearch, all telemetry flows through a single OTel Collector that routes it to the right backend.
Why OpenTelemetry?
| Without OTel | With OTel |
|---|---|
| Each service hardcodes its monitoring backend | Services emit to a standard OTLP endpoint — backends are swappable |
| Logs, metrics, and traces are in separate, unlinked systems | Trace IDs link logs → traces → metrics for the same request |
| Adding a new backend requires code changes in every service | Add a new exporter in config.yml — zero service code changes |
| Vendor lock-in (Datadog, New Relic, etc.) | 100% open standard, works with any OTLP-compatible backend |
How It Works
coderz-otel-collector) and is the only component that knows about the storage backends. The .NET API just sends to http://otel-collector:4317 and the collector handles the rest.
The Three Pillars
1. Traces
A trace follows a single request end-to-end across all the components it touches. Each step (HTTP handler → database query → cache lookup) becomes a span within the trace. In the .NET API, the following are automatically traced:- Every incoming HTTP request (path, method, status code, duration)
- Every outgoing HTTP client call
- Every Entity Framework / PostgreSQL query (with the SQL statement)
coderz-otel-traces) and visible in Kibana under the OTel Traces data view.
Example: what a trace tells you
AThat breakdown is impossible to get from a single metric or log line — traces give you the full picture.GET /api/itemsrequest took 320 ms total. → 5 ms: route matching → 2 ms: Redis cache miss check → 310 ms:SELECT * FROM items WHERE ...on PostgreSQL → 3 ms: JSON serialization
2. Metrics
OTel metrics from the .NET API are pushed to Prometheus viaremote_write. This means they appear in PromQL and all Grafana dashboards alongside node-exporter and cAdvisor data.
Automatically collected .NET metrics:
| Metric | Source | What It Shows |
|---|---|---|
http_server_request_duration_seconds | ASP.NET Core instrumentation | Request latency histogram |
http_server_active_requests | ASP.NET Core instrumentation | In-flight requests |
dotnet_gc_collections_total | Runtime instrumentation | Garbage collection frequency |
dotnet_gc_heap_size_bytes | Runtime instrumentation | Managed heap usage |
dotnet_threadpool_threads_count | Runtime instrumentation | Thread pool health |
http_client_request_duration_seconds | HttpClient instrumentation | Outbound call latency |
3. Logs
OTel structured logs from the .NET API are sent to Elasticsearch (coderz-otel-logs). They carry the same trace ID and span ID as the traces, so you can pivot from a slow trace directly to the logs emitted during that request.
Log fields exported:
TraceId,SpanId— link to the trace in KibanaSeverityText— log level (INFO, WARN, ERROR)Body— the formatted log messagedeployment.environment— alwaysproduction(injected by the collector processor)
These are in addition to the existing Filebeat log pipeline. The OTel log path gives you trace-correlated logs; Filebeat gives you all container stdout.
Collector Configuration
File:/opt/coderz/configs/otel-collector/config.yml
Adding a New Exporter
To also send traces to Jaeger (for example), add toconfig.yml and restart the collector — no changes needed in the .NET API:
.NET API Integration
File:/opt/coderz/configs/dotnet-api/Program.cs
The .NET API uses the official OpenTelemetry.NET SDK with three instrumentation packages:
/metrics— Prometheus scrape endpoint/health— health check/api/health— API health check
Viewing Telemetry
Traces & Logs in Kibana
- Open Kibana: http://109.199.120.120:5601
- Go to Discover
- Select the OTel Traces data view (
coderz-otel-traces*) to browse request spans - Select the OTel Logs data view (
coderz-otel-logs*) to browse structured logs - Filter by
TraceIdto correlate logs with a specific trace
Metrics in Grafana
- Open Grafana: http://109.199.120.120:3000
- Open the .NET API Full Stack dashboard
- All panels under “Runtime” and “HTTP” sections use OTel-sourced metrics