Someone on your platform team changes one setting on the trace-sampling gateways. It's a reasonable change: they want tail sampling to wait a bit longer before deciding which traces to keep.

A couple of minutes later, the gateway's export errors are still at 0%. Its queue is empty, nothing is dropped on the way out, and its connection to New Relic is healthy. Judging by the export side, the pipeline looks fine.

It isn't. The gateway has started turning traces away at the door.

That's a real run from our lab, and it's a common way for a collector to lose data. The good news: you don't need to know where to look. One number on the collector's summary page tells you something is wrong, one click shows you why and where, one config change fixes it. This post walks through it end to end with Collector Observability, which shows a collector’s internal telemetry in New Relic.

Why gateways run out of memory

Lots of teams run a tier of gateway collectors: apps and agents send telemetry to the gateways, and the gateways send it on to New Relic. Gateways are also a common home for tail sampling. Instead of deciding up front which traces to keep, the gateway holds a trace's spans in memory for a while, giving the rest of the trace time to arrive, then decides. How long it waits is the decision_wait setting.

So the memory math is roughly: spans held ≈ spans per second × decision wait. Wait longer, and the gateway holds proportionally more.

To keep a collector from running out of memory and crashing, the OpenTelemetry Collector's documentation recommends running the memory limiter processor on every collector. When memory use gets close to the limit you set, the limiter starts turning new data away with a "data refused due to high memory usage" error. Senders typically retry, but if the pressure lasts, their buffers can fill up and data can be dropped on their side.

Enable internal telemetry in one step

Collectors don't send their own telemetry anywhere by default, so the one setup step is turning on the collector's internal telemetry and pointing it at New Relic. Collector Observability works with any OTel collector. With NRDOT, New Relic's collector distribution, you can add a --config flag that layers New Relic's example config on top of your own:

docker run \
  -p 4317:4317 -p 4318:4318 \
  -e INTERNAL_TELEMETRY_NEW_RELIC_LICENSE_KEY='...' \
  -e INTERNAL_TELEMETRY_SERVICE_NAME='my-gateway' \
  -v "$(pwd)/gateway-config.yaml:/etc/nrdot-collector/config.yaml" \
  -v "$(pwd)/internal-telemetry-config.yaml:/etc/nrdot-collector/config-internal.yaml" \
  newrelic/nrdot-collector:2.7.3 \
  --config=/etc/nrdot-collector/config.yaml \
  --config=/etc/nrdot-collector/config-internal.yaml

Here gateway-config.yaml is the gateway config you already run; the second file adds the collector's own telemetry. (If your config already sets service::telemetry, see the setup docs on how the two files merge.) The lighter normal metrics level (INTERNAL_TELEMETRY_METRICS_LEVEL=normal) covers everything in this post. If your account isn't in the US region, also set INTERNAL_TELEMETRY_OTLP_ENDPOINT. Full steps are in the setup docs.

Read the summary KPIs

Open your collector under APM & Services > Services - OpenTelemetry, and the summary page leads with six KPIs.

Think of your collector as a building with a front door and a back door. Telemetry comes in the front, gets processed, and leaves out the back toward New Relic. On a healthy day, what comes in goes out: Items received ≈ Items sent.

When those two stop matching, the other four KPIs tell you where the data went:

Where the data isKPIHealthy value

Coming in the front door

Items received

your normal rate

Turned away at the front door

Receiver refused

0

Waiting inside to be sent

Queue saturation

low

Thrown out because the waiting area is full

Queue drops

0

Failed on the way out the back door

Export failure rate

0%

Out the back door

Items sent

≈ Items received

One thing to keep in mind: data that's turned away at the front door never gets in. So received and sent can still match even while the collector is refusing data. That's why Receiver refused is the KPI to watch in this post, and why it should normally sit at zero.

(Two exceptions to "in ≈ out": if you sample or filter on purpose, less goes out than comes in; if you send to more than one destination, more goes out.)

Here's our gateway on a normal day: 1.85k spans per second in, the same out, and zeros everywhere else.

A healthy gateway: in = out, nothing refused, nothing lost. [crop: tiles; drop the % badges, which compare against the lab's startup]

See it: one KPI moves

Now the config change. We raised decision_wait from 10 seconds to 90 seconds, the kind of thing you'd do to keep long-running traces intact. Traffic didn't change.

processors:
  tail_sampling:
    decision_wait: 90s   # was 10s

About a minute and a half later, Receiver refused jumped from 0 to about 44 spans per second. Every other loss KPI stayed at zero: no queue drops, no export failures. And Items received fell from 1.85k to about 1.12k spans per second, as senders were turned away and fell behind.

Those spans don't vanish at the gateway: they're refused, and they back up at the senders. If the pressure lasts, senders drop them once their buffers fill, often with nothing more than a line in their own logs.

One KPI moves: Receiver refused is no longer zero, and intake drops with it. Export failures and queue drops stay at zero.

Understand it: one click

Click Receiver refused. The detail view puts the charts that most often explain refusals right next to it, starting with the memory limiter. Here, the memory limiter drop ratio climbs while the collector's memory levels off: the memory limiter is doing its job, and it's what's refusing the data. (Don't expect the memory chart to match the limit you set. The limiter tracks the Go heap, while the chart shows the whole process, which runs higher.)

