# Common Setup Issues

This guide covers the most common problems encountered when instrumenting applications with OpenTelemetry and sending traces to Kloudfuse APM, with steps to diagnose and resolve each issue.

## No Traces Appear in UI

### Symptoms

- APM Trace Explorer is empty after setup
- Service does not appear in the service list
- No spans appear even after sending requests

### Diagnose

1. Confirm the application is actually emitting spans — add a test span at startup and check application logs for exporter errors.
2. Verify `kf-agent` is running and reachable from the application pod:

```bash
    kubectl get pods -n <namespace>
    kubectl exec -it <app-pod> -- nc -zv kf-agent 4317
    ```

3. Check the OTLP endpoint format — gRPC uses `http://kf-agent:4317` (no trailing slash, no path); HTTP/JSON uses `http://kf-agent:4318`.
4. Confirm `service.name` is set — without it the SDK defaults to `unknown_service:<process>` and may not appear where you expect it.
5. Confirm the sampler is not set to `always_off` or `traceidratio` with arg `0`.

### Fix

Enable debug logging for the SDK to see exporter errors in the application log output:

```bash
# Java agent
-Dotel.javaagent.debug=true

# Python
OTEL_LOG_LEVEL=debug opentelemetry-instrument python app.py
```

For Go applications, do not import OpenTelemetry internal packages. Instead, enable debug logging through your application’s normal logger and log any exporter or provider initialization errors using public OpenTelemetry APIs.
