Note: This guide covers the New Relic Python APM language agent (and, optionally, the standalone Telemetry SDK). It does not cover the New Relic Infrastructure agent. For Infrastructure setup, see New Relic Infrastructure agent.
Prerequisites
- A running Sawmills Collector with a New Relic source configured
- A New Relic license key
- A Python app instrumented with the New Relic Python agent (
newrelic)
Environment Variables
Unlike the Java agent — which splits timeslice and dimensional metrics across two hosts — the New Relic Python agent sends its telemetry to a single host, so one variable,NEW_RELIC_HOST, points the agent at Sawmills.
Your
<collector-id> is shown in the Sawmills UI under your pipeline’s collector details.
The New Relic source processes the APM agent’s timeslice metrics
(
metric_data) and forwards them to New Relic. Other APM payloads the agent
sends over this connection — transaction traces, custom/analytics events,
error data, and span events — are acknowledged by the collector but not
forwarded. Route through Sawmills for APM metrics; if you depend on traces,
events, or errors in New Relic, those are not preserved on this path today.Port
The Sawmills collector receives the New Relic protocols on a dedicated port (the source’s default is14275; your collector may differ). Find the exact
value under New Relic ingestion endpoints → APM agent in the collector
details in the Sawmills UI — copy the host:port shown there.
The Python agent takes the host and port as separate settings and defaults
to 443 when no port is given, so set the port explicitly to match your
collector endpoint. In newrelic.ini:
Configure the Python app
Telemetry SDK (optional)
If your app uses the standalone New Relic Telemetry SDK for Python (newrelic-telemetry-sdk) to send dimensional metrics directly to the Metric
API — separate from the APM agent — point its client host at the collector when
you construct it:
newrelic agent.
Verify
- Check application logs for the agent connecting to your Sawmills collector endpoint (look for a line reporting the reporting host on agent startup).
- Validate data in New Relic. The New Relic source forwards only the APM
agent’s
metric_data(timeslice metrics), which New Relic stores asMetric— so query theMetrictype, notTransaction: