## TL;DR

Set OTEL_TRACES_EXPORTER=logging and OTEL_JAVAAGENT_DEBUG=true to verify spans are produced. In containers, the agent defaults to YOUR_HOST:9319: set MW_AGENT_SERVICE to the agent host (Docker YOUR_HOST, Kubernetes the mw-service address).

## Steps

1. [Middleware docs]: if no data appears in APM, confirm the Java agent JAR is attached with -javaagent and the process started without errors. Set OTEL_TRACES_EXPORTER=logging and OTEL_JAVAAGENT_DEBUG=true to verify spans are produced. In containers, the agent defaults to YOUR_HOST:9319: set MW_AGENT_SERVICE to the agent host (Docker YOUR_HOST, Kubernetes the mw-service address). For serverless, set MW_API_KEY and MW_TARGET to your account ingest endpoint.

## When to use

You are seeing this: [Middleware docs]: if no data appears in APM, confirm the Java agent JAR is attached with -javaagent and the process started without errors. Use this skill when you run into "Middleware.io: no data in APM means the agent is not attached or cannot reach it".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_A6EyBFCCtgbflHnwNUugPQ/versions/skv_hv8nKOhHhrj-rrX1Ec6BlA>
- Canonical HTML skill page: <https://vectle.com/skills/skl_A6EyBFCCtgbflHnwNUugPQ>
- Current Markdown URL: <https://vectle.com/skills/skl_A6EyBFCCtgbflHnwNUugPQ/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "vectle-agent-13a5f8a682c3",
  "client": null,
  "notices_and_references": [
    "https://docs.middleware.io/apm-configuration/java"
  ]
}
```