Refused spans, the memory limiter's drop ratio, and the collector's memory, all in one view.

The collector's own logs say the same thing, in plain words: Memory usage is above soft limit. Refusing data. You'll find them in the collector entity's Logs view. (They're logged as warnings, so they don't appear on the summary page's error log chart.)

The memory limiter, in its own words.

When memory hovers around the limit, you'll see that line repeat: the limiter logs it each time it switches back into refusing. A steady repeat usually means the gateway's normal working set no longer fits in memory, which won't clear on its own. An occasional one followed by Memory usage back within limits is more likely a short burst the limiter absorbed.

That points away from the other usual suspects. It's not the network (export failures 0%, an empty queue). It's not a traffic spike (intake went down, not up). The gateway ran out of memory headroom, and the tail-sampling buffer is what filled it.

Fix it: hold less, or make room

Whatever is using the memory, the general fixes for memory pressure are the same:

  • Hold less. Undo or tune whatever grew the collector's working set.
  • Give it more room. Raise the limiter's limit along with the container's memory, and leave headroom: the process uses more memory than the heap the limiter tracks.
  • Spread the load. Run more collector instances. Some components, such as tail sampling, need extra care when you scale them out.

For the details, see the memory limiter documentation on sizing and the OpenTelemetry guide to scaling the Collector. In our lab, the cause was a single setting, so the fix was to put decision_wait back to 10 seconds:

processors:
  tail_sampling:
    decision_wait: 10s

Verify it

Within a couple of minutes, Receiver refused was back to zero and Items received was back to about 1.87k spans per second.

Back to zero refused, and intake back to normal.

Get paged next time

Receiver refused normally sits at zero, which makes it a simple alert:

-- One condition for every collector: any collector that keeps refusing data opens an alert
SELECT rate(sum(otelcol%receiver%refused%spans%) + sum(otelcol%receiver%refused%metric%points%) + sum(otelcol%receiver%refused%log%records%), 1 second)
FROM Metric
FACET entity.name

Set the threshold to above 0 for at least 5 minutes, so a short burst the limiter absorbs doesn't page anyone. The FACET gives each collector its own alert, and the alert closes on its own once refusals stop. If you also want to know when a collector stops reporting, add a loss-of-signal threshold to the same condition.

The % wildcards are on purpose: collector metric names can change between versions, and wildcards help the query keep working after an upgrade. They're how the KPIs themselves are built.

Cheat sheet: what other failures look like

The same reading works for other collector failures. We reproduced each of these in our lab. The exact shapes depend on your pipeline and settings, so treat them as patterns rather than exact values:

What's wrongWhat the KPIs showWhere to confirmUsual fix

Memory pressure (this post)

Receiver refused above 0, Items received down; the export side often looks healthy

Receiver refused → memory limiter drop ratio

Hold less in memory, add memory, or scale out

Slow next hop (e.g. an overloaded downstream gateway)

Sent down and queue saturation climbing; once the queue fills, queue drops.

Queue drops → queue size vs capacity

More consumers, bigger queues, longer timeouts, more retries, or fix the next hop

Next hop unreachable

Sent falls toward zero; export failures and queue drops climb (which comes first depends on your retry and queue settings); a burst of sent on recovery

Export failure rate → failure rate chart

Retry and queue sizing, fix the next hop

Traffic spike (more than the next hop can take)

Received rises and sent levels off; queue saturation climbs, then queue drops

Queue saturation → queue size vs capacity

More capacity, scale out, or sample upstream

Upstream problem (not the collector)

Received and sent fall together, with queue saturation low and no loss KPIs moving

Items received → by signal

Look at the senders

Wrapping up

When something's off with a collector, start with the six KPIs, open whichever one moved, and let the detail view and logs tell you why. Here that took one tile, one click, and one config change. With this alert in place, a recurrence triggers a notification instead of waiting for someone to notice missing traces. Add the alert, and next time you hear about it in minutes instead of from a teammate wondering where their traces went.

To try it on your own collectors, start with the setup docs and keep the KPI reference handy.

現在、このページは英語版のみです。