Common questions about traces, metrics, logs, and profiling on the Cosmo Router.
- What does observability mean in Cosmo Router?
- Cosmo Router emits three signals: distributed traces, Prometheus metrics, and access logs. Each signal is GraphQL-aware: spans, metrics, and log fields carry operation name, operation type, subgraph identity, and client information. The same data can be viewed in Cosmo Studio or exported to your own observability stack.
- Does Cosmo Router support OpenTelemetry and Prometheus at the same time?
- Yes, and both are on by default. The router records metrics once with the OpenTelemetry SDK, exports them over OTLP, and also serves them for Prometheus scraping at http://127.0.0.1:8088/metrics. The Prometheus endpoint listens on loopback only until you change listen_addr.
- How can I tell which feature flag or config version a router is serving?
- Query the router_info gauge. Each router reports one series for its base configuration and one per feature flag, labeled with the execution config version (wg_router_config_version), the feature flag name (wg_feature_flag), and the router version. Counting config versions across routers shows which ones picked up a schema change.
- How do I check what the router is emitting?
- Enable the Metrics Log Exporter with telemetry.metrics.otlp.log_exporter.enabled. The router then prints every collected metric, with type, attributes, and values, to its own log, next to your normal exporters. If a metric shows up there but not in your backend, the problem is downstream of the router. Turn it off afterwards because it increases log volume.
- How is metric cardinality controlled?
- The router caps metric streams with telemetry.metrics.experiment_cardinality_limit, which defaults to 2000 and is experimental. You can also drop whole metrics or single labels with Go regex patterns in the router config.
- Is OpenTelemetry supported natively?
- Yes. The router ships with built-in OpenTelemetry instrumentation that exports traces and metrics over HTTP or gRPC. W3C Trace Context propagates by default; Jaeger, B3, Datadog, and Baggage are available as options. No additional SDK or instrumentation library is required.
- Can I send telemetry to multiple backends?
- Yes. Configure multiple OTLP exporters in the router itself, for example Cosmo Cloud plus the Datadog Agent's OTLP endpoint, or run an OpenTelemetry Collector as a central hub that routes data to Cosmo Cloud, Datadog, Jaeger, and any other OTEL-compatible backend.
- What Prometheus metrics does the router expose?
- Rate, errors, and duration for both router and subgraph requests, following the R.E.D. method. The default endpoint is http://127.0.0.1:8088/metrics. Core series include router_http_requests_total, router_http_request_duration_milliseconds, and router_http_requests_error_total, with dimensions for operation name, operation type, client, subgraph, and HTTP status code.
- How do I debug a slow federated query?
- Use Distributed Tracing to see the full request path across subgraphs in Cosmo Studio. For deeper visibility, enable Advanced Request Tracing per request via the X-WG-Trace header, which returns the execution plan, fetch types, and timing in the GraphQL response extensions.
- Is observability available on the free plan?
- OpenTelemetry, Prometheus Metrics, Grafana Integration, OTEL Collector integration, Access Logs, Advanced Request Tracing, and Profiling are available on Free, Pro, and Enterprise. Distributed Tracing in Cosmo Studio is available on Pro and Enterprise.
- How do I diagnose CPU hotspots, memory leaks, or deadlocks?
- Set the PPROF_ADDR environment variable to enable Go pprof endpoints on the router, then capture heap, CPU, goroutine, block, and thread profiles and view them with go tool pprof. For continuous profiling over time, the router can upload profiles to Grafana Pyroscope.